summaryrefslogtreecommitdiffstats
path: root/kernel/trace/trace_selftest.c
diff options
context:
space:
mode:
authorIngo Molnar <mingo@elte.hu>2008-05-12 21:20:47 +0200
committerThomas Gleixner <tglx@linutronix.de>2008-05-23 23:39:38 +0200
commita6dd24f8d00cbccb560b19a723e6fb9bdfb20799 (patch)
tree8170d270a55b3d5856eef54a16e76b24d5a62c38 /kernel/trace/trace_selftest.c
parent56a08bdcff20f0022bd9160c1093e56f763499aa (diff)
downloadop-kernel-dev-a6dd24f8d00cbccb560b19a723e6fb9bdfb20799.zip
op-kernel-dev-a6dd24f8d00cbccb560b19a723e6fb9bdfb20799.tar.gz
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.c28
1 files changed, 28 insertions, 0 deletions
diff --git a/kernel/trace/trace_selftest.c b/kernel/trace/trace_selftest.c
index 3877dd9..033a6fb 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
return ret;
}
#endif /* CONFIG_CONTEXT_SWITCH_TRACER */
+
+#ifdef CONFIG_SYSPROF_TRACER
+int
+trace_selftest_startup_sysprof(struct tracer *trace, struct trace_array *tr)
+{
+ unsigned long count;
+ int ret;
+
+ /* start the tracing */
+ tr->ctrl = 1;
+ trace->init(tr);
+ /* Sleep for a 1/10 of a second */
+ msleep(100);
+ /* stop the tracing. */
+ tr->ctrl = 0;
+ trace->ctrl_update(tr);
+ /* check the trace buffer */
+ ret = trace_test_buffer(tr, &count);
+ trace->reset(tr);
+
+ if (!ret && !count) {
+ printk(KERN_CONT ".. no entries found ..");
+ ret = -1;
+ }
+
+ return ret;
+}
+#endif /* CONFIG_SYSPROF_TRACER */
OpenPOWER on IntegriCloud