lkml.org 
[lkml]   [2011]   [Apr]   [20]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
Subject[RFC][PATCH 00/11] ftrace/recordmcount: Remove useless mcount calls not being traced
The following is just a heads up on the changes to recordmcount.

Ftrace function tracer will only trace sections that have been white listed.
A section not in the whitelist will not be traced but if the section
is not denoted with "notrace" it will still have calls to mcount.
On x86_64 mcount is defined simply as:

mcount:
retq

But these sections will take a slight overhead for calling the mcount
function and returning. Most of the time we don't care because these are
usually init and exit sections that are not very performance critical.
But it would be nice not to have these calls anyway.

This patch seriers does a few things.

1) various cleanups to recordmcount.c

2) Make the calls (on x86) to mcount that are not being recorded for
the function tracer into nops at compile time.

3) Add a "RECORDMCOUNT_WARN=1" feature to the make command line that
will cause recordmcount to warn when a section contains mcount calls
that is not being traced.

4) Added some "notrace" to section annotations that are not being traced
as well as whitelisting one.

The reason this does not warn by default is because the developer may
not know if the section should be whitelisted or blacklisted (notrace)

Anyway, this is going out as RFC for now if anyone has any comments,
and I also need to get Acked-by's from the Kconfig maintainer for one
of my modifications.

Steven Rostedt (11):
ftrace/trivial: Clean up recordmcount.c to use Linux style comparisons
ftrace/trivial: Clean up record mcount to use Linux switch style
ftrace: Add .kprobe.text section to whitelist for recordmcount.c
ftrace/recordmcount: Modify only executable sections
ftrace/recordmcount: Make ignored mcount calls into nops at compile time
ftrace/recordmcount: Add warning logic to warn on mcount not recorded
kbuild/recordmcount: Add RECORDMCOUNT_WARN to warn about mcount callers
ftrace: Avoid recording mcount on .init sections directly
ftrace/x86: Do not trace .discard.text section
ftrace/recordmcount: Remove duplicate code to find mcount symbol
ftrace/recordmcount: Add helper function get_sym_str_and_relp()

----
Makefile | 1 +
arch/x86/include/asm/setup.h | 2 +-
include/linux/init.h | 14 ++--
scripts/Makefile.build | 5 +-
scripts/recordmcount.c | 162 +++++++++++++++++++++++++++--------------
scripts/recordmcount.h | 165 +++++++++++++++++++++++++++++++++---------
scripts/recordmcount.pl | 1 +
7 files changed, 253 insertions(+), 97 deletions(-)


\
 
 \ /
  Last update: 2011-04-21 04:39    [W:0.221 / U:1.328 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site