Linux Kernel Selftest development
 help / color / mirror / Atom feed
* [PATCH] selftests/ftrace: Always enable ftrace_enabled for ftrace testcases
@ 2020-04-03  8:29 Xiao Yang
  2020-04-03 13:22 ` Steven Rostedt
  0 siblings, 1 reply; 7+ messages in thread
From: Xiao Yang @ 2020-04-03  8:29 UTC (permalink / raw)
  To: rostedt, mingo; +Cc: shuah, ice_yangxiao, linux-kselftest, Xiao Yang

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 --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
-- 
2.23.0




^ permalink raw reply related	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2020-04-04  0:41 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2020-04-03  8:29 [PATCH] selftests/ftrace: Always enable ftrace_enabled for ftrace testcases Xiao Yang
2020-04-03 13:22 ` Steven Rostedt
2020-04-03 15:01   ` Xiao Yang
2020-04-03 15:15     ` Steven Rostedt
2020-04-03 15:36       ` Xiao Yang
2020-04-03 16:31         ` Steven Rostedt
2020-04-04  0:41           ` Xiao Yang

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox