aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSteven Rostedt <srostedt@redhat.com>2008-05-12 21:20:45 +0200
committerThomas Gleixner <tglx@linutronix.de>2008-05-23 20:41:29 +0200
commit1d4db00a5e30c7b8f8dc2a1b19e886fd942be143 (patch)
tree3a1619ad932674ccaccbf489949c4a14c0e6a494
parent08bafa0efcf29fe18ec39c2147077b597368b018 (diff)
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 <srostedt@redhat.com> Signed-off-by: Ingo Molnar <mingo@elte.hu> Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
-rw-r--r--kernel/trace/trace.c7
1 files changed, 7 insertions, 0 deletions
diff --git a/kernel/trace/trace.c b/kernel/trace/trace.c
index 8755a437048..6580e7ed04b 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