aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--kernel/trace/ftrace.c10
-rwxr-xr-xscripts/recordmcount.pl5
2 files changed, 6 insertions, 9 deletions
diff --git a/kernel/trace/ftrace.c b/kernel/trace/ftrace.c
index 9e54a6ccdb93..76bb884b6e16 100644
--- a/kernel/trace/ftrace.c
+++ b/kernel/trace/ftrace.c
@@ -263,14 +263,6 @@ static void ftrace_update_pid_func(void)
263# error Dynamic ftrace depends on MCOUNT_RECORD 263# error Dynamic ftrace depends on MCOUNT_RECORD
264#endif 264#endif
265 265
266/*
267 * Since MCOUNT_ADDR may point to mcount itself, we do not want
268 * to get it confused by reading a reference in the code as we
269 * are parsing on objcopy output of text. Use a variable for
270 * it instead.
271 */
272static unsigned long mcount_addr = MCOUNT_ADDR;
273
274enum { 266enum {
275 FTRACE_ENABLE_CALLS = (1 << 0), 267 FTRACE_ENABLE_CALLS = (1 << 0),
276 FTRACE_DISABLE_CALLS = (1 << 1), 268 FTRACE_DISABLE_CALLS = (1 << 1),
@@ -575,7 +567,7 @@ ftrace_code_disable(struct module *mod, struct dyn_ftrace *rec)
575 567
576 ip = rec->ip; 568 ip = rec->ip;
577 569
578 ret = ftrace_make_nop(mod, rec, mcount_addr); 570 ret = ftrace_make_nop(mod, rec, MCOUNT_ADDR);
579 if (ret) { 571 if (ret) {
580 ftrace_bug(ret, ip); 572 ftrace_bug(ret, ip);
581 rec->flags |= FTRACE_FL_FAILED; 573 rec->flags |= FTRACE_FL_FAILED;
diff --git a/scripts/recordmcount.pl b/scripts/recordmcount.pl
index 282485a22bf8..070042b4ccd5 100755
--- a/scripts/recordmcount.pl
+++ b/scripts/recordmcount.pl
@@ -109,6 +109,11 @@ if ($#ARGV < 7) {
109my ($arch, $bits, $objdump, $objcopy, $cc, 109my ($arch, $bits, $objdump, $objcopy, $cc,
110 $ld, $nm, $rm, $mv, $is_module, $inputfile) = @ARGV; 110 $ld, $nm, $rm, $mv, $is_module, $inputfile) = @ARGV;
111 111
112# This file refers to mcount and shouldn't be ftraced, so lets' ignore it
113if ($inputfile eq "kernel/trace/ftrace.o") {
114 exit(0);
115}
116
112# Acceptable sections to record. 117# Acceptable sections to record.
113my %text_sections = ( 118my %text_sections = (
114 ".text" => 1, 119 ".text" => 1,