aboutsummaryrefslogtreecommitdiffstats
path: root/Documentation/fault-injection/failmodule.sh
diff options
context:
space:
mode:
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 474a8b971f9c..000000000000
--- a/Documentation/fault-injection/failmodule.sh
+++ /dev/null
@@ -1,31 +0,0 @@
1#!/bin/bash
2#
3# Usage: failmodule <failname> <modulename> [stacktrace-depth]
4#
5# <failname>: "failslab", "fail_alloc_page", or "fail_make_request"
6#
7# <modulename>: module name that you want to inject faults.
8#
9# [stacktrace-depth]: the maximum number of stacktrace walking allowed
10#
11
12STACKTRACE_DEPTH=5
13if [ $# -gt 2 ]; then
14 STACKTRACE_DEPTH=$3
15fi
16
17if [ ! -d /debug/$1 ]; then
18 echo "Fault-injection $1 does not exist" >&2
19 exit 1
20fi
21if [ ! -d /sys/module/$2 ]; then
22 echo "Module $2 does not exist" >&2
23 exit 1
24fi
25
26# Disable any fault injection
27echo 0 > /debug/$1/stacktrace-depth
28
29echo `cat /sys/module/$2/sections/.text` > /debug/$1/require-start
30echo `cat /sys/module/$2/sections/.exit.text` > /debug/$1/require-end
31echo $STACKTRACE_DEPTH > /debug/$1/stacktrace-depth