Lines Matching +full:fault +full:- +full:inject

2 # SPDX-License-Identifier: GPL-2.0
5 # failcmd.sh - run a command with injecting slab/page allocation failures
8 # failcmd.sh --help
12 # Run command with injecting slab/page allocation failures by fault
24 -p percent
25 --probability=percent
29 -t value
30 --times=value
34 --oom-kill-allocating-task=value
39 -h, --help
42 --interval=value, --space=value, --verbose=value, --task-filter=value,
43 --stacktrace-depth=value, --require-start=value, --require-end=value,
44 --reject-start=value, --reject-end=value, --ignore-gfp-wait=value
45 See Documentation/fault-injection/fault-injection.rst for more
49 --cache-filter=value
52 --ignore-gfp-highmem=value, --min-order=value
59 inject slab allocation failures
61 inject page allocation failures
69 if ! [[ $value =~ ^0x[0-9a-fA-F]+$ ]]; then
80 DEBUGFS=`mount -t debugfs | head -1 | awk '{ print $3}'`
82 if [ ! -d "$DEBUGFS" ]; then
87 FAILCMD_TYPE=${FAILCMD_TYPE:-failslab}
90 if [ ! -d $FAULTATTR ]; then
95 LONGOPTS=probability:,interval:,times:,space:,verbose:,task-filter:
96 LONGOPTS=$LONGOPTS,stacktrace-depth:,require-start:,require-end:
97 LONGOPTS=$LONGOPTS,reject-start:,reject-end:,oom-kill-allocating-task:,help
100 LONGOPTS=$LONGOPTS,ignore-gfp-wait:,cache-filter:
102 LONGOPTS=$LONGOPTS,ignore-gfp-wait:,ignore-gfp-highmem:,min-order:
105 TEMP=`getopt -o p:i:t:s:v:h --long $LONGOPTS -n 'failcmd.sh' -- "$@"`
112 eval set -- "$TEMP"
116 echo N > $FAULTATTR/task-filter
135 declare -i oom_kill_allocating_task=1
137 declare -i probability=1
138 declare -i times=1
142 -p|--probability)
146 -i|--interval)
150 -t|--times)
154 -s|--space)
158 -v|--verbose)
162 --task-filter)
166 --stacktrace-depth)
167 echo $2 > $FAULTATTR/stacktrace-depth
170 --require-start)
172 echo $2 > $FAULTATTR/require-start
175 --require-end)
177 echo $2 > $FAULTATTR/require-end
180 --reject-start)
182 echo $2 > $FAULTATTR/reject-start
185 --reject-end)
187 echo $2 > $FAULTATTR/reject-end
190 --oom-kill-allocating-task)
194 --ignore-gfp-wait)
195 echo $2 > $FAULTATTR/ignore-gfp-wait
198 --cache-filter)
202 --ignore-gfp-highmem)
203 echo $2 > $FAULTATTR/ignore-gfp-highmem
206 --min-order)
207 echo $2 > $FAULTATTR/min-order
210 -h|--help)
215 --)
222 [ -z "$1" ] && exit 0
225 echo $task_filter > $FAULTATTR/task-filter
231 cmd="echo 1 > /proc/self/make-it-fail && exec $@"
232 bash -c "$cmd"