1 Notifier error injection
2 ========================
4 Notifier error injection provides the ability to inject artificial errors to
5 specified notifier chain callbacks. It is useful to test the error handling of
6 notifier call chain failures which is rarely executed. There are kernel
7 modules that can be used to test the following notifiers.
10 * Memory hotplug notifier
11 * powerpc pSeries reconfig notifier
14 PM notifier error injection module
15 ----------------------------------
16 This feature is controlled through debugfs interface
18 /sys/kernel/debug/notifier-error-inject/pm/actions/<notifier event>/error
20 Possible PM notifier events to be failed are:
22 * PM_HIBERNATION_PREPARE
26 Example: Inject PM suspend error (-12 = -ENOMEM)::
28 # cd /sys/kernel/debug/notifier-error-inject/pm/
29 # echo -12 > actions/PM_SUSPEND_PREPARE/error
30 # echo mem > /sys/power/state
31 bash: echo: write error: Cannot allocate memory
33 Memory hotplug notifier error injection module
34 ----------------------------------------------
35 This feature is controlled through debugfs interface
37 /sys/kernel/debug/notifier-error-inject/memory/actions/<notifier event>/error
39 Possible memory notifier events to be failed are:
44 Example: Inject memory hotplug offline error (-12 == -ENOMEM)::
46 # cd /sys/kernel/debug/notifier-error-inject/memory
47 # echo -12 > actions/MEM_GOING_OFFLINE/error
48 # echo offline > /sys/devices/system/memory/memoryXXX/state
49 bash: echo: write error: Cannot allocate memory
51 powerpc pSeries reconfig notifier error injection module
52 --------------------------------------------------------
53 This feature is controlled through debugfs interface
55 /sys/kernel/debug/notifier-error-inject/pSeries-reconfig/actions/<notifier event>/error
57 Possible pSeries reconfig notifier events to be failed are:
59 * PSERIES_RECONFIG_ADD
60 * PSERIES_RECONFIG_REMOVE
61 * PSERIES_DRCONF_MEM_ADD
62 * PSERIES_DRCONF_MEM_REMOVE
64 Netdevice notifier error injection module
65 ----------------------------------------------
66 This feature is controlled through debugfs interface
68 /sys/kernel/debug/notifier-error-inject/netdev/actions/<notifier event>/error
70 Netdevice notifier events which can be failed are:
76 * NETDEV_PRE_TYPE_CHANGE
79 * NETDEV_PRECHANGEUPPER
82 Example: Inject netdevice mtu change error (-22 == -EINVAL)::
84 # cd /sys/kernel/debug/notifier-error-inject/netdev
85 # echo -22 > actions/NETDEV_CHANGEMTU/error
86 # ip link set eth0 mtu 1024
87 RTNETLINK answers: Invalid argument
89 For more usage examples
90 -----------------------
91 There are tools/testing/selftests using the notifier error injection features
92 for CPU and memory notifiers.
94 * tools/testing/selftests/cpu-hotplug/cpu-on-off-test.sh
95 * tools/testing/selftests/memory-hotplug/mem-on-off-test.sh
97 These scripts first do simple online and offline tests and then do fault
98 injection tests if notifier error injection module is available.