aboutsummaryrefslogtreecommitdiffstats
path: root/kernel
diff options
context:
space:
mode:
authorSteven Rostedt (Red Hat) <rostedt@goodmis.org>2014-05-08 07:01:21 -0400
committerSteven Rostedt <rostedt@goodmis.org>2014-05-14 11:37:29 -0400
commit7c0868e03b7a7c50fa10957d8dddaebb09c72044 (patch)
tree3b5fc12dd767f6ebbbec8058f59bea5ff585ab0d /kernel
parent7413af1fb70e7efa6dbc7f27663e7a5126b3aa33 (diff)
ftrace: Use the ftrace_addr helper functions to find the ftrace_addr
With the moving of the functions that determine what the mcount call site should be replaced with into the generic code, there is a few places in the generic code that can use them instead of hard coding it as it does. Signed-off-by: Steven Rostedt <rostedt@goodmis.org>
Diffstat (limited to 'kernel')
-rw-r--r--kernel/trace/ftrace.c15
1 files changed, 5 insertions, 10 deletions
diff --git a/kernel/trace/ftrace.c b/kernel/trace/ftrace.c
index e825fded435d..52c2b53b7953 100644
--- a/kernel/trace/ftrace.c
+++ b/kernel/trace/ftrace.c
@@ -1798,12 +1798,12 @@ __ftrace_replace_code(struct dyn_ftrace *rec, int enable)
1798 unsigned long ftrace_addr; 1798 unsigned long ftrace_addr;
1799 int ret; 1799 int ret;
1800 1800
1801 ret = ftrace_update_record(rec, enable); 1801 ftrace_addr = ftrace_get_addr_new(rec);
1802 1802
1803 if (rec->flags & FTRACE_FL_REGS) 1803 /* This needs to be done before we call ftrace_update_record */
1804 ftrace_addr = (unsigned long)FTRACE_REGS_ADDR; 1804 ftrace_old_addr = ftrace_get_addr_curr(rec);
1805 else 1805
1806 ftrace_addr = (unsigned long)FTRACE_ADDR; 1806 ret = ftrace_update_record(rec, enable);
1807 1807
1808 switch (ret) { 1808 switch (ret) {
1809 case FTRACE_UPDATE_IGNORE: 1809 case FTRACE_UPDATE_IGNORE:
@@ -1817,11 +1817,6 @@ __ftrace_replace_code(struct dyn_ftrace *rec, int enable)
1817 1817
1818 case FTRACE_UPDATE_MODIFY_CALL_REGS: 1818 case FTRACE_UPDATE_MODIFY_CALL_REGS:
1819 case FTRACE_UPDATE_MODIFY_CALL: 1819 case FTRACE_UPDATE_MODIFY_CALL:
1820 if (rec->flags & FTRACE_FL_REGS)
1821 ftrace_old_addr = (unsigned long)FTRACE_ADDR;
1822 else
1823 ftrace_old_addr = (unsigned long)FTRACE_REGS_ADDR;
1824
1825 return ftrace_modify_call(rec, ftrace_old_addr, ftrace_addr); 1820 return ftrace_modify_call(rec, ftrace_old_addr, ftrace_addr);
1826 } 1821 }
1827 1822