Skip to content

Commit 8275f69

Browse files
miniplirostedt
authored andcommitted
ftrace: Statically initialize pm notifier block
Instead of initializing the pm notifier block in register_ftrace_graph(), initialize it statically. This safes us some code. Found in the PaX patch, written by the PaX Team. Link: http://lkml.kernel.org/p/[email protected] Cc: Frederic Weisbecker <[email protected]> Cc: Ingo Molnar <[email protected]> Cc: PaX Team <[email protected]> Signed-off-by: Mathias Krause <[email protected]> Signed-off-by: Steven Rostedt <[email protected]>
1 parent 74bb8c4 commit 8275f69

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

kernel/trace/ftrace.c

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4860,7 +4860,6 @@ ftrace_enable_sysctl(struct ctl_table *table, int write,
48604860
#ifdef CONFIG_FUNCTION_GRAPH_TRACER
48614861

48624862
static int ftrace_graph_active;
4863-
static struct notifier_block ftrace_suspend_notifier;
48644863

48654864
int ftrace_graph_entry_stub(struct ftrace_graph_ent *trace)
48664865
{
@@ -5036,6 +5035,10 @@ static void update_function_graph_func(void)
50365035
ftrace_graph_entry = ftrace_graph_entry_test;
50375036
}
50385037

5038+
static struct notifier_block ftrace_suspend_notifier = {
5039+
.notifier_call = ftrace_suspend_notifier_call,
5040+
};
5041+
50395042
int register_ftrace_graph(trace_func_graph_ret_t retfunc,
50405043
trace_func_graph_ent_t entryfunc)
50415044
{
@@ -5049,7 +5052,6 @@ int register_ftrace_graph(trace_func_graph_ret_t retfunc,
50495052
goto out;
50505053
}
50515054

5052-
ftrace_suspend_notifier.notifier_call = ftrace_suspend_notifier_call;
50535055
register_pm_notifier(&ftrace_suspend_notifier);
50545056

50555057
ftrace_graph_active++;

0 commit comments

Comments
 (0)