Thread (7 messages) 7 messages, 2 authors, 2021-06-22

Re: [RFC PATCH 1/2] ftrace: Introduce cmdline argument ftrace_disabled

From: Steven Rostedt <rostedt@goodmis.org>
Date: 2021-06-19 15:22:07
Also in: lkml

On Sat, 19 Jun 2021 14:29:19 +0800
Tiezhu Yang [off-list ref] wrote:
If set CONFIG_FUNCTION_TRACER=y, we can use the following command to
disable ftrace after boot up:
echo 0 > /proc/sys/kernel/ftrace_enabled
I'd love to just remove that. It's original purpose was to stop function
tracing when the latency tracers were active. That's now done via a tracefs
option. The "ftrace_enabled" really has no use anymore.
ftrace_disabled is much stronger than ftrace_enabled, introduce a new
cmdline argument ftrace_disabled for user to control whether to disable
ftrace when boot up.
"ftrace_disabled" is triggered when an anomaly is detected, and for the
safety of the system, ftrace shuts down. It was never meant to be a user
triggered event.

You have no rationale for this change. What's the purpose of this?

-- Steve

quoted hunk ↗ jump to hunk
Signed-off-by: Tiezhu Yang <yangtiezhu@loongson.cn>
---
 kernel/trace/ftrace.c | 8 ++++++++
 1 file changed, 8 insertions(+)
diff --git a/kernel/trace/ftrace.c b/kernel/trace/ftrace.c
index 72ef4dc..a015699 100644
--- a/kernel/trace/ftrace.c
+++ b/kernel/trace/ftrace.c
@@ -5517,6 +5517,14 @@ static char ftrace_filter_buf[FTRACE_FILTER_SIZE] __initdata;
 /* Used by function selftest to not test if filter is set */
 bool ftrace_filter_param __initdata;
 
+static int __init set_ftrace_disabled(char *str)
+{
+	pr_info("Set ftrace_disabled to disable ftrace\n");
+	ftrace_disabled = 1;
+	return 1;
+}
+__setup("ftrace_disabled", set_ftrace_disabled);
+
 static int __init set_ftrace_notrace(char *str)
 {
 	ftrace_filter_param = true;
  
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help