summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorJason Wessel <jason.wessel@windriver.com>2008-03-08 01:34:17 +0300
committerIngo Molnar <mingo@elte.hu>2008-04-17 22:05:42 +0400
commite8d31c204e36e019b9134f2a11926cac0fcf9b19 (patch)
tree2720c1deadb6e57981254ec4120624b8a24dfdcf /lib
parent737a460f21febe551ff1d2299b63bae9b154078f (diff)
downloadlinux-e8d31c204e36e019b9134f2a11926cac0fcf9b19.tar.xz
kgdb: add kgdb internal test suite
This patch adds regression tests for testing the kgdb core and arch specific implementation. The kgdb test suite is designed to be built into the kernel and not as a module because it uses a number of low level kernel and kgdb primitives which should not be exported externally. The kgdb test suite is designed as a KGDB I/O module which simulates the communications that a debugger would have with kgdb. The tests are broken up in to a line by line and referenced here as a "get" which is kgdb requesting input and "put" which is kgdb sending a response. The kgdb suite can be invoked from the kernel command line arguments system or executed dynamically at run time. The test suite uses the variable "kgdbts" to obtain the information about which tests to run and to configure the verbosity level. The following are the various characters you can use with the kgdbts= line: When using the "kgdbts=" you only choose one of the following core test types: A = Run all the core tests silently V1 = Run all the core tests with minimal output V2 = Run all the core tests in debug mode You can also specify optional tests: N## = Go to sleep with interrupts of for ## seconds to test the HW NMI watchdog F## = Break at do_fork for ## iterations S## = Break at sys_open for ## iterations NOTE: that the do_fork and sys_open tests are mutually exclusive. To invoke the kgdb test suite from boot you use a kernel start argument as follows: kgdbts=V1 kgdbwait Or if you wanted to perform the NMI test for 6 seconds and do_fork test for 100 forks, you could use: kgdbts=V1N6F100 kgdbwait The test suite can also be invoked at run time with: echo kgdbts=V1N6F100 > /sys/module/kgdbts/parameters/kgdbts Or as another example: echo kgdbts=V2 > /sys/module/kgdbts/parameters/kgdbts When developing a new kgdb arch specific implementation or using these tests for the purpose of regression testing, several invocations are required. 1) Boot with the test suite enabled by using the kernel arguments "kgdbts=V1F100 kgdbwait" ## If kgdb arch specific implementation has NMI use "kgdbts=V1N6F100 2) After the system boot run the basic test. echo kgdbts=V1 > /sys/module/kgdbts/parameters/kgdbts 3) Run the concurrency tests. It is best to use n+1 while loops where n is the number of cpus you have in your system. The example below uses only two loops. ## This tests break points on sys_open while [ 1 ] ; do find / > /dev/null 2>&1 ; done & while [ 1 ] ; do find / > /dev/null 2>&1 ; done & echo kgdbts=V1S10000 > /sys/module/kgdbts/parameters/kgdbts fg # and hit control-c fg # and hit control-c ## This tests break points on do_fork while [ 1 ] ; do date > /dev/null ; done & while [ 1 ] ; do date > /dev/null ; done & echo kgdbts=V1F1000 > /sys/module/kgdbts/parameters/kgdbts fg # and hit control-c Signed-off-by: Jason Wessel <jason.wessel@windriver.com> Signed-off-by: Ingo Molnar <mingo@elte.hu>
Diffstat (limited to 'lib')
-rw-r--r--lib/Kconfig.kgdb13
1 files changed, 13 insertions, 0 deletions
diff --git a/lib/Kconfig.kgdb b/lib/Kconfig.kgdb
index 9631ba3baaf3..aaabcddcda5a 100644
--- a/lib/Kconfig.kgdb
+++ b/lib/Kconfig.kgdb
@@ -25,3 +25,16 @@ config KGDB_SERIAL_CONSOLE
help
Share a serial console with kgdb. Sysrq-g must be used
to break in initially.
+
+config KGDB_TESTS
+ bool "KGDB: internal test suite"
+ depends on KGDB
+ default n
+ help
+ This is a kgdb I/O module specifically designed to test
+ kgdb's internal functions. This kgdb I/O module is
+ intended to for the development of new kgdb stubs
+ as well as regression testing the kgdb internals.
+ See the drivers/misc/kgdbts.c for the details about
+ the tests. The most basic of this I/O module is to boot
+ a kernel boot arguments "kgdbwait kgdbts=V1F100"