kernel_optimize_test/kernel/trace
Steven Rostedt 4a0b1665db tracing: Fix irqoff selftest expanding max buffer
If the kernel command line declares a tracer "ftrace=sometracer" and
that tracer is either not defined or is enabled after irqsoff,
then the irqs off selftest will fail with the following error:

Testing tracer irqsoff:
------------[ cut here ]------------
WARNING: at /home/rostedt/work/autotest/nobackup/linux-test.git/kernel/trace/tra
ce.c:713 update_max_tr_single+0xfa/0x11b()
Hardware name:
Modules linked in:
Pid: 1, comm: swapper Not tainted 2.6.38-rc8-test #1
Call Trace:
 [<c0441d9d>] ? warn_slowpath_common+0x65/0x7a
 [<c049adb2>] ? update_max_tr_single+0xfa/0x11b
 [<c0441dc1>] ? warn_slowpath_null+0xf/0x13
 [<c049adb2>] ? update_max_tr_single+0xfa/0x11b
 [<c049e454>] ? stop_critical_timing+0x154/0x204
 [<c049b54b>] ? trace_selftest_startup_irqsoff+0x5b/0xc1
 [<c049b54b>] ? trace_selftest_startup_irqsoff+0x5b/0xc1
 [<c049b54b>] ? trace_selftest_startup_irqsoff+0x5b/0xc1
 [<c049e529>] ? time_hardirqs_on+0x25/0x28
 [<c0468bca>] ? trace_hardirqs_on_caller+0x18/0x12f
 [<c0468cec>] ? trace_hardirqs_on+0xb/0xd
 [<c049b54b>] ? trace_selftest_startup_irqsoff+0x5b/0xc1
 [<c049b6b8>] ? register_tracer+0xf8/0x1a3
 [<c14e93fe>] ? init_irqsoff_tracer+0xd/0x11
 [<c040115e>] ? do_one_initcall+0x71/0x121
 [<c14e93f1>] ? init_irqsoff_tracer+0x0/0x11
 [<c14ce3a9>] ? kernel_init+0x13a/0x1b6
 [<c14ce26f>] ? kernel_init+0x0/0x1b6
 [<c0403842>] ? kernel_thread_helper+0x6/0x10
---[ end trace e93713a9d40cd06c ]---
.. no entries found ..FAILED!

What happens is the "ftrace=..." will expand the ring buffer to its
default size (from its minimum size) but it will not expand the
max ring buffer (the ring buffer to store maximum latencies).
When the irqsoff test runs, it will call the ring buffer swap routine
that checks if the max ring buffer is the same size as the normal
ring buffer, and will fail if it is not. This causes the test to fail.

The solution is to expand the max ring buffer before running the self
test if the max ring buffer is used by that tracer and the normal ring
buffer is expanded. The max ring buffer should be shrunk again after
the test is done to save space.

Signed-off-by: Steven Rostedt <rostedt@goodmis.org>
2011-03-10 10:34:58 -05:00
..
blktrace.c blktrace: Remove blk_fill_rwbs_rq. 2011-03-03 10:53:20 -05:00
ftrace.c
Kconfig
Makefile
power-traces.c
ring_buffer_benchmark.c
ring_buffer.c tracing: Explain about unstable clock on resume with ring buffer warning 2011-03-10 10:34:47 -05:00
trace_branch.c
trace_clock.c
trace_entries.h tracing: Fix event alignment: ftrace:context_switch and ftrace:wakeup 2011-03-10 10:34:16 -05:00
trace_event_perf.c
trace_events_filter.c
trace_events.c tracing: Export trace_set_clr_event() 2011-03-10 10:34:51 -05:00
trace_export.c
trace_functions_graph.c
trace_functions.c
trace_irqsoff.c
trace_kdb.c
trace_kprobe.c tracing/kprobe: Fix NULL pointer deref check 2011-02-14 12:09:53 +01:00
trace_mmiotrace.c
trace_nop.c
trace_output.c tracing: Adjust conditional expression latency formatting. 2011-03-10 10:34:35 -05:00
trace_output.h
trace_printk.c
trace_sched_switch.c
trace_sched_wakeup.c
trace_selftest_dynamic.c
trace_selftest.c
trace_stack.c
trace_stat.c
trace_stat.h
trace_syscalls.c
trace_workqueue.c
trace.c tracing: Fix irqoff selftest expanding max buffer 2011-03-10 10:34:58 -05:00
trace.h tracing: Align 4 byte ints together in struct tracer 2011-03-10 10:34:54 -05:00