From: "Steven Rostedt (Google)" <rostedt@xxxxxxxxxxx> After having tests constantly fail because of some left over tracing that was still enabled before the test started, call tracefs_instance_reset() before and after the unit tests to make sure it starts with a clean slate and does not fail due to residual tracing that was from an external event. Signed-off-by: Steven Rostedt (Google) <rostedt@xxxxxxxxxxx> --- utest/tracefs-utest.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/utest/tracefs-utest.c b/utest/tracefs-utest.c index 28960c191581..183f37cd133a 100644 --- a/utest/tracefs-utest.c +++ b/utest/tracefs-utest.c @@ -2516,6 +2516,7 @@ static void test_custom_trace_dir(void) static int test_suite_destroy(void) { + tracefs_instance_reset(NULL); tracefs_instance_destroy(test_instance); tracefs_instance_free(test_instance); tep_free(test_tep); @@ -2531,6 +2532,9 @@ static int test_suite_init(void) if (!test_instance) return 1; + /* Start with a new slate */ + tracefs_instance_reset(NULL); + return 0; } -- 2.42.0