提交 7c0868e0 编写于 作者: S Steven Rostedt (Red Hat) 提交者: Steven Rostedt

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: NSteven Rostedt <rostedt@goodmis.org>
上级 7413af1f
...@@ -1798,12 +1798,12 @@ __ftrace_replace_code(struct dyn_ftrace *rec, int enable) ...@@ -1798,12 +1798,12 @@ __ftrace_replace_code(struct dyn_ftrace *rec, int enable)
unsigned long ftrace_addr; unsigned long ftrace_addr;
int ret; int ret;
ret = ftrace_update_record(rec, enable); ftrace_addr = ftrace_get_addr_new(rec);
if (rec->flags & FTRACE_FL_REGS) /* This needs to be done before we call ftrace_update_record */
ftrace_addr = (unsigned long)FTRACE_REGS_ADDR; ftrace_old_addr = ftrace_get_addr_curr(rec);
else
ftrace_addr = (unsigned long)FTRACE_ADDR; ret = ftrace_update_record(rec, enable);
switch (ret) { switch (ret) {
case FTRACE_UPDATE_IGNORE: case FTRACE_UPDATE_IGNORE:
...@@ -1817,11 +1817,6 @@ __ftrace_replace_code(struct dyn_ftrace *rec, int enable) ...@@ -1817,11 +1817,6 @@ __ftrace_replace_code(struct dyn_ftrace *rec, int enable)
case FTRACE_UPDATE_MODIFY_CALL_REGS: case FTRACE_UPDATE_MODIFY_CALL_REGS:
case FTRACE_UPDATE_MODIFY_CALL: case FTRACE_UPDATE_MODIFY_CALL:
if (rec->flags & FTRACE_FL_REGS)
ftrace_old_addr = (unsigned long)FTRACE_ADDR;
else
ftrace_old_addr = (unsigned long)FTRACE_REGS_ADDR;
return ftrace_modify_call(rec, ftrace_old_addr, ftrace_addr); return ftrace_modify_call(rec, ftrace_old_addr, ftrace_addr);
} }
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册