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
51 51
52struct module;52struct module;
53struct ftrace_hash;53struct ftrace_hash;
54struct ftrace_direct_func;
54 55
55#if defined(CONFIG_FUNCTION_TRACER) && defined(CONFIG_MODULES) && \56#if defined(CONFIG_FUNCTION_TRACER) && defined(CONFIG_MODULES) && \
56 defined(CONFIG_DYNAMIC_FTRACE)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#ifdef CONFIG_DYNAMIC_FTRACE_WITH_DIRECT_CALLS249#ifdef CONFIG_DYNAMIC_FTRACE_WITH_DIRECT_CALLS
249int register_ftrace_direct(unsigned long ip, unsigned long addr);250int register_ftrace_direct(unsigned long ip, unsigned long addr);
250int unregister_ftrace_direct(unsigned long ip, unsigned long addr);251int unregister_ftrace_direct(unsigned long ip, unsigned long addr);
252struct ftrace_direct_func *ftrace_find_direct_func(unsigned long addr);
251#else253#else
252static inline int register_ftrace_direct(unsigned long ip, unsigned long addr)254static 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 return -ENODEV;260 return -ENODEV;
259}261}
262static inline struct ftrace_direct_func *ftrace_find_direct_func(unsigned long addr)
263{
264 return NULL;
265}
260#endif /* CONFIG_DYNAMIC_FTRACE_WITH_DIRECT_CALLS */266#endif /* CONFIG_DYNAMIC_FTRACE_WITH_DIRECT_CALLS */
261 267
262#ifndef CONFIG_HAVE_DYNAMIC_FTRACE_WITH_DIRECT_CALLS268#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