~ [ source navigation ] ~ [ diff markup ] ~ [ identifier search ] ~

TOMOYO Linux Cross Reference
Linux/Documentation/fault-injection/notifier-error-inject.rst

Version: ~ [ linux-6.11.5 ] ~ [ linux-6.10.14 ] ~ [ linux-6.9.12 ] ~ [ linux-6.8.12 ] ~ [ linux-6.7.12 ] ~ [ linux-6.6.58 ] ~ [ linux-6.5.13 ] ~ [ linux-6.4.16 ] ~ [ linux-6.3.13 ] ~ [ linux-6.2.16 ] ~ [ linux-6.1.114 ] ~ [ linux-6.0.19 ] ~ [ linux-5.19.17 ] ~ [ linux-5.18.19 ] ~ [ linux-5.17.15 ] ~ [ linux-5.16.20 ] ~ [ linux-5.15.169 ] ~ [ linux-5.14.21 ] ~ [ linux-5.13.19 ] ~ [ linux-5.12.19 ] ~ [ linux-5.11.22 ] ~ [ linux-5.10.228 ] ~ [ linux-5.9.16 ] ~ [ linux-5.8.18 ] ~ [ linux-5.7.19 ] ~ [ linux-5.6.19 ] ~ [ linux-5.5.19 ] ~ [ linux-5.4.284 ] ~ [ linux-5.3.18 ] ~ [ linux-5.2.21 ] ~ [ linux-5.1.21 ] ~ [ linux-5.0.21 ] ~ [ linux-4.20.17 ] ~ [ linux-4.19.322 ] ~ [ linux-4.18.20 ] ~ [ linux-4.17.19 ] ~ [ linux-4.16.18 ] ~ [ linux-4.15.18 ] ~ [ linux-4.14.336 ] ~ [ linux-4.13.16 ] ~ [ linux-4.12.14 ] ~ [ linux-4.11.12 ] ~ [ linux-4.10.17 ] ~ [ linux-4.9.337 ] ~ [ linux-4.4.302 ] ~ [ linux-3.10.108 ] ~ [ linux-2.6.32.71 ] ~ [ linux-2.6.0 ] ~ [ linux-2.4.37.11 ] ~ [ unix-v6-master ] ~ [ ccs-tools-1.8.9 ] ~ [ policy-sample ] ~
Architecture: ~ [ i386 ] ~ [ alpha ] ~ [ m68k ] ~ [ mips ] ~ [ ppc ] ~ [ sparc ] ~ [ sparc64 ] ~

  1 Notifier error injection
  2 ========================
  3 
  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.
  8 
  9  * PM notifier
 10  * Memory hotplug notifier
 11  * powerpc pSeries reconfig notifier
 12  * Netdevice notifier
 13 
 14 PM notifier error injection module
 15 ----------------------------------
 16 This feature is controlled through debugfs interface
 17 
 18   /sys/kernel/debug/notifier-error-inject/pm/actions/<notifier event>/error
 19 
 20 Possible PM notifier events to be failed are:
 21 
 22  * PM_HIBERNATION_PREPARE
 23  * PM_SUSPEND_PREPARE
 24  * PM_RESTORE_PREPARE
 25 
 26 Example: Inject PM suspend error (-12 = -ENOMEM)::
 27 
 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
 32 
 33 Memory hotplug notifier error injection module
 34 ----------------------------------------------
 35 This feature is controlled through debugfs interface
 36 
 37   /sys/kernel/debug/notifier-error-inject/memory/actions/<notifier event>/error
 38 
 39 Possible memory notifier events to be failed are:
 40 
 41  * MEM_GOING_ONLINE
 42  * MEM_GOING_OFFLINE
 43 
 44 Example: Inject memory hotplug offline error (-12 == -ENOMEM)::
 45 
 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
 50 
 51 powerpc pSeries reconfig notifier error injection module
 52 --------------------------------------------------------
 53 This feature is controlled through debugfs interface
 54 
 55   /sys/kernel/debug/notifier-error-inject/pSeries-reconfig/actions/<notifier event>/error
 56 
 57 Possible pSeries reconfig notifier events to be failed are:
 58 
 59  * PSERIES_RECONFIG_ADD
 60  * PSERIES_RECONFIG_REMOVE
 61  * PSERIES_DRCONF_MEM_ADD
 62  * PSERIES_DRCONF_MEM_REMOVE
 63 
 64 Netdevice notifier error injection module
 65 ----------------------------------------------
 66 This feature is controlled through debugfs interface
 67 
 68   /sys/kernel/debug/notifier-error-inject/netdev/actions/<notifier event>/error
 69 
 70 Netdevice notifier events which can be failed are:
 71 
 72  * NETDEV_REGISTER
 73  * NETDEV_CHANGEMTU
 74  * NETDEV_CHANGENAME
 75  * NETDEV_PRE_UP
 76  * NETDEV_PRE_TYPE_CHANGE
 77  * NETDEV_POST_INIT
 78  * NETDEV_PRECHANGEMTU
 79  * NETDEV_PRECHANGEUPPER
 80  * NETDEV_CHANGEUPPER
 81 
 82 Example: Inject netdevice mtu change error (-22 == -EINVAL)::
 83 
 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
 88 
 89 For more usage examples
 90 -----------------------
 91 There are tools/testing/selftests using the notifier error injection features
 92 for CPU and memory notifiers.
 93 
 94  * tools/testing/selftests/cpu-hotplug/cpu-on-off-test.sh
 95  * tools/testing/selftests/memory-hotplug/mem-on-off-test.sh
 96 
 97 These scripts first do simple online and offline tests and then do fault
 98 injection tests if notifier error injection module is available.

~ [ source navigation ] ~ [ diff markup ] ~ [ identifier search ] ~

kernel.org | git.kernel.org | LWN.net | Project Home | SVN repository | Mail admin

Linux® is a registered trademark of Linus Torvalds in the United States and other countries.
TOMOYO® is a registered trademark of NTT DATA CORPORATION.

sflogo.php