Skip to content

Commit

Permalink
ftrace: Make recordmcount.c handle __fentry__
Browse files Browse the repository at this point in the history
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.

Link: http://lkml.kernel.org/r/[email protected]

Acked-by: H. Peter Anvin <[email protected]>
Acked-by: John Reiser <[email protected]>
Acked-by: Ingo Molnar <[email protected]>
Cc: Andi Kleen <[email protected]>
Signed-off-by: Steven Rostedt <[email protected]>
  • Loading branch information
Steven Rostedt authored and rostedt committed Aug 23, 2012
1 parent a0e0fac commit 48bb5dc
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion scripts/recordmcount.h
Original file line number Diff line number Diff line change
Expand Up @@ -261,11 +261,13 @@ static unsigned get_mcountsym(Elf_Sym const *const sym0,
&sym0[Elf_r_sym(relp)];
char const *symname = &str0[w(symp->st_name)];
char const *mcount = gpfx == '_' ? "_mcount" : "mcount";
char const *fentry = "__fentry__";

if (symname[0] == '.')
++symname; /* ppc64 hack */
if (strcmp(mcount, symname) == 0 ||
(altmcount && strcmp(altmcount, symname) == 0))
(altmcount && strcmp(altmcount, symname) == 0) ||
(strcmp(fentry, symname) == 0))
mcountsym = Elf_r_sym(relp);

return mcountsym;
Expand Down

0 comments on commit 48bb5dc

Please sign in to comment.