Skip to content

Commit

Permalink
ftrace: reset selftests
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Steven Rostedt authored and Thomas Gleixner committed May 23, 2008
1 parent 08bafa0 commit 1d4db00
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions kernel/trace/trace.c
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 1d4db00

Please sign in to comment.