Skip to contentSkip to conversation

tracing,x86_64 - function/graph trace without mcount/-pg/framepointer

RFC Josh Triplett 2 participants 2 messages Feb 7, 2011

lore
Share & tools
lore
#0 lore raw
Quoted 6 lines · Steven Rostedt
Quoted 5 lines · Jiri Olsa

hi,

I recently saw the direct jump probing made for kprobes and tried to use it inside the trace framework.

Quoted 7 lines
Quoted 3 lines

The global idea is patching the function entry with direct jump to the trace code, instead of using pregenerated gcc profile code.

Interesting, but ideally, it would be nice if gcc provided a better "mcount" mechanism. One that calls mcount (or whatever new name it would have) before it does anything with the stack.

GCC 4.6 may help here. According to
http://gcc.gnu.org/gcc-4.6/changes.html:

"Support for emitting profiler counter calls before function prologues. This is enabled via a new command-line option -mfentry."

Looks like that option might only support x86 (32-bit and 64-bit) at the moment, but it still seems like an improvement over the current mechanism to work around GCC's placement of mcount.

- Josh Triplett

#1 lore raw
Quoted 10 lines · Josh Triplett

GCC 4.6 may help here. According to
http://gcc.gnu.org/gcc-4.6/changes.html:

"Support for emitting profiler counter calls before function prologues. This is enabled via a new command-line option -mfentry."

Looks like that option might only support x86 (32-bit and 64-bit) at the moment, but it still seems like an improvement over the current mechanism to work around GCC's placement of mcount.

I may need to download this and try it out.

Thanks for the reference!

-- Steve