31 Jul, 2012
1 commit
-
Rewrite existing cpu-notifier-error-inject module to use debugfs based new
framework.This change removes cpu_up_prepare_error and cpu_down_prepare_error module
parameters which were used to specify error code to be injected. We could
keep these module parameters for backward compatibility by module_param_cb
but it seems overkill for this module.This provides the ability to inject artifical errors to CPU notifier chain
callbacks. It is controlled through debugfs interface under
/sys/kernel/debug/notifier-error-inject/cpuIf the notifier call chain should be failed with some events notified,
write the error code to "actions//error".Example1: inject CPU offline error (-1 == -EPERM)
# cd /sys/kernel/debug/notifier-error-inject/cpu
# echo -1 > actions/CPU_DOWN_PREPARE/error
# echo 0 > /sys/devices/system/cpu/cpu1/online
bash: echo: write error: Operation not permittedExample2: inject CPU online error (-2 == -ENOENT)
# cd /sys/kernel/debug/notifier-error-inject/cpu
# echo -2 > actions/CPU_UP_PREPARE/error
# echo 1 > /sys/devices/system/cpu/cpu1/online
bash: echo: write error: No such file or directorySigned-off-by: Akinobu Mita
Cc: Pavel Machek
Cc: "Rafael J. Wysocki"
Cc: Greg KH
Cc: Benjamin Herrenschmidt
Cc: Paul Mackerras
Cc: Michael Ellerman
Cc: Dave Jones
Signed-off-by: Andrew Morton
Signed-off-by: Linus Torvalds
28 May, 2010
1 commit
-
I used this module to test the series of modification to the cpu notifiers
code.Example1: inject CPU offline error (-1 == -EPERM)
# modprobe cpu-notifier-error-inject cpu_down_prepare_error=-1
# echo 0 > /sys/devices/system/cpu/cpu1/online
bash: echo: write error: Operation not permittedExample2: inject CPU online error (-2 == -ENOENT)
# modprobe cpu-notifier-error-inject cpu_up_prepare_error=-2
# echo 1 > /sys/devices/system/cpu/cpu1/online
bash: echo: write error: No such file or directory[akpm@linux-foundation.org: fix Kconfig help text]
Signed-off-by: Akinobu Mita
Signed-off-by: Andrew Morton
Signed-off-by: Linus Torvalds