diff mbox series

selftests/ftrace: Always enable ftrace_enabled for ftrace testcases

Message ID 20200403082929.1869-1-yangx.jy@cn.fujitsu.com
State New
Headers show
Series selftests/ftrace: Always enable ftrace_enabled for ftrace testcases | expand

Commit Message

Xiao Yang April 3, 2020, 8:29 a.m. UTC
A lot of ftrace testcases get failure if ftrace_enabled is disabled by default
because ftrace_enabled is a big on/off switch for the whole function tracer.

Signed-off-by: Xiao Yang <yangx.jy@cn.fujitsu.com>
---
 tools/testing/selftests/ftrace/test.d/functions | 4 ++++
 1 file changed, 4 insertions(+)
diff mbox series

Patch

diff --git a/tools/testing/selftests/ftrace/test.d/functions b/tools/testing/selftests/ftrace/test.d/functions
index 5d4550591ff9..54c18275bd7f 100644
--- a/tools/testing/selftests/ftrace/test.d/functions
+++ b/tools/testing/selftests/ftrace/test.d/functions
@@ -1,3 +1,6 @@ 
+enable_ftrace() { # enable function tracer
+    echo 1 > /proc/sys/kernel/ftrace_enabled
+}
 
 clear_trace() { # reset trace output
     echo > trace
@@ -88,6 +91,7 @@  initialize_ftrace() { # Reset ftrace to initial-state
 # As the initial state, ftrace will be set to nop tracer,
 # no events, no triggers, no filters, no function filters,
 # no probes, and tracing on.
+    enable_ftrace
     disable_tracing
     reset_tracer
     reset_trigger