Re: [RFC PATCH 1/4] ftrace: Make recordmcount.c handle __fentry__

From: John Reiser
Date: Tue Aug 07 2012 - 20:06:48 EST


On 08/07/2012 12:38 PM, Steven Rostedt wrote:
> From: Steven Rostedt <srostedt@xxxxxxxxxx>
>
> With gcc 4.6.0 the -mfentry feature places the function profiling call at the start of the function. When this is used, the call is to __fentry__ and not mcount.
>
> Change recordmcount.c to record both callers to __fentry__ and mcount.
[snip]
> - (altmcount && strcmp(altmcount, symname) == 0))
> + (altmcount && strcmp(altmcount, symname) == 0) ||
> + (strcmp(fentry, symname) == 0))


The proposed change will work as long as all the *.o use the same name.
Only one of {"__fentry__", "mcount", "_mcount", altmcount} is allowed
for all the *.o as input for a particular run. [Modulo the hack
of ignoring a leading '.' for 64-bit PowerPC, of course.]

If the user changes compilers (or changes CFLAGS by insert/remove "-mfentry")
without doing a "make clean", then recordmcount will omit some calls.

Those restrictions are easy to guess, and recovery is easy. Therefore,
Ack'ed by: John Reiser <jreiser@xxxxxxxxxxxx>

--

--
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/