summaryrefslogtreecommitdiff
path: root/tools/testing/selftests/bpf/test_ftrace.sh
diff options
context:
space:
mode:
Diffstat (limited to 'tools/testing/selftests/bpf/test_ftrace.sh')
-rwxr-xr-xtools/testing/selftests/bpf/test_ftrace.sh7
1 files changed, 6 insertions, 1 deletions
diff --git a/tools/testing/selftests/bpf/test_ftrace.sh b/tools/testing/selftests/bpf/test_ftrace.sh
index 20de7bb873bc..f5109eb0e951 100755
--- a/tools/testing/selftests/bpf/test_ftrace.sh
+++ b/tools/testing/selftests/bpf/test_ftrace.sh
@@ -1,6 +1,11 @@
#!/bin/bash
-TR=/sys/kernel/debug/tracing/
+if [[ -e /sys/kernel/tracing/trace ]]; then
+ TR=/sys/kernel/tracing/
+else
+ TR=/sys/kernel/debug/tracing/
+fi
+
clear_trace() { # reset trace output
echo > $TR/trace
}