Skip to content

Commit

Permalink
ftrace: Consistently restore trace function on sysctl enabling
Browse files Browse the repository at this point in the history
If we reenable ftrace via syctl, we currently set ftrace_trace_function
based on the previous simplistic algorithm. This is inconsistent with
what update_ftrace_function does. So better call that helper instead.

Link: http://lkml.kernel.org/r/5151D26F.1070702@siemens.com

Cc: stable@vger.kernel.org
Signed-off-by: Jan Kiszka <jan.kiszka@siemens.com>
Signed-off-by: Steven Rostedt <rostedt@goodmis.org>
  • Loading branch information
Jan Kiszka authored and Steven Rostedt committed Apr 8, 2013
1 parent 2930e04 commit 5000c41
Showing 1 changed file with 2 additions and 6 deletions.
8 changes: 2 additions & 6 deletions kernel/trace/ftrace.c
Original file line number Diff line number Diff line change
Expand Up @@ -4555,12 +4555,8 @@ ftrace_enable_sysctl(struct ctl_table *table, int write,
ftrace_startup_sysctl();

/* we are starting ftrace again */
if (ftrace_ops_list != &ftrace_list_end) {
if (ftrace_ops_list->next == &ftrace_list_end)
ftrace_trace_function = ftrace_ops_list->func;
else
ftrace_trace_function = ftrace_ops_list_func;
}
if (ftrace_ops_list != &ftrace_list_end)
update_ftrace_function();

} else {
/* stopping ftrace calls (just send to ftrace_stub) */
Expand Down

0 comments on commit 5000c41

Please sign in to comment.