History

ftrace: Add ftrace_find_direct_func()

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.

Steven Rostedt (VMware) committed 7 years ago

Commit 013bf0d1 parent 763e34e2 files · +84 −1Browse files

Showing the changes to include/linux (1 of 2 files). Show all

Unified · Split

include/linux/ftrace.h+6−0
@@ -51,6 +51,7 @@ static inline void early_trace_init(void) { } · 50 unmodified lines
5151
5252 struct module;
5353 struct ftrace_hash;
54+struct ftrace_direct_func;
5455
5556 #if defined(CONFIG_FUNCTION_TRACER) && defined(CONFIG_MODULES) && \
5657 defined(CONFIG_DYNAMIC_FTRACE)
@@ -248,6 +249,7 @@ static inline void ftrace_free_mem(struct module *mod, void *start, void *end) { · 191 unmodified lines
248249 #ifdef CONFIG_DYNAMIC_FTRACE_WITH_DIRECT_CALLS
249250 int register_ftrace_direct(unsigned long ip, unsigned long addr);
250251 int unregister_ftrace_direct(unsigned long ip, unsigned long addr);
252+struct ftrace_direct_func *ftrace_find_direct_func(unsigned long addr);
251253 #else
252254 static inline int register_ftrace_direct(unsigned long ip, unsigned long addr)
253255 {
@@ -257,6 +259,10 @@ static inline int unregister_ftrace_direct(unsigned long ip, unsigned long addr) · 3 unmodified lines
257259 {
258260 return -ENODEV;
259261 }
262+static inline struct ftrace_direct_func *ftrace_find_direct_func(unsigned long addr)
263+{
264+ return NULL;
265+}
260266 #endif /* CONFIG_DYNAMIC_FTRACE_WITH_DIRECT_CALLS */
261267
262268 #ifndef CONFIG_HAVE_DYNAMIC_FTRACE_WITH_DIRECT_CALLS

Keyboard shortcuts

General

Show keyboard shortcuts
?
Focus the current search
/

Issues and pull requests

Open filters
f

Issues, pull requests and Inbox

Select next item
j↓
Select previous item
k↑
Open selected item
Enter
Dismiss filters or clear selection
Esc

Repository code

Go to file
t