ftrace/scripts: Update the instructions for ftrace-bisect.sh
authorSteven Rostedt (Google) <rostedt@goodmis.org>
Mon, 23 Jan 2023 16:22:52 +0000 (11:22 -0500)
committerSteven Rostedt (Google) <rostedt@goodmis.org>
Tue, 24 Jan 2023 18:13:07 +0000 (13:13 -0500)
commit7ae4ba7195b1bac04a4210a499da9d8c63b0ba9c
treede7bd738ab9d85041a5ab65b405aa629d8d1cc76
parent3bb06eb6e9acf7c4a3e1b5bc87aed398ff8e2253
ftrace/scripts: Update the instructions for ftrace-bisect.sh

The instructions for the ftrace-bisect.sh script, which is used to find
what function is being traced that is causing a kernel crash, and possibly
a triple fault reboot, uses the old method. In 5.1, a new feature was
added that let the user write in the index into available_filter_functions
that maps to the function a user wants to set in set_ftrace_filter (or
set_ftrace_notrace). This takes O(1) to set, as suppose to writing a
function name, which takes O(n) (where n is the number of functions in
available_filter_functions).

The ftrace-bisect.sh requires setting half of the functions in
available_filter_functions, which is O(n^2) using the name method to enable
and can take several minutes to complete. The number method is O(n) which
takes less than a second to complete. Using the number method for any
kernel 5.1 and after is the proper way to do the bisect.

Update the usage to reflect the new change, as well as using the
/sys/kernel/tracing path instead of the obsolete debugfs path.

Link: https://lkml.kernel.org/r/20230123112252.022003dd@gandalf.local.home
Cc: stable@vger.kernel.org
Cc: Masami Hiramatsu <mhiramat@kernel.org>
Acked-by: Mark Rutland <mark.rutland@arm.com>
Fixes: f79b3f338564e ("ftrace: Allow enabling of filters via index of available_filter_functions")
Signed-off-by: Steven Rostedt (Google) <rostedt@goodmis.org>
scripts/tracing/ftrace-bisect.sh