Skip to content

Commit 48bb5dc

Browse files
Steven Rostedtrostedt
authored andcommitted
ftrace: Make recordmcount.c handle __fentry__
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]>
1 parent a0e0fac commit 48bb5dc

1 file changed

Lines changed: 3 additions & 1 deletion

File tree

scripts/recordmcount.h

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -261,11 +261,13 @@ static unsigned get_mcountsym(Elf_Sym const *const sym0,
261261
&sym0[Elf_r_sym(relp)];
262262
char const *symname = &str0[w(symp->st_name)];
263263
char const *mcount = gpfx == '_' ? "_mcount" : "mcount";
264+
char const *fentry = "__fentry__";
264265

265266
if (symname[0] == '.')
266267
++symname; /* ppc64 hack */
267268
if (strcmp(mcount, symname) == 0 ||
268-
(altmcount && strcmp(altmcount, symname) == 0))
269+
(altmcount && strcmp(altmcount, symname) == 0) ||
270+
(strcmp(fentry, symname) == 0))
269271
mcountsym = Elf_r_sym(relp);
270272

271273
return mcountsym;

0 commit comments

Comments
 (0)