Skip to contentSkip to conversation

ftrace: fix traceoff_on_warning handling on boot command line

PATCH In review Luis Claudio R. Goncalves 2 participants 2 messages Nov 12, 2014 Tracing

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 ftrace: fix traceoff_on_warning handling on boot command line

Steven,

While backporting traceoff_on_warning to 3.10.33-rt we noticed a slightly difference between what was stated on Documentation/kernel-parameters.txt and the actual code.

Please consider the following patch for inclusion.

Best regards,
Luis

------

ftrace: fix traceoff_on_warning handling on boot command line

According to the documentation, adding "traceoff_on_warning" to the boot command line should be enough to enable the feature. But right now it is necessary to specify "traceoff_on_warning=". Along with fixing that, also verify if the value passed, if any, is either "0" or "off".

kernel/trace/trace.c +3 -2
index f68981f..a956a60 100644
@@ -155,10 +155,11 @@ __setup("ftrace_dump_on_oops", set_ftrace_dump_on_oops);
 
 static int __init stop_trace_on_warning(char *str)
 {
-	__disable_trace_on_warning = 1;
+	if ((strcmp(str, "=0") != 0 && strcmp(str, "=off") != 0))
+		__disable_trace_on_warning = 1;
 	return 1;
 }
-__setup("traceoff_on_warning=", stop_trace_on_warning);
+__setup("traceoff_on_warning", stop_trace_on_warning);
 
 static int __init boot_alloc_snapshot(char *str)
 {
maintainer
#1 lore raw
Quoted 11 lines · On Wed, 12 Nov 2014 21:14:00 -0200 "Luis Claudio R. Goncalves"…

Steven,

While backporting traceoff_on_warning to 3.10.33-rt we noticed a slightly difference between what was stated on Documentation/kernel-parameters.txt and the actual code.

Please consider the following patch for inclusion.

Best regards,
Luis

Thanks Luis, I'll add it to my queue.

-- Steve

Quoted 30 lines

------

ftrace: fix traceoff_on_warning handling on boot command line

According to the documentation, adding "traceoff_on_warning" to the boot command line should be enough to enable the feature. But right now it is necessary to specify "traceoff_on_warning=". Along with fixing that, also verify if the value passed, if any, is either "0" or "off".

kernel/trace/trace.c +3 -2
index f68981f..a956a60 100644
@@ -155,10 +155,11 @@ __setup("ftrace_dump_on_oops", set_ftrace_dump_on_oops);
 
 static int __init stop_trace_on_warning(char *str)
 {
-	__disable_trace_on_warning = 1;
+	if ((strcmp(str, "=0") != 0 && strcmp(str, "=off") != 0))
+		__disable_trace_on_warning = 1;
 	return 1;
 }
-__setup("traceoff_on_warning=", stop_trace_on_warning);
+__setup("traceoff_on_warning", stop_trace_on_warning);
 
 static int __init boot_alloc_snapshot(char *str)
 {