diff options
Diffstat (limited to 'lib/Kconfig.debug')
-rw-r--r-- | lib/Kconfig.debug | 91 |
1 files changed, 89 insertions, 2 deletions
diff --git a/lib/Kconfig.debug b/lib/Kconfig.debug index 4a186508bf8b..2403a63b5da5 100644 --- a/lib/Kconfig.debug +++ b/lib/Kconfig.debug | |||
@@ -1084,18 +1084,105 @@ config LKDTM | |||
1084 | Documentation on how to use the module can be found in | 1084 | Documentation on how to use the module can be found in |
1085 | Documentation/fault-injection/provoke-crashes.txt | 1085 | Documentation/fault-injection/provoke-crashes.txt |
1086 | 1086 | ||
1087 | config NOTIFIER_ERROR_INJECTION | ||
1088 | tristate "Notifier error injection" | ||
1089 | depends on DEBUG_KERNEL | ||
1090 | select DEBUG_FS | ||
1091 | help | ||
1092 | This option provides the ability to inject artifical errors to | ||
1093 | specified notifier chain callbacks. It is useful to test the error | ||
1094 | handling of notifier call chain failures. | ||
1095 | |||
1096 | Say N if unsure. | ||
1097 | |||
1087 | config CPU_NOTIFIER_ERROR_INJECT | 1098 | config CPU_NOTIFIER_ERROR_INJECT |
1088 | tristate "CPU notifier error injection module" | 1099 | tristate "CPU notifier error injection module" |
1089 | depends on HOTPLUG_CPU && DEBUG_KERNEL | 1100 | depends on HOTPLUG_CPU && NOTIFIER_ERROR_INJECTION |
1090 | help | 1101 | help |
1091 | This option provides a kernel module that can be used to test | 1102 | This option provides a kernel module that can be used to test |
1092 | the error handling of the cpu notifiers | 1103 | the error handling of the cpu notifiers by injecting artifical |
1104 | errors to CPU notifier chain callbacks. It is controlled through | ||
1105 | debugfs interface under /sys/kernel/debug/notifier-error-inject/cpu | ||
1106 | |||
1107 | If the notifier call chain should be failed with some events | ||
1108 | notified, write the error code to "actions/<notifier event>/error". | ||
1109 | |||
1110 | Example: Inject CPU offline error (-1 == -EPERM) | ||
1111 | |||
1112 | # cd /sys/kernel/debug/notifier-error-inject/cpu | ||
1113 | # echo -1 > actions/CPU_DOWN_PREPARE/error | ||
1114 | # echo 0 > /sys/devices/system/cpu/cpu1/online | ||
1115 | bash: echo: write error: Operation not permitted | ||
1093 | 1116 | ||
1094 | To compile this code as a module, choose M here: the module will | 1117 | To compile this code as a module, choose M here: the module will |
1095 | be called cpu-notifier-error-inject. | 1118 | be called cpu-notifier-error-inject. |
1096 | 1119 | ||
1097 | If unsure, say N. | 1120 | If unsure, say N. |
1098 | 1121 | ||
1122 | config PM_NOTIFIER_ERROR_INJECT | ||
1123 | tristate "PM notifier error injection module" | ||
1124 | depends on PM && NOTIFIER_ERROR_INJECTION | ||
1125 | default m if PM_DEBUG | ||
1126 | help | ||
1127 | This option provides the ability to inject artifical errors to | ||
1128 | PM notifier chain callbacks. It is controlled through debugfs | ||
1129 | interface /sys/kernel/debug/notifier-error-inject/pm | ||
1130 | |||
1131 | If the notifier call chain should be failed with some events | ||
1132 | notified, write the error code to "actions/<notifier event>/error". | ||
1133 | |||
1134 | Example: Inject PM suspend error (-12 = -ENOMEM) | ||
1135 | |||
1136 | # cd /sys/kernel/debug/notifier-error-inject/pm/ | ||
1137 | # echo -12 > actions/PM_SUSPEND_PREPARE/error | ||
1138 | # echo mem > /sys/power/state | ||
1139 | bash: echo: write error: Cannot allocate memory | ||
1140 | |||
1141 | To compile this code as a module, choose M here: the module will | ||
1142 | be called pm-notifier-error-inject. | ||
1143 | |||
1144 | If unsure, say N. | ||
1145 | |||
1146 | config MEMORY_NOTIFIER_ERROR_INJECT | ||
1147 | tristate "Memory hotplug notifier error injection module" | ||
1148 | depends on MEMORY_HOTPLUG_SPARSE && NOTIFIER_ERROR_INJECTION | ||
1149 | help | ||
1150 | This option provides the ability to inject artifical errors to | ||
1151 | memory hotplug notifier chain callbacks. It is controlled through | ||
1152 | debugfs interface under /sys/kernel/debug/notifier-error-inject/memory | ||
1153 | |||
1154 | If the notifier call chain should be failed with some events | ||
1155 | notified, write the error code to "actions/<notifier event>/error". | ||
1156 | |||
1157 | Example: Inject memory hotplug offline error (-12 == -ENOMEM) | ||
1158 | |||
1159 | # cd /sys/kernel/debug/notifier-error-inject/memory | ||
1160 | # echo -12 > actions/MEM_GOING_OFFLINE/error | ||
1161 | # echo offline > /sys/devices/system/memory/memoryXXX/state | ||
1162 | bash: echo: write error: Cannot allocate memory | ||
1163 | |||
1164 | To compile this code as a module, choose M here: the module will | ||
1165 | be called pSeries-reconfig-notifier-error-inject. | ||
1166 | |||
1167 | If unsure, say N. | ||
1168 | |||
1169 | config PSERIES_RECONFIG_NOTIFIER_ERROR_INJECT | ||
1170 | tristate "pSeries reconfig notifier error injection module" | ||
1171 | depends on PPC_PSERIES && NOTIFIER_ERROR_INJECTION | ||
1172 | help | ||
1173 | This option provides the ability to inject artifical errors to | ||
1174 | pSeries reconfig notifier chain callbacks. It is controlled | ||
1175 | through debugfs interface under | ||
1176 | /sys/kernel/debug/notifier-error-inject/pSeries-reconfig/ | ||
1177 | |||
1178 | If the notifier call chain should be failed with some events | ||
1179 | notified, write the error code to "actions/<notifier event>/error". | ||
1180 | |||
1181 | To compile this code as a module, choose M here: the module will | ||
1182 | be called memory-notifier-error-inject. | ||
1183 | |||
1184 | If unsure, say N. | ||
1185 | |||
1099 | config FAULT_INJECTION | 1186 | config FAULT_INJECTION |
1100 | bool "Fault-injection framework" | 1187 | bool "Fault-injection framework" |
1101 | depends on DEBUG_KERNEL | 1188 | depends on DEBUG_KERNEL |