PM: PM notifier error injection module
[deliverable/linux.git] / lib / Kconfig.debug
index 20341480bb5448bd14d6b90b0fea87790f38fdb1..c2024d86fb121504b4b91fa1287cbcde8588e5ad 100644 (file)
@@ -1119,6 +1119,30 @@ config CPU_NOTIFIER_ERROR_INJECT
 
          If unsure, say N.
 
+config PM_NOTIFIER_ERROR_INJECT
+       tristate "PM notifier error injection module"
+       depends on PM && NOTIFIER_ERROR_INJECTION
+       default m if PM_DEBUG
+       help
+         This option provides the ability to inject artifical errors to
+         PM notifier chain callbacks.  It is controlled through debugfs
+         interface /sys/kernel/debug/notifier-error-inject/pm
+
+         If the notifier call chain should be failed with some events
+         notified, write the error code to "actions/<notifier event>/error".
+
+         Example: Inject PM suspend error (-12 = -ENOMEM)
+
+         # cd /sys/kernel/debug/notifier-error-inject/pm/
+         # echo -12 > actions/PM_SUSPEND_PREPARE/error
+         # echo mem > /sys/power/state
+         bash: echo: write error: Cannot allocate memory
+
+         To compile this code as a module, choose M here: the module will
+         be called pm-notifier-error-inject.
+
+         If unsure, say N.
+
 config FAULT_INJECTION
        bool "Fault-injection framework"
        depends on DEBUG_KERNEL
This page took 0.023545 seconds and 5 git commands to generate.