diff options
author | Ingo Molnar <mingo@elte.hu> | 2008-05-12 15:20:47 -0400 |
---|---|---|
committer | Thomas Gleixner <tglx@linutronix.de> | 2008-05-23 17:39:38 -0400 |
commit | a6dd24f8d00cbccb560b19a723e6fb9bdfb20799 (patch) | |
tree | 8170d270a55b3d5856eef54a16e76b24d5a62c38 /kernel/trace/trace_selftest.c | |
parent | 56a08bdcff20f0022bd9160c1093e56f763499aa (diff) |
ftrace: sysprof-plugin, add self-tests
Signed-off-by: Ingo Molnar <mingo@elte.hu>
Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
Diffstat (limited to 'kernel/trace/trace_selftest.c')
-rw-r--r-- | kernel/trace/trace_selftest.c | 28 |
1 files changed, 28 insertions, 0 deletions
diff --git a/kernel/trace/trace_selftest.c b/kernel/trace/trace_selftest.c index 3877dd9102f1..033a6fb2e5ff 100644 --- a/kernel/trace/trace_selftest.c +++ b/kernel/trace/trace_selftest.c | |||
@@ -537,3 +537,31 @@ trace_selftest_startup_sched_switch(struct tracer *trace, struct trace_array *tr | |||
537 | return ret; | 537 | return ret; |
538 | } | 538 | } |
539 | #endif /* CONFIG_CONTEXT_SWITCH_TRACER */ | 539 | #endif /* CONFIG_CONTEXT_SWITCH_TRACER */ |
540 | |||
541 | #ifdef CONFIG_SYSPROF_TRACER | ||
542 | int | ||
543 | trace_selftest_startup_sysprof(struct tracer *trace, struct trace_array *tr) | ||
544 | { | ||
545 | unsigned long count; | ||
546 | int ret; | ||
547 | |||
548 | /* start the tracing */ | ||
549 | tr->ctrl = 1; | ||
550 | trace->init(tr); | ||
551 | /* Sleep for a 1/10 of a second */ | ||
552 | msleep(100); | ||
553 | /* stop the tracing. */ | ||
554 | tr->ctrl = 0; | ||
555 | trace->ctrl_update(tr); | ||
556 | /* check the trace buffer */ | ||
557 | ret = trace_test_buffer(tr, &count); | ||
558 | trace->reset(tr); | ||
559 | |||
560 | if (!ret && !count) { | ||
561 | printk(KERN_CONT ".. no entries found .."); | ||
562 | ret = -1; | ||
563 | } | ||
564 | |||
565 | return ret; | ||
566 | } | ||
567 | #endif /* CONFIG_SYSPROF_TRACER */ | ||