As function_graph tracer modifies the return address to insert a trampoline to trace the return of a function, it must be aware of a direct caller, as when it gets called, the function's return address may not be at on the stack where it expects. It may have to see if that return address points to the a direct caller and adjust if it is.
Showing the changes to include/linux (1 of 2 files). Show all
Unified · Split
| @@ -51,6 +51,7 @@ static inline void early_trace_init(void) { } · 50 unmodified lines | ||
| 51 | 51 | |
| 52 | 52 | struct module; |
| 53 | 53 | struct ftrace_hash; |
| 54 | +struct ftrace_direct_func; | |
| 54 | 55 | |
| 55 | 56 | #if defined(CONFIG_FUNCTION_TRACER) && defined(CONFIG_MODULES) && \ |
| 56 | 57 | defined(CONFIG_DYNAMIC_FTRACE) |
| @@ -248,6 +249,7 @@ static inline void ftrace_free_mem(struct module *mod, void *start, void *end) { · 191 unmodified lines | ||
| 248 | 249 | #ifdef CONFIG_DYNAMIC_FTRACE_WITH_DIRECT_CALLS |
| 249 | 250 | int register_ftrace_direct(unsigned long ip, unsigned long addr); |
| 250 | 251 | int unregister_ftrace_direct(unsigned long ip, unsigned long addr); |
| 252 | +struct ftrace_direct_func *ftrace_find_direct_func(unsigned long addr); | |
| 251 | 253 | #else |
| 252 | 254 | static inline int register_ftrace_direct(unsigned long ip, unsigned long addr) |
| 253 | 255 | { |
| @@ -257,6 +259,10 @@ static inline int unregister_ftrace_direct(unsigned long ip, unsigned long addr) · 3 unmodified lines | ||
| 257 | 259 | { |
| 258 | 260 | return -ENODEV; |
| 259 | 261 | } |
| 262 | +static inline struct ftrace_direct_func *ftrace_find_direct_func(unsigned long addr) | |
| 263 | +{ | |
| 264 | + return NULL; | |
| 265 | +} | |
| 260 | 266 | #endif /* CONFIG_DYNAMIC_FTRACE_WITH_DIRECT_CALLS */ |
| 261 | 267 | |
| 262 | 268 | #ifndef CONFIG_HAVE_DYNAMIC_FTRACE_WITH_DIRECT_CALLS |