Skip to content

RFC tracing: Allow module init functions to be traced

Steven Rostedt lkml 1 version In review

Get series with b4
b4 am [email protected]

Versions newest first

  1. v1 RFC Latest5 patches 5 repliesIn review

Patches in v1 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/5ftrace: Add a ftrace_free_mem() function for modules to useinclude/linux/ftrace.h kernel/trace/ftrace.c+13 -30 replies
2/5ftrace: Allow module init functions to be tracedinclude/linux/init.h kernel/module.c kernel/trace/ftrace.c+5 -40 replies
3/5ftrace: Save module init functions kallsyms symbols for tracinginclude/linux/ftrace.h kernel/kallsyms.c kernel/module.c +1 more+166 -55 replies
4/5ftrace: Add freeing algorithm to free ftrace_mod_mapskernel/trace/ftrace.c+30 -20 replies
5/5ftrace/kallsyms: Have /proc/kallsyms show saved mod init functionsinclude/linux/ftrace.h kernel/kallsyms.c kernel/trace/ftrace.c+77 -50 replies

Reviews trailers per patch

No Reviewed-by, Acked-by or Tested-by trailers for v1 yet.

Read the v1 thread

Cover letter [RFC][PATCH 0/5] tracing: Allow module init functions to be traced

Last release, module functions can be enabled before they are loaded by echoing in ":mod:module-name" into set_ftrace_filter before the module is loaded. When the module is loaded, its functions will be enabled for tracing. Now it makes sense to enable module init functions as well (kernel init functions can already be traced).

The first patch adds a function ftrace_free_mem() to let module code tell ftrace to free the init functions from its tables so that new enabling or disabling of function tracing does not try to modify text that no longer exists in memory.

The second patch enables tracing of init functions from within modules.

The third patch adds kallsyms of those init functions so they look like funtion names and not function pointers within the trace.

The fourth patch frees the saved kallsym name maps of the function names to the module init addresses.

The last patch has kallsyms display the module init functions.

Steven Rostedt (VMware) (5):
ftrace: Add a ftrace_free_mem() function for modules to use
ftrace: Allow module init functions to be traced
ftrace: Save module init functions kallsyms symbols for tracing
ftrace: Add freeing algorithm to free ftrace_mod_maps ftrace/kallsyms: Have /proc/kallsyms show saved mod init functions

----

 include/linux/ftrace.h |  26 ++++++
 include/linux/init.h   |   4 +-
 kernel/kallsyms.c      |  38 +++++++--
 kernel/module.c        |   2 +
 kernel/trace/ftrace.c  | 226 ++++++++++++++++++++++++++++++++++++++++++++++++-
 5 files changed, 284 insertions(+), 12 deletions(-)