]> git.baikalelectronics.ru Git - kernel.git/commit
ftrace/recordmcount: Make ignored mcount calls into nops at compile time
authorSteven Rostedt <srostedt@redhat.com>
Fri, 8 Apr 2011 07:58:48 +0000 (03:58 -0400)
committerSteven Rostedt <rostedt@goodmis.org>
Mon, 16 May 2011 18:43:32 +0000 (14:43 -0400)
commitef7fd999bc14716fa3275d616a1da8b6e9dfab4f
tree6086848f18cb971de2e1cd760f6d8771aaff2c45
parentb8b4c79416e2786051bd5f58ac6d035ae2b2e74e
ftrace/recordmcount: Make ignored mcount calls into nops at compile time

There are sections that are ignored by ftrace for the function tracing because
the text is in a section that can be removed without notice. The mcount calls
in these sections are ignored and ftrace never sees them. The downside of this
is that the functions in these sections still call mcount. Although the mcount
function is defined in assembly simply as a return, this added overhead is
unnecessary.

The solution is to convert these callers into nops at compile time.
A better solution is to add 'notrace' to the section markers, but as new sections
come up all the time, it would be nice that they are delt with when they
are created.

Later patches will deal with finding these sections and doing the proper solution.

Thanks to H. Peter Anvin for giving me the right nops to use for x86.

Cc: "H. Peter Anvin" <hpa@zytor.com>
Cc: John Reiser <jreiser@bitwagon.com>
Link: http://lkml.kernel.org/r/20110421023738.237101176@goodmis.org
Signed-off-by: Steven Rostedt <rostedt@goodmis.org>
scripts/recordmcount.c
scripts/recordmcount.h