aboutsummaryrefslogtreecommitdiffstats
path: root/Documentation/fault-injection/fault-injection.txt
diff options
context:
space:
mode:
authorAkinobu Mita <akinobu.mita@gmail.com>2012-07-30 17:43:20 -0400
committerLinus Torvalds <torvalds@linux-foundation.org>2012-07-30 20:25:22 -0400
commitc24aa64d169b7224f1a5bc6a4b1365da37ce861b (patch)
treee9974ad7a6edd7303c0b75d20fedcb7a7d5dd389 /Documentation/fault-injection/fault-injection.txt
parentd89dffa976bcd13fd87eb76e02e3b71c3a7868e3 (diff)
fault-injection: add tool to run command with failslab or fail_page_alloc
This adds tools/testing/fault-injection/failcmd.sh to run a command while injecting slab/page allocation failures via fault injection. Example: Run a command "make -C tools/testing/selftests/ run_tests" with injecting slab allocation failure. # ./tools/testing/fault-injection/failcmd.sh \ -- make -C tools/testing/selftests/ run_tests Same as above except to specify 100 times failures at most instead of one time at most by default. # ./tools/testing/fault-injection/failcmd.sh --times=100 \ -- make -C tools/testing/selftests/ run_tests Same as above except to inject page allocation failure instead of slab allocation failure. # env FAILCMD_TYPE=fail_page_alloc \ ./tools/testing/fault-injection/failcmd.sh --times=100 \ -- make -C tools/testing/selftests/ run_tests Signed-off-by: Akinobu Mita <akinobu.mita@gmail.com> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Diffstat (limited to 'Documentation/fault-injection/fault-injection.txt')
-rw-r--r--Documentation/fault-injection/fault-injection.txt27
1 files changed, 27 insertions, 0 deletions
diff --git a/Documentation/fault-injection/fault-injection.txt b/Documentation/fault-injection/fault-injection.txt
index ba4be8b77093..4cf1a2a6bd72 100644
--- a/Documentation/fault-injection/fault-injection.txt
+++ b/Documentation/fault-injection/fault-injection.txt
@@ -240,3 +240,30 @@ trap "echo 0 > /sys/kernel/debug/$FAILTYPE/probability" SIGINT SIGTERM EXIT
240echo "Injecting errors into the module $module... (interrupt to stop)" 240echo "Injecting errors into the module $module... (interrupt to stop)"
241sleep 1000000 241sleep 1000000
242 242
243Tool to run command with failslab or fail_page_alloc
244----------------------------------------------------
245In order to make it easier to accomplish the tasks mentioned above, we can use
246tools/testing/fault-injection/failcmd.sh. Please run a command
247"./tools/testing/fault-injection/failcmd.sh --help" for more information and
248see the following examples.
249
250Examples:
251
252Run a command "make -C tools/testing/selftests/ run_tests" with injecting slab
253allocation failure.
254
255 # ./tools/testing/fault-injection/failcmd.sh \
256 -- make -C tools/testing/selftests/ run_tests
257
258Same as above except to specify 100 times failures at most instead of one time
259at most by default.
260
261 # ./tools/testing/fault-injection/failcmd.sh --times=100 \
262 -- make -C tools/testing/selftests/ run_tests
263
264Same as above except to inject page allocation failure instead of slab
265allocation failure.
266
267 # env FAILCMD_TYPE=fail_page_alloc \
268 ./tools/testing/fault-injection/failcmd.sh --times=100 \
269 -- make -C tools/testing/selftests/ run_tests