aboutsummaryrefslogtreecommitdiffstats
path: root/kernel/trace/trace_selftest.c
diff options
context:
space:
mode:
authorFrederic Weisbecker <fweisbec@gmail.com>2009-03-15 19:32:41 -0400
committerIngo Molnar <mingo@elte.hu>2009-03-16 04:13:18 -0400
commitac1d52d0b85854958c7e78c8006e39aadb6ce4b8 (patch)
treefc50818980e376a66d44f991b94e8a52c03e68fc /kernel/trace/trace_selftest.c
parent59f586db98919d7d9c43527b26c8de1cdf9ed912 (diff)
tracing/ftrace: fix double calls to tracing_start()
Impact: fix a warning during preemptirqsoff selftests When the preemptirqsoff selftest fails, we see the following warning: [ 6.050000] Testing tracer preemptirqsoff: .. no entries found .. ------------[ cut here ]------------ [ 6.060000] WARNING: at kernel/trace/trace.c:688 tracing_start+0x67/0xd3() [ 6.060000] Modules linked in: [ 6.060000] Pid: 1, comm: swapper Tainted: G [ 6.060000] Call Trace: [ 6.060000] [<ffffffff802460ff>] warn_slowpath+0xb1/0x100 [ 6.060000] [<ffffffff802a8f5b>] ? trace_preempt_on+0x35/0x4b [ 6.060000] [<ffffffff802a37fb>] ? tracing_start+0x31/0xd3 [ 6.060000] [<ffffffff802a37fb>] ? tracing_start+0x31/0xd3 [ 6.060000] [<ffffffff80271e0b>] ? __lock_acquired+0xe6/0x1f2 [ 6.060000] [<ffffffff802a37fb>] ? tracing_start+0x31/0xd3 [ 6.060000] [<ffffffff802a3831>] tracing_start+0x67/0xd3 [ 6.060000] [<ffffffff802a8ace>] ? irqsoff_tracer_reset+0x2d/0x57 [ 6.060000] [<ffffffff802a4d1c>] trace_selftest_startup_preemptirqsoff+0x1c8/0x1f1 [ 6.060000] [<ffffffff802a4798>] register_tracer+0x12f/0x241 [ 6.060000] [<ffffffff810250d0>] ? init_irqsoff_tracer+0x0/0x53 [ 6.060000] [<ffffffff8102510b>] init_irqsoff_tracer+0x3b/0x53 This is because in fail case, the preemptirqsoff tracer selftest calls twice the tracing_start() function: int trace_selftest_startup_preemptirqsoff(struct tracer *trace, struct trace_array *tr) { if (!ret && !count) { printk(KERN_CONT ".. no entries found .."); ret = -1; tracing_start(); <----- goto out; } [...] out: trace->reset(tr); tracing_start(); <------ tracing_max_latency = save_max; return ret; } Since it is well handled in the out path, we don't need the conditional one. Reported-by: Ingo Molnar <mingo@elte.hu> Signed-off-by: Frederic Weisbecker <fweisbec@gmail.com> LKML-Reference: <1237159961-7447-1-git-send-email-fweisbec@gmail.com> Signed-off-by: Ingo Molnar <mingo@elte.hu>
Diffstat (limited to 'kernel/trace/trace_selftest.c')
-rw-r--r--kernel/trace/trace_selftest.c16
1 files changed, 6 insertions, 10 deletions
diff --git a/kernel/trace/trace_selftest.c b/kernel/trace/trace_selftest.c
index f907a2b29028..a2ca6f0fef9b 100644
--- a/kernel/trace/trace_selftest.c
+++ b/kernel/trace/trace_selftest.c
@@ -414,7 +414,7 @@ trace_selftest_startup_preemptirqsoff(struct tracer *trace, struct trace_array *
414 ret = tracer_init(trace, tr); 414 ret = tracer_init(trace, tr);
415 if (ret) { 415 if (ret) {
416 warn_failed_init_tracer(trace, ret); 416 warn_failed_init_tracer(trace, ret);
417 goto out; 417 goto out_no_start;
418 } 418 }
419 419
420 /* reset the max latency */ 420 /* reset the max latency */
@@ -432,21 +432,16 @@ trace_selftest_startup_preemptirqsoff(struct tracer *trace, struct trace_array *
432 tracing_stop(); 432 tracing_stop();
433 /* check both trace buffers */ 433 /* check both trace buffers */
434 ret = trace_test_buffer(tr, NULL); 434 ret = trace_test_buffer(tr, NULL);
435 if (ret) { 435 if (ret)
436 tracing_start();
437 goto out; 436 goto out;
438 }
439 437
440 ret = trace_test_buffer(&max_tr, &count); 438 ret = trace_test_buffer(&max_tr, &count);
441 if (ret) { 439 if (ret)
442 tracing_start();
443 goto out; 440 goto out;
444 }
445 441
446 if (!ret && !count) { 442 if (!ret && !count) {
447 printk(KERN_CONT ".. no entries found .."); 443 printk(KERN_CONT ".. no entries found ..");
448 ret = -1; 444 ret = -1;
449 tracing_start();
450 goto out; 445 goto out;
451 } 446 }
452 447
@@ -475,9 +470,10 @@ trace_selftest_startup_preemptirqsoff(struct tracer *trace, struct trace_array *
475 goto out; 470 goto out;
476 } 471 }
477 472
478 out: 473out:
479 trace->reset(tr);
480 tracing_start(); 474 tracing_start();
475out_no_start:
476 trace->reset(tr);
481 tracing_max_latency = save_max; 477 tracing_max_latency = save_max;
482 478
483 return ret; 479 return ret;