diff options
Diffstat (limited to 'kernel/trace/trace_selftest.c')
-rw-r--r-- | kernel/trace/trace_selftest.c | 23 |
1 files changed, 23 insertions, 0 deletions
diff --git a/kernel/trace/trace_selftest.c b/kernel/trace/trace_selftest.c index 18c5423bc977..0911b7e073bf 100644 --- a/kernel/trace/trace_selftest.c +++ b/kernel/trace/trace_selftest.c | |||
@@ -538,3 +538,26 @@ trace_selftest_startup_sched_switch(struct tracer *trace, struct trace_array *tr | |||
538 | return ret; | 538 | return ret; |
539 | } | 539 | } |
540 | #endif /* CONFIG_CONTEXT_SWITCH_TRACER */ | 540 | #endif /* CONFIG_CONTEXT_SWITCH_TRACER */ |
541 | |||
542 | #ifdef CONFIG_SYSPROF_TRACER | ||
543 | int | ||
544 | trace_selftest_startup_sysprof(struct tracer *trace, struct trace_array *tr) | ||
545 | { | ||
546 | unsigned long count; | ||
547 | int ret; | ||
548 | |||
549 | /* start the tracing */ | ||
550 | tr->ctrl = 1; | ||
551 | trace->init(tr); | ||
552 | /* Sleep for a 1/10 of a second */ | ||
553 | msleep(100); | ||
554 | /* stop the tracing. */ | ||
555 | tr->ctrl = 0; | ||
556 | trace->ctrl_update(tr); | ||
557 | /* check the trace buffer */ | ||
558 | ret = trace_test_buffer(tr, &count); | ||
559 | trace->reset(tr); | ||
560 | |||
561 | return ret; | ||
562 | } | ||
563 | #endif /* CONFIG_SYSPROF_TRACER */ | ||