From: Steven Rostedt Date: Mon, 12 May 2008 19:20:45 +0000 (+0200) Subject: ftrace: reset selftests X-Git-Tag: v2.6.27-rc1~1102^2^2~1^2~124 X-Git-Url: https://err.no/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=1d4db00a5e30c7b8f8dc2a1b19e886fd942be143;p=linux-2.6 ftrace: reset selftests The tests may leave stuff in the buffers. This resets the buffers after each test is run. If a test fails, it does not reset the buffer to avoid touching a buffer that is corrupted. Signed-off-by: Steven Rostedt Signed-off-by: Ingo Molnar Signed-off-by: Thomas Gleixner --- diff --git a/kernel/trace/trace.c b/kernel/trace/trace.c index 8755a43704..6580e7ed04 100644 --- a/kernel/trace/trace.c +++ b/kernel/trace/trace.c @@ -289,6 +289,13 @@ int register_tracer(struct tracer *type) printk(KERN_CONT "FAILED!\n"); goto out; } + /* Only reset on passing, to avoid touching corrupted buffers */ + for_each_possible_cpu(i) { + data = tr->data[i]; + if (!head_page(data)) + continue; + tracing_reset(data); + } printk(KERN_CONT "PASSED\n"); } #endif