1

Where is the kernel symbol __tracepoint_module_load defined?
I saw it once in /proc/kallsyms, but now I can't find it.

bootlin.com/linux/ cannot find it, either.

red0ct
  • 4,840
  • 3
  • 17
  • 44
George Robinson
  • 1,500
  • 9
  • 21

1 Answers1

3

Where is the kernel symbol __tracepoint_module_load defined ?

There is TRACE_EVENT macro, which eventually uses __DECLARE_TRACE, where you can see:

extern struct tracepoint __tracepoint_##name;

So we can find the appropriate TRACE_EVENT "call" for module_load in include/trace/events/module.h:

TRACE_EVENT(module_load,
...

In /proc/kallsyms output D means that the symbol is in the initialized data section:

ffffffff91af5240 D __tracepoint_module_load

P.S. In case of preprocessor magic elixir.bootlin.com is not so useful. To make a real investigation just clone Linux kernel or download the appropriate sources from pub.

red0ct
  • 4,840
  • 3
  • 17
  • 44
  • OK thanks. That was difficult. Also, do you know what options the Kernel needs to be built with, in order for the `__tracepoint_module_load` symbol to become exported to `/proc/kallsyms` ? I noticed that `CONFIG_MODULES` is needed...but what else ? Are `CONFIG_KALLSYMS_ALL` and `CONFIG_TRACEPOINTS` needed, too ? – George Robinson Dec 11 '19 at 23:32