aboutsummaryrefslogtreecommitdiffstats
path: root/kernel
diff options
context:
space:
mode:
Diffstat (limited to 'kernel')
-rw-r--r--kernel/trace/ftrace.c10
1 files changed, 9 insertions, 1 deletions
diff --git a/kernel/trace/ftrace.c b/kernel/trace/ftrace.c
index 969a83f75a3e..b69966f0f144 100644
--- a/kernel/trace/ftrace.c
+++ b/kernel/trace/ftrace.c
@@ -37,6 +37,14 @@ int ftrace_enabled __read_mostly;
37static int last_ftrace_enabled; 37static int last_ftrace_enabled;
38 38
39/* 39/*
40 * Since MCOUNT_ADDR may point to mcount itself, we do not want
41 * to get it confused by reading a reference in the code as we
42 * are parsing on objcopy output of text. Use a variable for
43 * it instead.
44 */
45static unsigned long mcount_addr = MCOUNT_ADDR;
46
47/*
40 * ftrace_disabled is set when an anomaly is discovered. 48 * ftrace_disabled is set when an anomaly is discovered.
41 * ftrace_disabled is much stronger than ftrace_enabled. 49 * ftrace_disabled is much stronger than ftrace_enabled.
42 */ 50 */
@@ -577,7 +585,7 @@ ftrace_code_disable(struct dyn_ftrace *rec)
577 ip = rec->ip; 585 ip = rec->ip;
578 586
579 nop = ftrace_nop_replace(); 587 nop = ftrace_nop_replace();
580 call = ftrace_call_replace(ip, MCOUNT_ADDR); 588 call = ftrace_call_replace(ip, mcount_addr);
581 589
582 failed = ftrace_modify_code(ip, call, nop); 590 failed = ftrace_modify_code(ip, call, nop);
583 if (failed) { 591 if (failed) {