lkml.org 
[lkml]   [2021]   [Jun]   [19]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
From
Subject[RFC PATCH 1/2] ftrace: Introduce cmdline argument ftrace_disabled
Date
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

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.

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;
--
2.1.0
\
 
 \ /
  Last update: 2021-06-19 08:30    [W:0.043 / U:0.732 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site