提交 1d4db00a 编写于 作者: S Steven Rostedt 提交者: Thomas Gleixner

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: NSteven Rostedt <srostedt@redhat.com>
Signed-off-by: NIngo Molnar <mingo@elte.hu>
Signed-off-by: NThomas Gleixner <tglx@linutronix.de>
上级 08bafa0e
...@@ -289,6 +289,13 @@ int register_tracer(struct tracer *type) ...@@ -289,6 +289,13 @@ int register_tracer(struct tracer *type)
printk(KERN_CONT "FAILED!\n"); printk(KERN_CONT "FAILED!\n");
goto out; 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"); printk(KERN_CONT "PASSED\n");
} }
#endif #endif
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册