From 134fe2d4ce840c7d486c2fc9342b93ec981d62f2 Mon Sep 17 00:00:00 2001 From: Shaohua Li Date: Fri, 9 Jan 2009 11:29:40 +0800 Subject: [PATCH] --- yaml --- r: 140621 b: refs/heads/master c: 25aac9dc7c8c73798c1be8aa36141f980d32579e h: refs/heads/master i: 140619: 0e8615e359eaa1be4371127e0a96dada1f23248d v: v3 --- [refs] | 2 +- trunk/kernel/trace/ftrace.c | 10 +--------- trunk/scripts/recordmcount.pl | 5 +++++ 3 files changed, 7 insertions(+), 10 deletions(-) diff --git a/[refs] b/[refs] index 725741d2c842..dced86b719e1 100644 --- a/[refs] +++ b/[refs] @@ -1,2 +1,2 @@ --- -refs/heads/master: 18c167fd6d8feec5d337bd8fbc3a17da4cc37652 +refs/heads/master: 25aac9dc7c8c73798c1be8aa36141f980d32579e diff --git a/trunk/kernel/trace/ftrace.c b/trunk/kernel/trace/ftrace.c index 9e54a6ccdb93..76bb884b6e16 100644 --- a/trunk/kernel/trace/ftrace.c +++ b/trunk/kernel/trace/ftrace.c @@ -263,14 +263,6 @@ static void ftrace_update_pid_func(void) # error Dynamic ftrace depends on MCOUNT_RECORD #endif -/* - * Since MCOUNT_ADDR may point to mcount itself, we do not want - * to get it confused by reading a reference in the code as we - * are parsing on objcopy output of text. Use a variable for - * it instead. - */ -static unsigned long mcount_addr = MCOUNT_ADDR; - enum { FTRACE_ENABLE_CALLS = (1 << 0), FTRACE_DISABLE_CALLS = (1 << 1), @@ -575,7 +567,7 @@ ftrace_code_disable(struct module *mod, struct dyn_ftrace *rec) ip = rec->ip; - ret = ftrace_make_nop(mod, rec, mcount_addr); + ret = ftrace_make_nop(mod, rec, MCOUNT_ADDR); if (ret) { ftrace_bug(ret, ip); rec->flags |= FTRACE_FL_FAILED; diff --git a/trunk/scripts/recordmcount.pl b/trunk/scripts/recordmcount.pl index 282485a22bf8..070042b4ccd5 100755 --- a/trunk/scripts/recordmcount.pl +++ b/trunk/scripts/recordmcount.pl @@ -109,6 +109,11 @@ my ($arch, $bits, $objdump, $objcopy, $cc, $ld, $nm, $rm, $mv, $is_module, $inputfile) = @ARGV; +# This file refers to mcount and shouldn't be ftraced, so lets' ignore it +if ($inputfile eq "kernel/trace/ftrace.o") { + exit(0); +} + # Acceptable sections to record. my %text_sections = ( ".text" => 1,