Skip to contentSkip to conversation

selftests/ftrace: Check for dynamic_events before clearing

PATCH New Jaewon Jung 1 participant 1 message Oct 16

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 selftests/ftrace: Check for dynamic_events before clearing

Trace instances do not have a dynamic_events file, but clear_dynamic_events() is called during initialization. Check for the file to avoid a "No such file or directory" error.

---
 tools/testing/selftests/ftrace/test.d/functions | 2 ++
 1 file changed, 2 insertions(+)
tools/testing/selftests/ftrace/test.d/functions +2 -0
index 826141e299e5..4f2abb05e365 100644
@@ -84,6 +84,8 @@ clear_synthetic_events() { # reset all current synthetic events
 }
 
 clear_dynamic_events() { # reset all current dynamic events
+    [ -f dynamic_events ] || return 0
+
     again=1
     stop=1
     # loop mulitple times as some events require other to be removed first
Signature · 1 line
2.43.0