Skip to content

Commit 46f9469

Browse files
committed
ftrace: Rename ftrace_graph_stub to ftrace_stub_graph
The ftrace_graph_stub was created and points to ftrace_stub as a way to assign the functon graph tracer function pointer to a stub function with a different prototype than what ftrace_stub has and not trigger the C verifier. The ftrace_graph_stub was created via the linker script vmlinux.lds.h. Unfortunately, powerpc already uses the name ftrace_graph_stub for its internal implementation of the function graph tracer, and even though powerpc would still build, the change via the linker script broke function tracer on powerpc from working. By using the name ftrace_stub_graph, which does not exist anywhere else in the kernel, this should not be a problem. Link: https://lore.kernel.org/r/[email protected] Fixes: b83b43f ("fgraph: Fix function type mismatches of ftrace_graph_return using ftrace_stub") Reorted-by: Qian Cai <[email protected]> Signed-off-by: Steven Rostedt (VMware) <[email protected]>
1 parent ea806eb commit 46f9469

File tree

2 files changed

+7
-7
lines changed

2 files changed

+7
-7
lines changed

include/asm-generic/vmlinux.lds.h

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -112,25 +112,25 @@
112112
#ifdef CONFIG_FTRACE_MCOUNT_RECORD
113113
#ifdef CC_USING_PATCHABLE_FUNCTION_ENTRY
114114
/*
115-
* Need to also make ftrace_graph_stub point to ftrace_stub
115+
* Need to also make ftrace_stub_graph point to ftrace_stub
116116
* so that the same stub location may have different protocols
117117
* and not mess up with C verifiers.
118118
*/
119119
#define MCOUNT_REC() . = ALIGN(8); \
120120
__start_mcount_loc = .; \
121121
KEEP(*(__patchable_function_entries)) \
122122
__stop_mcount_loc = .; \
123-
ftrace_graph_stub = ftrace_stub;
123+
ftrace_stub_graph = ftrace_stub;
124124
#else
125125
#define MCOUNT_REC() . = ALIGN(8); \
126126
__start_mcount_loc = .; \
127127
KEEP(*(__mcount_loc)) \
128128
__stop_mcount_loc = .; \
129-
ftrace_graph_stub = ftrace_stub;
129+
ftrace_stub_graph = ftrace_stub;
130130
#endif
131131
#else
132132
# ifdef CONFIG_FUNCTION_TRACER
133-
# define MCOUNT_REC() ftrace_graph_stub = ftrace_stub;
133+
# define MCOUNT_REC() ftrace_stub_graph = ftrace_stub;
134134
# else
135135
# define MCOUNT_REC()
136136
# endif

kernel/trace/fgraph.c

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -336,10 +336,10 @@ int ftrace_graph_entry_stub(struct ftrace_graph_ent *trace)
336336
* Simply points to ftrace_stub, but with the proper protocol.
337337
* Defined by the linker script in linux/vmlinux.lds.h
338338
*/
339-
extern void ftrace_graph_stub(struct ftrace_graph_ret *);
339+
extern void ftrace_stub_graph(struct ftrace_graph_ret *);
340340

341341
/* The callbacks that hook a function */
342-
trace_func_graph_ret_t ftrace_graph_return = ftrace_graph_stub;
342+
trace_func_graph_ret_t ftrace_graph_return = ftrace_stub_graph;
343343
trace_func_graph_ent_t ftrace_graph_entry = ftrace_graph_entry_stub;
344344
static trace_func_graph_ent_t __ftrace_graph_entry = ftrace_graph_entry_stub;
345345

@@ -619,7 +619,7 @@ void unregister_ftrace_graph(struct fgraph_ops *gops)
619619
goto out;
620620

621621
ftrace_graph_active--;
622-
ftrace_graph_return = ftrace_graph_stub;
622+
ftrace_graph_return = ftrace_stub_graph;
623623
ftrace_graph_entry = ftrace_graph_entry_stub;
624624
__ftrace_graph_entry = ftrace_graph_entry_stub;
625625
ftrace_shutdown(&graph_ops, FTRACE_STOP_FUNC_RET);

0 commit comments

Comments
 (0)