diff options
author | Stephen Rothwell <sfr@canb.auug.org.au> | 2008-07-03 13:20:07 +1000 |
---|---|---|
committer | Stephen Rothwell <sfr@canb.auug.org.au> | 2008-07-03 13:20:07 +1000 |
commit | e6d8a013ff2b9f1eedaa0adc7c409d889f1f8c21 (patch) | |
tree | cd2e065bfe01997d19f264f00938047b90c35410 | |
parent | ac850909ac16d232ab2ddcf621c5a82e766d6152 (diff) | |
parent | b0fdd54e6416cf1d14676549de44288fba208e12 (diff) |
Merge commit 'tests/master'
Conflicts:
lib/Kconfig.debug
-rw-r--r-- | Makefile | 1 | ||||
-rw-r--r-- | drivers/misc/Makefile | 1 | ||||
-rw-r--r-- | kernel/Makefile | 4 | ||||
-rw-r--r-- | lib/Kconfig.debug | 93 | ||||
-rw-r--r-- | lib/Makefile | 1 | ||||
-rw-r--r-- | tests/Kconfig | 101 | ||||
-rw-r--r-- | tests/Makefile | 10 | ||||
-rw-r--r-- | tests/backtracetest.c (renamed from kernel/backtracetest.c) | 0 | ||||
-rw-r--r-- | tests/lkdtm.c (renamed from drivers/misc/lkdtm.c) | 0 | ||||
-rw-r--r-- | tests/locking-selftest-hardirq.h (renamed from lib/locking-selftest-hardirq.h) | 0 | ||||
-rw-r--r-- | tests/locking-selftest-mutex.h (renamed from lib/locking-selftest-mutex.h) | 0 | ||||
-rw-r--r-- | tests/locking-selftest-rlock-hardirq.h (renamed from lib/locking-selftest-rlock-hardirq.h) | 0 | ||||
-rw-r--r-- | tests/locking-selftest-rlock-softirq.h (renamed from lib/locking-selftest-rlock-softirq.h) | 0 | ||||
-rw-r--r-- | tests/locking-selftest-rlock.h (renamed from lib/locking-selftest-rlock.h) | 0 | ||||
-rw-r--r-- | tests/locking-selftest-rsem.h (renamed from lib/locking-selftest-rsem.h) | 0 | ||||
-rw-r--r-- | tests/locking-selftest-softirq.h (renamed from lib/locking-selftest-softirq.h) | 0 | ||||
-rw-r--r-- | tests/locking-selftest-spin-hardirq.h (renamed from lib/locking-selftest-spin-hardirq.h) | 0 | ||||
-rw-r--r-- | tests/locking-selftest-spin-softirq.h (renamed from lib/locking-selftest-spin-softirq.h) | 0 | ||||
-rw-r--r-- | tests/locking-selftest-spin.h (renamed from lib/locking-selftest-spin.h) | 0 | ||||
-rw-r--r-- | tests/locking-selftest-wlock-hardirq.h (renamed from lib/locking-selftest-wlock-hardirq.h) | 0 | ||||
-rw-r--r-- | tests/locking-selftest-wlock-softirq.h (renamed from lib/locking-selftest-wlock-softirq.h) | 0 | ||||
-rw-r--r-- | tests/locking-selftest-wlock.h (renamed from lib/locking-selftest-wlock.h) | 0 | ||||
-rw-r--r-- | tests/locking-selftest-wsem.h (renamed from lib/locking-selftest-wsem.h) | 0 | ||||
-rw-r--r-- | tests/locking-selftest.c (renamed from lib/locking-selftest.c) | 0 | ||||
-rw-r--r-- | tests/rcutorture.c (renamed from kernel/rcutorture.c) | 0 | ||||
-rw-r--r-- | tests/rtmutex-tester.c (renamed from kernel/rtmutex-tester.c) | 2 | ||||
-rw-r--r-- | tests/test_kprobes.c (renamed from kernel/test_kprobes.c) | 0 |
27 files changed, 115 insertions, 98 deletions
@@ -616,6 +616,7 @@ export mod_strip_cmd ifeq ($(KBUILD_EXTMOD),) core-y += kernel/ mm/ fs/ ipc/ security/ crypto/ block/ +core-$(CONFIG_KERNEL_TESTS) += tests/ vmlinux-dirs := $(patsubst %/,%,$(filter %/, $(init-y) $(init-m) \ $(core-y) $(core-m) $(drivers-y) $(drivers-m) \ diff --git a/drivers/misc/Makefile b/drivers/misc/Makefile index a6dac6a2e7e5..c818320d1dc7 100644 --- a/drivers/misc/Makefile +++ b/drivers/misc/Makefile @@ -14,7 +14,6 @@ obj-$(CONFIG_ATMEL_PWM) += atmel_pwm.o obj-$(CONFIG_ATMEL_SSC) += atmel-ssc.o obj-$(CONFIG_ATMEL_TCLIB) += atmel_tclib.o obj-$(CONFIG_TC1100_WMI) += tc1100-wmi.o -obj-$(CONFIG_LKDTM) += lkdtm.o obj-$(CONFIG_TIFM_CORE) += tifm_core.o obj-$(CONFIG_TIFM_7XX1) += tifm_7xx1.o obj-$(CONFIG_PHANTOM) += phantom.o diff --git a/kernel/Makefile b/kernel/Makefile index e66a541d8cf8..ed052b804525 100644 --- a/kernel/Makefile +++ b/kernel/Makefile @@ -37,7 +37,6 @@ obj-$(CONFIG_FUTEX) += futex_compat.o endif obj-$(CONFIG_RT_MUTEXES) += rtmutex.o obj-$(CONFIG_DEBUG_RT_MUTEXES) += rtmutex-debug.o -obj-$(CONFIG_RT_MUTEX_TESTER) += rtmutex-tester.o obj-$(CONFIG_GENERIC_ISA_DMA) += dma.o obj-$(CONFIG_SMP) += spinlock.o obj-$(CONFIG_DEBUG_SPINLOCK) += spinlock.o @@ -48,7 +47,6 @@ obj-$(CONFIG_KALLSYMS) += kallsyms.o obj-$(CONFIG_PM) += power/ obj-$(CONFIG_BSD_PROCESS_ACCT) += acct.o obj-$(CONFIG_KEXEC) += kexec.o -obj-$(CONFIG_BACKTRACE_SELF_TEST) += backtracetest.o obj-$(CONFIG_COMPAT) += compat.o obj-$(CONFIG_CGROUPS) += cgroup.o obj-$(CONFIG_CGROUP_DEBUG) += cgroup_debug.o @@ -60,7 +58,6 @@ obj-$(CONFIG_PID_NS) += pid_namespace.o obj-$(CONFIG_IKCONFIG) += configs.o obj-$(CONFIG_RESOURCE_COUNTERS) += res_counter.o obj-$(CONFIG_STOP_MACHINE) += stop_machine.o -obj-$(CONFIG_KPROBES_SANITY_TEST) += test_kprobes.o obj-$(CONFIG_AUDIT) += audit.o auditfilter.o obj-$(CONFIG_AUDITSYSCALL) += auditsc.o obj-$(CONFIG_AUDIT_TREE) += audit_tree.o @@ -69,7 +66,6 @@ obj-$(CONFIG_KGDB) += kgdb.o obj-$(CONFIG_DETECT_SOFTLOCKUP) += softlockup.o obj-$(CONFIG_GENERIC_HARDIRQS) += irq/ obj-$(CONFIG_SECCOMP) += seccomp.o -obj-$(CONFIG_RCU_TORTURE_TEST) += rcutorture.o obj-$(CONFIG_CLASSIC_RCU) += rcuclassic.o obj-$(CONFIG_PREEMPT_RCU) += rcupreempt.o ifeq ($(CONFIG_PREEMPT_RCU),y) diff --git a/lib/Kconfig.debug b/lib/Kconfig.debug index 882c51048993..0ff4cf7e98f1 100644 --- a/lib/Kconfig.debug +++ b/lib/Kconfig.debug @@ -312,12 +312,6 @@ config DEBUG_PI_LIST default y depends on DEBUG_RT_MUTEXES -config RT_MUTEX_TESTER - bool "Built-in scriptable tester for rt-mutexes" - depends on DEBUG_KERNEL && RT_MUTEXES - help - This option enables a rt-mutex tester. - config DEBUG_SPINLOCK bool "Spinlock and rw-lock debugging: basic checks" depends on DEBUG_KERNEL @@ -433,17 +427,6 @@ config DEBUG_SPINLOCK_SLEEP If you say Y here, various routines which may sleep will become very noisy if they are called with a spinlock held. -config DEBUG_LOCKING_API_SELFTESTS - bool "Locking API boot-time self-tests" - depends on DEBUG_KERNEL - help - Say Y here if you want the kernel to run a short self-test during - bootup. The self-test checks whether common types of locking bugs - are detected by debugging mechanisms or not. (if you disable - lock debugging then those bugs wont be detected of course.) - The following locking APIs are covered: spinlocks, rwlocks, - mutexes and rwsems. - config STACKTRACE bool depends on STACKTRACE_SUPPORT @@ -554,80 +537,6 @@ config BOOT_PRINTK_DELAY BOOT_PRINTK_DELAY also may cause DETECT_SOFTLOCKUP to detect what it believes to be lockup conditions. -config RCU_TORTURE_TEST - tristate "torture tests for RCU" - depends on DEBUG_KERNEL - default n - help - This option provides a kernel module that runs torture tests - on the RCU infrastructure. The kernel module may be built - after the fact on the running kernel to be tested, if desired. - - Say Y here if you want RCU torture tests to be built into - the kernel. - Say M if you want the RCU torture tests to build as a module. - Say N if you are unsure. - -config RCU_TORTURE_TEST_RUNNABLE - bool "torture tests for RCU runnable by default" - depends on RCU_TORTURE_TEST = y - default n - help - This option provides a way to build the RCU torture tests - directly into the kernel without them starting up at boot - time. You can use /proc/sys/kernel/rcutorture_runnable - to manually override this setting. This /proc file is - available only when the RCU torture tests have been built - into the kernel. - - Say Y here if you want the RCU torture tests to start during - boot (you probably don't). - Say N here if you want the RCU torture tests to start only - after being manually enabled via /proc. - -config KPROBES_SANITY_TEST - bool "Kprobes sanity tests" - depends on DEBUG_KERNEL - depends on KPROBES - default n - help - This option provides for testing basic kprobes functionality on - boot. A sample kprobe, jprobe and kretprobe are inserted and - verified for functionality. - - Say N if you are unsure. - -config BACKTRACE_SELF_TEST - tristate "Self test for the backtrace code" - depends on DEBUG_KERNEL - default n - help - This option provides a kernel module that can be used to test - the kernel stack backtrace code. This option is not useful - for distributions or general kernels, but only for kernel - developers working on architecture code. - - Note that if you want to also test saved backtraces, you will - have to enable STACKTRACE as well. - - Say N if you are unsure. - -config LKDTM - tristate "Linux Kernel Dump Test Tool Module" - depends on DEBUG_KERNEL - depends on KPROBES - depends on BLOCK - default n - help - This module enables testing of the different dumping mechanisms by - inducing system failures at predefined crash points. - If you don't need it: say N - Choose M here to compile this code as a module. The module will be - called lkdtm. - - Documentation on how to use the module can be found in - drivers/misc/lkdtm.c - config FAULT_INJECTION bool "Fault-injection framework" depends on DEBUG_KERNEL @@ -726,3 +635,5 @@ config FIREWIRE_OHCI_REMOTE_DMA source "samples/Kconfig" source "lib/Kconfig.kgdb" + +source "tests/Kconfig" diff --git a/lib/Makefile b/lib/Makefile index 2c62a9c06fbe..fc206c15420f 100644 --- a/lib/Makefile +++ b/lib/Makefile @@ -34,7 +34,6 @@ lib-$(CONFIG_HOTPLUG) += kobject_uevent.o obj-$(CONFIG_GENERIC_IOMAP) += iomap.o obj-$(CONFIG_HAS_IOMEM) += iomap_copy.o devres.o obj-$(CONFIG_CHECK_SIGNATURE) += check_signature.o -obj-$(CONFIG_DEBUG_LOCKING_API_SELFTESTS) += locking-selftest.o obj-$(CONFIG_DEBUG_SPINLOCK) += spinlock_debug.o lib-$(CONFIG_RWSEM_GENERIC_SPINLOCK) += rwsem-spinlock.o lib-$(CONFIG_RWSEM_XCHGADD_ALGORITHM) += rwsem.o diff --git a/tests/Kconfig b/tests/Kconfig new file mode 100644 index 000000000000..2432161f0694 --- /dev/null +++ b/tests/Kconfig @@ -0,0 +1,101 @@ +# tests/Kconfig + +menuconfig KERNEL_TESTS + bool "Kernel subsystem tests" + help + You can build kernel subsystem specific tests. + +if KERNEL_TESTS + +config DEBUG_LOCKING_API_SELFTESTS + bool "Locking API boot-time self-tests" + depends on DEBUG_KERNEL + help + Say Y here if you want the kernel to run a short self-test during + bootup. The self-test checks whether common types of locking bugs + are detected by debugging mechanisms or not. (if you disable + lock debugging then those bugs wont be detected of course.) + The following locking APIs are covered: spinlocks, rwlocks, + mutexes and rwsems. + +config RCU_TORTURE_TEST + tristate "torture tests for RCU" + depends on DEBUG_KERNEL + default n + help + This option provides a kernel module that runs torture tests + on the RCU infrastructure. The kernel module may be built + after the fact on the running kernel to be tested, if desired. + + Say Y here if you want RCU torture tests to be built into + the kernel. + Say M if you want the RCU torture tests to build as a module. + Say N if you are unsure. + +config RCU_TORTURE_TEST_RUNNABLE + bool "torture tests for RCU runnable by default" + depends on RCU_TORTURE_TEST = y + default n + help + This option provides a way to build the RCU torture tests + directly into the kernel without them starting up at boot + time. You can use /proc/sys/kernel/rcutorture_runnable + to manually override this setting. This /proc file is + available only when the RCU torture tests have been built + into the kernel. + + Say Y here if you want the RCU torture tests to start during + boot (you probably don't). + Say N here if you want the RCU torture tests to start only + after being manually enabled via /proc. + +config RT_MUTEX_TESTER + bool "Built-in scriptable tester for rt-mutexes" + depends on DEBUG_KERNEL && RT_MUTEXES + help + This option enables a rt-mutex tester. + +config LKDTM + tristate "Linux Kernel Dump Test Tool Module" + depends on DEBUG_KERNEL + depends on KPROBES + depends on BLOCK + default n + help + This module enables testing of the different dumping mechanisms by + inducing system failures at predefined crash points. + If you don't need it: say N + Choose M here to compile this code as a module. The module will be + called lkdtm. + + Documentation on how to use the module can be found in + drivers/misc/lkdtm.c + +config KPROBES_SANITY_TEST + bool "Kprobes sanity tests" + depends on DEBUG_KERNEL + depends on KPROBES + default n + help + This option provides for testing basic kprobes functionality on + boot. A sample kprobe, jprobe and kretprobe are inserted and + verified for functionality. + + Say N if you are unsure. + +config BACKTRACE_SELF_TEST + tristate "Self test for the backtrace code" + depends on DEBUG_KERNEL + default n + help + This option provides a kernel module that can be used to test + the kernel stack backtrace code. This option is not useful + for distributions or general kernels, but only for kernel + developers working on architecture code. + + Note that if you want to also test saved backtraces, you will + have to enable STACKTRACE as well. + + Say N if you are unsure. + +endif # KERNEL_TESTS diff --git a/tests/Makefile b/tests/Makefile new file mode 100644 index 000000000000..1d56a9ea5993 --- /dev/null +++ b/tests/Makefile @@ -0,0 +1,10 @@ +# +# Makefile for kernel subsystem specific tests +# + +obj-$(CONFIG_DEBUG_LOCKING_API_SELFTESTS) += locking-selftest.o +obj-$(CONFIG_RCU_TORTURE_TEST) += rcutorture.o +obj-$(CONFIG_RT_MUTEX_TESTER) += rtmutex-tester.o +obj-$(CONFIG_LKDTM) += lkdtm.o +obj-$(CONFIG_KPROBES_SANITY_TEST) += test_kprobes.o +obj-$(CONFIG_BACKTRACE_SELF_TEST) += backtracetest.o diff --git a/kernel/backtracetest.c b/tests/backtracetest.c index a5e026bc45c4..a5e026bc45c4 100644 --- a/kernel/backtracetest.c +++ b/tests/backtracetest.c diff --git a/drivers/misc/lkdtm.c b/tests/lkdtm.c index 1bfe5d16963b..1bfe5d16963b 100644 --- a/drivers/misc/lkdtm.c +++ b/tests/lkdtm.c diff --git a/lib/locking-selftest-hardirq.h b/tests/locking-selftest-hardirq.h index 10d4a150b259..10d4a150b259 100644 --- a/lib/locking-selftest-hardirq.h +++ b/tests/locking-selftest-hardirq.h diff --git a/lib/locking-selftest-mutex.h b/tests/locking-selftest-mutex.h index 68601b6f584b..68601b6f584b 100644 --- a/lib/locking-selftest-mutex.h +++ b/tests/locking-selftest-mutex.h diff --git a/lib/locking-selftest-rlock-hardirq.h b/tests/locking-selftest-rlock-hardirq.h index 9f517ebcb786..9f517ebcb786 100644 --- a/lib/locking-selftest-rlock-hardirq.h +++ b/tests/locking-selftest-rlock-hardirq.h diff --git a/lib/locking-selftest-rlock-softirq.h b/tests/locking-selftest-rlock-softirq.h index 981455db7ff0..981455db7ff0 100644 --- a/lib/locking-selftest-rlock-softirq.h +++ b/tests/locking-selftest-rlock-softirq.h diff --git a/lib/locking-selftest-rlock.h b/tests/locking-selftest-rlock.h index 6789044f4d0e..6789044f4d0e 100644 --- a/lib/locking-selftest-rlock.h +++ b/tests/locking-selftest-rlock.h diff --git a/lib/locking-selftest-rsem.h b/tests/locking-selftest-rsem.h index 62da886680c7..62da886680c7 100644 --- a/lib/locking-selftest-rsem.h +++ b/tests/locking-selftest-rsem.h diff --git a/lib/locking-selftest-softirq.h b/tests/locking-selftest-softirq.h index a83de2a04ace..a83de2a04ace 100644 --- a/lib/locking-selftest-softirq.h +++ b/tests/locking-selftest-softirq.h diff --git a/lib/locking-selftest-spin-hardirq.h b/tests/locking-selftest-spin-hardirq.h index 693198dce30a..693198dce30a 100644 --- a/lib/locking-selftest-spin-hardirq.h +++ b/tests/locking-selftest-spin-hardirq.h diff --git a/lib/locking-selftest-spin-softirq.h b/tests/locking-selftest-spin-softirq.h index c472e2a87ffc..c472e2a87ffc 100644 --- a/lib/locking-selftest-spin-softirq.h +++ b/tests/locking-selftest-spin-softirq.h diff --git a/lib/locking-selftest-spin.h b/tests/locking-selftest-spin.h index ccd1b4b09757..ccd1b4b09757 100644 --- a/lib/locking-selftest-spin.h +++ b/tests/locking-selftest-spin.h diff --git a/lib/locking-selftest-wlock-hardirq.h b/tests/locking-selftest-wlock-hardirq.h index 2dd2e5122caa..2dd2e5122caa 100644 --- a/lib/locking-selftest-wlock-hardirq.h +++ b/tests/locking-selftest-wlock-hardirq.h diff --git a/lib/locking-selftest-wlock-softirq.h b/tests/locking-selftest-wlock-softirq.h index cb80d1cb944e..cb80d1cb944e 100644 --- a/lib/locking-selftest-wlock-softirq.h +++ b/tests/locking-selftest-wlock-softirq.h diff --git a/lib/locking-selftest-wlock.h b/tests/locking-selftest-wlock.h index 0815322d99ed..0815322d99ed 100644 --- a/lib/locking-selftest-wlock.h +++ b/tests/locking-selftest-wlock.h diff --git a/lib/locking-selftest-wsem.h b/tests/locking-selftest-wsem.h index b88c5f2dc5f0..b88c5f2dc5f0 100644 --- a/lib/locking-selftest-wsem.h +++ b/tests/locking-selftest-wsem.h diff --git a/lib/locking-selftest.c b/tests/locking-selftest.c index 280332c1827c..280332c1827c 100644 --- a/lib/locking-selftest.c +++ b/tests/locking-selftest.c diff --git a/kernel/rcutorture.c b/tests/rcutorture.c index 90b5b123f7a1..90b5b123f7a1 100644 --- a/kernel/rcutorture.c +++ b/tests/rcutorture.c diff --git a/kernel/rtmutex-tester.c b/tests/rtmutex-tester.c index 092e4c620af9..f0200bd21217 100644 --- a/kernel/rtmutex-tester.c +++ b/tests/rtmutex-tester.c @@ -15,7 +15,7 @@ #include <linux/timer.h> #include <linux/freezer.h> -#include "rtmutex.h" +#include "../kernel/rtmutex.h" #define MAX_RT_TEST_THREADS 8 #define MAX_RT_TEST_MUTEXES 8 diff --git a/kernel/test_kprobes.c b/tests/test_kprobes.c index 06b6395b45b2..06b6395b45b2 100644 --- a/kernel/test_kprobes.c +++ b/tests/test_kprobes.c |