Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

[PATCH] fault-injection: Correct, disambiguate, and reformat documentation

Correct, disambiguate, and reformat documentation.

Signed-off-by: Don Mullis <dwm@meer.net>
Cc: Akinobu Mita <akinobu.mita@gmail.com>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>

authored by

Don Mullis and committed by
Linus Torvalds
5d0ffa2b 83ba2546

+37 -37
+2 -2
Documentation/fault-injection/failmodule.sh
··· 26 26 # Disable any fault injection 27 27 echo 0 > /debug/$1/stacktrace-depth 28 28 29 - echo `cat /sys/module/$2/sections/.text` > /debug/$1/address-start 30 - echo `cat /sys/module/$2/sections/.exit.text` > /debug/$1/address-end 29 + echo `cat /sys/module/$2/sections/.text` > /debug/$1/require-start 30 + echo `cat /sys/module/$2/sections/.exit.text` > /debug/$1/require-end 31 31 echo $STACKTRACE_DEPTH > /debug/$1/stacktrace-depth
+35 -35
Documentation/fault-injection/fault-injection.txt
··· 17 17 18 18 o fail_make_request 19 19 20 - injects disk IO errors on permitted devices by 20 + injects disk IO errors on devices permitted by setting 21 21 /sys/block/<device>/make-it-fail or 22 22 /sys/block/<device>/<partition>/make-it-fail. (generic_make_request()) 23 23 ··· 29 29 fault-inject-debugfs kernel module provides some debugfs entries for runtime 30 30 configuration of fault-injection capabilities. 31 31 32 - - /debug/*/probability: 32 + - /debug/fail*/probability: 33 33 34 34 likelihood of failure injection, in percent. 35 35 Format: <percent> 36 36 37 - Note that one-failure-per-handred is a very high error rate 38 - for some testcases. Please set probably=100 and configure 39 - /debug/*/interval for such testcases. 37 + Note that one-failure-per-hundred is a very high error rate 38 + for some testcases. Consider setting probability=100 and configure 39 + /debug/fail*/interval for such testcases. 40 40 41 - - /debug/*/interval: 41 + - /debug/fail*/interval: 42 42 43 43 specifies the interval between failures, for calls to 44 44 should_fail() that pass all the other tests. ··· 46 46 Note that if you enable this, by setting interval>1, you will 47 47 probably want to set probability=100. 48 48 49 - - /debug/*/times: 49 + - /debug/fail*/times: 50 50 51 51 specifies how many times failures may happen at most. 52 52 A value of -1 means "no limit". 53 53 54 - - /debug/*/space: 54 + - /debug/fail*/space: 55 55 56 56 specifies an initial resource "budget", decremented by "size" 57 57 on each call to should_fail(,size). Failure injection is 58 58 suppressed until "space" reaches zero. 59 59 60 - - /debug/*/verbose 60 + - /debug/fail*/verbose 61 61 62 62 Format: { 0 | 1 | 2 } 63 - specifies the verbosity of the messages when failure is injected. 64 - We default to 0 (no extra messages), setting it to '1' will 65 - print only to tell failure happened, '2' will print call trace too - 66 - it is useful to debug the problems revealed by fault injection 67 - capabilities. 63 + specifies the verbosity of the messages when failure is 64 + injected. '0' means no messages; '1' will print only a single 65 + log line per failure; '2' will print a call trace too -- useful 66 + to debug the problems revealed by fault injection. 68 67 69 - - /debug/*/task-filter: 68 + - /debug/fail*/task-filter: 70 69 71 - Format: { 0 | 1 } 72 - A value of '0' disables filtering by process (default). 70 + Format: { 'Y' | 'N' } 71 + A value of 'N' disables filtering by process (default). 73 72 Any positive value limits failures to only processes indicated by 74 73 /proc/<pid>/make-it-fail==1. 75 74 76 - - /debug/*/require-start: 77 - - /debug/*/require-end: 78 - - /debug/*/reject-start: 79 - - /debug/*/reject-end: 75 + - /debug/fail*/require-start: 76 + - /debug/fail*/require-end: 77 + - /debug/fail*/reject-start: 78 + - /debug/fail*/reject-end: 80 79 81 80 specifies the range of virtual addresses tested during 82 81 stacktrace walking. Failure is injected only if some caller ··· 84 85 Default required range is [0,ULONG_MAX) (whole of virtual address space). 85 86 Default rejected range is [0,0). 86 87 87 - - /debug/*/stacktrace-depth: 88 + - /debug/fail*/stacktrace-depth: 88 89 89 90 specifies the maximum stacktrace depth walked during search 90 - for a caller within [address-start,address-end). 91 + for a caller within [require-start,require-end) OR 92 + [reject-start,reject-end). 91 93 92 94 - /debug/fail_page_alloc/ignore-gfp-highmem: 93 95 94 - Format: { 0 | 1 } 95 - default is 0, setting it to '1' won't inject failures into 96 + Format: { 'Y' | 'N' } 97 + default is 'N', setting it to 'Y' won't inject failures into 96 98 highmem/user allocations. 97 99 98 100 - /debug/failslab/ignore-gfp-wait: 99 101 - /debug/fail_page_alloc/ignore-gfp-wait: 100 102 101 - Format: { 0 | 1 } 102 - default is 0, setting it to '1' will inject failures 103 + Format: { 'Y' | 'N' } 104 + default is 'N', setting it to 'Y' will inject failures 103 105 only into non-sleep allocations (GFP_ATOMIC allocations). 104 106 105 107 o Boot option ··· 124 124 Please see the definition of struct fault_attr in fault-inject.h 125 125 for details. 126 126 127 - o provide the way to configure fault attributes 127 + o provide a way to configure fault attributes 128 128 129 129 - boot option 130 130 131 131 If you need to enable the fault injection capability from boot time, you can 132 - provide boot option to configure it. There is a helper function for it. 132 + provide boot option to configure it. There is a helper function for it: 133 133 134 - setup_fault_attr(attr, str); 134 + setup_fault_attr(attr, str); 135 135 136 136 - debugfs entries 137 137 138 138 failslab, fail_page_alloc, and fail_make_request use this way. 139 - There is a helper function for it. 139 + Helper functions: 140 140 141 - init_fault_attr_entries(entries, attr, name); 142 - void cleanup_fault_attr_entries(entries); 141 + init_fault_attr_entries(entries, attr, name); 142 + void cleanup_fault_attr_entries(entries); 143 143 144 144 - module parameters 145 145 ··· 149 149 150 150 o add a hook to insert failures 151 151 152 - should_fail() returns 1 when failures should happen. 152 + Upon should_fail() returning true, client code should inject a failure. 153 153 154 - should_fail(attr,size); 154 + should_fail(attr, size); 155 155 156 156 Application Examples 157 157 --------------------