tracing: Fix and clean up some start up testst
Steven Rostedt
maintainerLinus,
Seems that Peter Zijlstra added a new check that is making old code screem nasty warnings:
WARNING: CPU: 0 PID: 91 at kernel/sched/core.c:7253 __might_sleep+0x9a/0x378() do not call blocking ops when !TASK_RUNNING; state=1 set at [<ffffffff8d79b511>] event_test_thread+0x48/0x93 Modules linked in: CPU: 0 PID: 91 Comm: test-events Not tainted 3.17.0-rc7-00109-g2f85d18 #37 Hardware name: QEMU Standard PC (i440FX + PIIX, 1996), BIOS 1.7.5-20140531_083030-gandalf 04/01/2014 0000000000000000 ffff880010ec3c80 ffffffff8c696943 ffff880010ec3cb8 ffffffff8be7cae5 ffffffff8bead236 0000000000000001 ffff88001161fa01 0000000000000001 0000000000000000 ffff880010ec3d20 ffffffff8be7cb46 Call Trace: [<ffffffff8c696943>] dump_stack+0x19/0x1b [<ffffffff8be7cae5>] warn_slowpath_common+0x8f/0xa8 [<ffffffff8bead236>] ? __might_sleep+0x9a/0x378 [<ffffffff8be7cb46>] warn_slowpath_fmt+0x48/0x50 [<ffffffff8be0dd55>] ? sched_clock+0x9/0xd [<ffffffff8d79b511>] ? event_test_thread+0x48/0x93 [<ffffffff8d79b511>] ? event_test_thread+0x48/0x93 [<ffffffff8bead236>] __might_sleep+0x9a/0x378 [<ffffffff8c6a0227>] down_read+0x26/0x98 [<ffffffff8be8f503>] exit_signals+0x27/0x1c2 [<ffffffff8be7fedd>] do_exit+0x193/0x10bd [<ffffffff8bfd1969>] ? kfree+0x4a0/0x4d7 [<ffffffff8d79b4c9>] ? event_trace_self_tests+0x6d7/0x6d7 [<ffffffff8d79b4c9>] ? event_trace_self_tests+0x6d7/0x6d7 [<ffffffff8bea4b65>] kthread+0x156/0x156 [<ffffffff8c69c0f8>] ? wait_for_common+0x3e/0x224 [<ffffffff8bea4a0f>] ? insert_kthread_work+0xe7/0xe7 [<ffffffff8c6a353a>] ret_from_fork+0x7a/0xb0 [<ffffffff8bea4a0f>] ? insert_kthread_work+0xe7/0xe7 ---[ end trace 14d02ef17adbc114 ]---
These are triggered by some self tests that run at start up when configure in. Although the code is technically correct, they are a little sloppy and not very robust. They work now because it runs at boot up and the tests do not call anything that might trigger a spurious wake up. But that doesn't mean those tests wont change in the future.
It's best to clean them now to make sure the tests used to test the internal workings of the system don't cause breakage themselves.
This also quiets the warnings made by the new checks.
Please pull the latest trace-3.18-2 tree, which can be found at:
git://git.kernel.org/pub/scm/linux/kernel/git/rostedt/linux-trace.git
trace-3.18-2
Tag SHA1: 2cef195ea7cf63359971f06ca094b63a84ecb70c Head SHA1: addff1feb02b03cb766b9a611c6b2cebf29bc285
Peter Zijlstra (1):
tracing: Robustify wait loop
Steven Rostedt (1):
tracing: Clean up scheduling in trace_wakeup_test_thread()
----
kernel/trace/trace_events.c | 5 ++++- kernel/trace/trace_selftest.c | 47 +++++++++++++++++++++++++++---------------- 2 files changed, 34 insertions(+), 18 deletions(-)
---------------------------
kernel/trace/trace_events.c +4 -1
@@ -2513,8 +2513,11 @@ static __init int event_test_thread(void *unused)kfree (test_malloc);set_current_state (TASK_INTERRUPTIBLE ); -while (!kthread_should_stop ()) +while (!kthread_should_stop ()) {schedule (); +set_current_state (TASK_INTERRUPTIBLE ); + } +__set_current_state (TASK_RUNNING );return 0 ; }
kernel/trace/trace_selftest.c +30 -17
105 lines not on this page · raw message