diff options
author | Ingo Molnar <mingo@elte.hu> | 2010-10-16 14:48:58 +0200 |
---|---|---|
committer | Ingo Molnar <mingo@elte.hu> | 2010-10-16 14:48:58 +0200 |
commit | 66af86e2c630908b21cec018cb612576cf5f516e (patch) | |
tree | 942767fa5a84e0e104d2a44be4c6349a7e166f42 | |
parent | 0fdf13606b67f830559abdaad15980c7f4f05ec4 (diff) | |
parent | 85caa993d7f218b7c2abcfcb28e212396b6a3313 (diff) |
Merge branch 'tip/perf/recordmcount' of git://git.kernel.org/pub/scm/linux/kernel/git/rostedt/linux-2.6-trace into perf/core
-rw-r--r-- | scripts/Makefile.build | 2 | ||||
-rw-r--r-- | scripts/recordmcount.c | 22 |
2 files changed, 21 insertions, 3 deletions
diff --git a/scripts/Makefile.build b/scripts/Makefile.build index 4d03a7efc68..4db60b2e2a7 100644 --- a/scripts/Makefile.build +++ b/scripts/Makefile.build @@ -210,7 +210,7 @@ endif ifdef CONFIG_FTRACE_MCOUNT_RECORD ifdef BUILD_C_RECORDMCOUNT -cmd_record_mcount = $(srctree)/scripts/recordmcount "$(@)"; +cmd_record_mcount = $(objtree)/scripts/recordmcount "$(@)"; else cmd_record_mcount = set -e ; perl $(srctree)/scripts/recordmcount.pl "$(ARCH)" \ "$(if $(CONFIG_CPU_BIG_ENDIAN),big,little)" \ diff --git a/scripts/recordmcount.c b/scripts/recordmcount.c index 7f7f7180fe2..26e1271259b 100644 --- a/scripts/recordmcount.c +++ b/scripts/recordmcount.c @@ -313,12 +313,30 @@ do_file(char const *const fname) int main(int argc, char const *argv[]) { + const char ftrace[] = "kernel/trace/ftrace.o"; + int ftrace_size = sizeof(ftrace) - 1; int n_error = 0; /* gcc-4.3.0 false positive complaint */ - if (argc <= 1) + + if (argc <= 1) { fprintf(stderr, "usage: recordmcount file.o...\n"); - else /* Process each file in turn, allowing deep failure. */ + return 0; + } + + /* Process each file in turn, allowing deep failure. */ for (--argc, ++argv; 0 < argc; --argc, ++argv) { int const sjval = setjmp(jmpenv); + int len; + + /* + * The file kernel/trace/ftrace.o references the mcount + * function but does not call it. Since ftrace.o should + * not be traced anyway, we just skip it. + */ + len = strlen(argv[0]); + if (len >= ftrace_size && + strcmp(argv[0] + (len - ftrace_size), ftrace) == 0) + continue; + switch (sjval) { default: { fprintf(stderr, "internal error: %s\n", argv[0]); |