diff options
author | Steven Rostedt (Google) <rostedt@goodmis.org> | 2023-12-28 16:52:02 -0500 |
---|---|---|
committer | Steven Rostedt (Google) <rostedt@goodmis.org> | 2023-12-28 19:17:54 -0500 |
commit | 576ee0b96390d29f3c3bbfe451b5163abedf982f (patch) | |
tree | 31970c1df5271690783e6ab282db128b8db73329 | |
parent | 118b694b5262d3ee8aff73c85e8d4526ee085ef8 (diff) | |
download | libtracefs-576ee0b96390d29f3c3bbfe451b5163abedf982f.tar.gz |
libtracefs: Reset tracing before and after unit tests
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.
Link: https://lore.kernel.org/linux-trace-devel/20231228215433.54854-8-rostedt@goodmis.org
Signed-off-by: Steven Rostedt (Google) <rostedt@goodmis.org>
-rw-r--r-- | utest/tracefs-utest.c | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/utest/tracefs-utest.c b/utest/tracefs-utest.c index 28960c1..183f37c 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; } |