On Wed, 26 Apr 2023 07:11:24 +0300 "Tzvetomir Stoyanov (VMware)" <tz.stoyanov@xxxxxxxxx> wrote: > +static void test_instance_reset(void) > +{ > + struct tracefs_instance *instance = NULL; > + const char *name = get_rand_str(); > + > + CU_TEST(tracefs_instance_exists(name) == false); > + instance = tracefs_instance_create(name); > + CU_TEST(instance != NULL); > + > + CU_TEST(test_instance_check_default_state(instance) == true); > + > + CU_TEST(tracefs_tracer_set(instance, TRACEFS_TRACER_HWLAT) == 0); > + CU_TEST(tracefs_event_enable(instance, "bridge", "fdb_delete") == 0); Was there a reason why you picked HWLAT tracer and the fdb_delete trace event? Neither exist in my test machine setup, so this test automatically fails. -- Steve > + CU_TEST(tracefs_instance_file_write(instance, "set_ftrace_pid", "5") > 0); > + CU_TEST(tracefs_instance_file_write(instance, "trace_clock", "global") > 0); > + CU_TEST(tracefs_instance_file_write(instance, "set_event_pid", "5") > 0); > + CU_TEST(tracefs_instance_file_write(instance, "set_ftrace_filter", > + "schedule:stacktrace") > 0); > + CU_TEST(tracefs_instance_file_write(instance, "set_ftrace_notrace", > + "schedule:stacktrace") > 0); > + CU_TEST(tracefs_instance_file_write(instance, "tracing_cpumask", "0f") > 0); > + CU_TEST(tracefs_instance_file_write(instance, "events/syscalls/sys_exit_read/trigger", > + "enable_event:kmem:kmalloc:1") > 0); > + CU_TEST(tracefs_instance_file_write(instance, "events/bridge/fdb_delete/filter", > + "common_pid == 5") > 0); > + > + CU_TEST(test_instance_check_default_state(instance) == false); > + > + tracefs_instance_reset(instance); > + CU_TEST(test_instance_check_default_state(instance) == true); > + > + CU_TEST(tracefs_instance_destroy(instance) == 0); > + tracefs_instance_free(instance); > +} > +