Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

tracing: Have ftrace_dump_on_oops kernel parameter take numbers

The kernel parameter for ftrace_dump_on_oops can take a single assignment.
That is, it can be:

ftrace_dump_on_oops or ftrace_dump_on_oops=orig_cpu

But the content in the sysctl file is a number.

0 for disabled
1 for ftrace_dump_on_oops (all CPUs)
2 for ftrace_dump_on_oops (orig CPU)

Allow the kernel command line to take a number as well to match the sysctl
numbers.

That is:

ftrace_dump_on_oops=1 is the same as ftrace_dump_on_oops

and

ftrace_dump_on_oops=2 is the same as ftrace_dump_on_oops=orig_cpu

Signed-off-by: Steven Rostedt (VMware) <rostedt@goodmis.org>

+2 -2
+2 -2
kernel/trace/trace.c
··· 197 197 198 198 static int __init set_ftrace_dump_on_oops(char *str) 199 199 { 200 - if (*str++ != '=' || !*str) { 200 + if (*str++ != '=' || !*str || !strcmp("1", str)) { 201 201 ftrace_dump_on_oops = DUMP_ALL; 202 202 return 1; 203 203 } 204 204 205 - if (!strcmp("orig_cpu", str)) { 205 + if (!strcmp("orig_cpu", str) || !strcmp("2", str)) { 206 206 ftrace_dump_on_oops = DUMP_ORIG; 207 207 return 1; 208 208 }