]> git.proxmox.com Git - mirror_ubuntu-kernels.git/commit
fault-injection: add tool to run command with failslab or fail_page_alloc
authorAkinobu Mita <akinobu.mita@gmail.com>
Mon, 30 Jul 2012 21:43:20 +0000 (14:43 -0700)
committerLinus Torvalds <torvalds@linux-foundation.org>
Tue, 31 Jul 2012 00:25:22 +0000 (17:25 -0700)
commitc24aa64d169b7224f1a5bc6a4b1365da37ce861b
treee9974ad7a6edd7303c0b75d20fedcb7a7d5dd389
parentd89dffa976bcd13fd87eb76e02e3b71c3a7868e3
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>
Documentation/fault-injection/fault-injection.txt
tools/testing/fault-injection/failcmd.sh [new file with mode: 0644]