aboutsummaryrefslogtreecommitdiff
path: root/Documentation/fault-injection/failmodule.sh
diff options
context:
space:
mode:
authorAkinobu Mita <akinobu.mita@gmail.com>2007-07-15 23:40:24 -0700
committerLinus Torvalds <torvalds@woody.linux-foundation.org>2007-07-16 09:05:45 -0700
commit185848707e73382ba930857502a0b80ff6039967 (patch)
tree21a4a84ff46b1af4b0a139b3da94c705b6826b89 /Documentation/fault-injection/failmodule.sh
parent54114994f4de7e8076fc250e44501e55e19b75b5 (diff)
fault-injection: fix example scripts in documentation
Fix and cleanup example scripts in fault injection documentation. 1. Eliminate broken oops() shell function. 2. Fold failcmd.sh and failmodule.sh into example scripts. It makes the example scripts work independent of current working directory. 3. Set "space" parameter to 0 to start injecting errors immediately. 4. Use /sys/module/<modulename>/sections/.data as upper bound of .text section. Because some module doesn't have .exit.text section. 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/failmodule.sh')
-rw-r--r--Documentation/fault-injection/failmodule.sh31
1 files changed, 0 insertions, 31 deletions
diff --git a/Documentation/fault-injection/failmodule.sh b/Documentation/fault-injection/failmodule.sh
deleted file mode 100644
index 474a8b971f9..00000000000
--- a/Documentation/fault-injection/failmodule.sh
+++ /dev/null
@@ -1,31 +0,0 @@
-#!/bin/bash
-#
-# Usage: failmodule <failname> <modulename> [stacktrace-depth]
-#
-# <failname>: "failslab", "fail_alloc_page", or "fail_make_request"
-#
-# <modulename>: module name that you want to inject faults.
-#
-# [stacktrace-depth]: the maximum number of stacktrace walking allowed
-#
-
-STACKTRACE_DEPTH=5
-if [ $# -gt 2 ]; then
- STACKTRACE_DEPTH=$3
-fi
-
-if [ ! -d /debug/$1 ]; then
- echo "Fault-injection $1 does not exist" >&2
- exit 1
-fi
-if [ ! -d /sys/module/$2 ]; then
- echo "Module $2 does not exist" >&2
- exit 1
-fi
-
-# Disable any fault injection
-echo 0 > /debug/$1/stacktrace-depth
-
-echo `cat /sys/module/$2/sections/.text` > /debug/$1/require-start
-echo `cat /sys/module/$2/sections/.exit.text` > /debug/$1/require-end
-echo $STACKTRACE_DEPTH > /debug/$1/stacktrace-depth