aboutsummaryrefslogtreecommitdiffstats
path: root/kernel/trace/Kconfig
diff options
context:
space:
mode:
authorSteven Rostedt (Red Hat) <rostedt@goodmis.org>2013-03-15 11:32:53 -0400
committerSteven Rostedt <rostedt@goodmis.org>2013-03-15 13:21:16 -0400
commit6c43e554a2a5c1f2caf1733d46719bc58de3e37b (patch)
tree032b7ade3b4c0c24e9e89c9bf6fd3f37947c58cf /kernel/trace/Kconfig
parent8d016091d10953e00f9d2c0125cc0ddd46c23a6a (diff)
ring-buffer: Add ring buffer startup selftest
When testing my large changes to the ftrace system, there was a bug that looked like the ring buffer was dropping events. I wrote up a quick integrity checker of the ring buffer to see if it was. Although the bug ended up being something stupid I did in ftrace, and had nothing to do with the ring buffer, I figured if I spent the time to write up this test, I might as well include it in the kernel. I cleaned it up a bit, as the original version was rather ugly. Not saying this version is pretty, but it's a beauty queen compared to what I original wrote. To enable the start up test, set CONFIG_RING_BUFFER_STARTUP_TEST. Note, it runs for 10 seconds, so it will slow your boot time by at least 10 more seconds. What it does is documented in both the comments and the Kconfig help. Signed-off-by: Steven Rostedt <rostedt@goodmis.org>
Diffstat (limited to 'kernel/trace/Kconfig')
-rw-r--r--kernel/trace/Kconfig23
1 files changed, 23 insertions, 0 deletions
diff --git a/kernel/trace/Kconfig b/kernel/trace/Kconfig
index f78eab251897..0b5ecf5517fa 100644
--- a/kernel/trace/Kconfig
+++ b/kernel/trace/Kconfig
@@ -565,6 +565,29 @@ config RING_BUFFER_BENCHMARK
565 565
566 If unsure, say N. 566 If unsure, say N.
567 567
568config RING_BUFFER_STARTUP_TEST
569 bool "Ring buffer startup self test"
570 depends on RING_BUFFER
571 help
572 Run a simple self test on the ring buffer on boot up. Late in the
573 kernel boot sequence, the test will start that kicks off
574 a thread per cpu. Each thread will write various size events
575 into the ring buffer. Another thread is created to send IPIs
576 to each of the threads, where the IPI handler will also write
577 to the ring buffer, to test/stress the nesting ability.
578 If any anomalies are discovered, a warning will be displayed
579 and all ring buffers will be disabled.
580
581 The test runs for 10 seconds. This will slow your boot time
582 by at least 10 more seconds.
583
584 At the end of the test, statics and more checks are done.
585 It will output the stats of each per cpu buffer. What
586 was written, the sizes, what was read, what was lost, and
587 other similar details.
588
589 If unsure, say N
590
568endif # FTRACE 591endif # FTRACE
569 592
570endif # TRACING_SUPPORT 593endif # TRACING_SUPPORT