Re: [RFC 0/4] tracing,x86_64 - function/graph trace withoutmcount/-pg/framepointer

From: Josh Triplett
Date: Mon Feb 07 2011 - 16:22:58 EST


On Fri, Jun 23, 2000 at 10:56:55AM +0000, Steven Rostedt wrote:
> On Thu, 2011-02-03 at 16:42 +0100, Jiri Olsa wrote:
> > hi,
> >
> > I recently saw the direct jump probing made for kprobes
> > and tried to use it inside the trace framework.
> >
> > 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
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/