From 1127c6e8cf7fb3eaaaf095d51300e7fef230f2a5 Mon Sep 17 00:00:00 2001 From: Ingo Molnar Date: Sat, 16 Oct 2010 20:17:25 +0200 Subject: [PATCH] --- yaml --- r: 211933 b: refs/heads/master c: f92f6e6ee35d2779aa62e70f78ad8e1cd417eb52 h: refs/heads/master i: 211931: ea065120b784a8818a8251133cdef29359918f48 v: v3 --- [refs] | 2 +- trunk/scripts/Makefile.build | 2 +- trunk/scripts/recordmcount.c | 22 ++++++++++++++++++++-- 3 files changed, 22 insertions(+), 4 deletions(-) diff --git a/[refs] b/[refs] index 4af650e76b03..0507cfa8ce24 100644 --- a/[refs] +++ b/[refs] @@ -1,2 +1,2 @@ --- -refs/heads/master: cd254f295248c98b62ea824f361e10d80a081fe7 +refs/heads/master: f92f6e6ee35d2779aa62e70f78ad8e1cd417eb52 diff --git a/trunk/scripts/Makefile.build b/trunk/scripts/Makefile.build index 4d03a7efc689..4db60b2e2a76 100644 --- a/trunk/scripts/Makefile.build +++ b/trunk/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/trunk/scripts/recordmcount.c b/trunk/scripts/recordmcount.c index 7f7f7180fe24..26e1271259ba 100644 --- a/trunk/scripts/recordmcount.c +++ b/trunk/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]);