]> git.baikalelectronics.ru Git - kernel.git/commit
fault-injection: add CPU notifier error injection module
authorAkinobu Mita <akinobu.mita@gmail.com>
Wed, 26 May 2010 21:43:36 +0000 (14:43 -0700)
committerLinus Torvalds <torvalds@linux-foundation.org>
Thu, 27 May 2010 16:12:48 +0000 (09:12 -0700)
commit7c160f4ea55de086162249861b84d261a7bfd5b1
tree87e56764a538eb0fa94bd05e211e1ad89cf5f043
parent8e43a1e3544769dc513081a856be87a909f94628
fault-injection: add CPU notifier error injection module

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 permitted

Example2: 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 <akinobu.mita@gmail.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
lib/Kconfig.debug
lib/Makefile
lib/cpu-notifier-error-inject.c [new file with mode: 0644]