Commit f1b2f2bd authored by Steven Rostedt (Red Hat)'s avatar Steven Rostedt (Red Hat) Committed by Steven Rostedt

ftrace: Remove FTRACE_UPDATE_MODIFY_CALL_REGS flag

As the decision to what needs to be done (converting a call to the
ftrace_caller to ftrace_caller_regs or to convert from ftrace_caller_regs
to ftrace_caller) can easily be determined from the rec->flags of
FTRACE_FL_REGS and FTRACE_FL_REGS_EN, there's no need to have the
ftrace_check_record() return either a UPDATE_MODIFY_CALL_REGS or a
UPDATE_MODIFY_CALL. Just he latter is enough. This added flag causes
more complexity than is required. Remove it.
Signed-off-by: default avatarSteven Rostedt <rostedt@goodmis.org>
parent 7c0868e0
...@@ -366,7 +366,6 @@ static int add_breakpoints(struct dyn_ftrace *rec, int enable) ...@@ -366,7 +366,6 @@ static int add_breakpoints(struct dyn_ftrace *rec, int enable)
/* converting nop to call */ /* converting nop to call */
return add_brk_on_nop(rec); return add_brk_on_nop(rec);
case FTRACE_UPDATE_MODIFY_CALL_REGS:
case FTRACE_UPDATE_MODIFY_CALL: case FTRACE_UPDATE_MODIFY_CALL:
case FTRACE_UPDATE_MAKE_NOP: case FTRACE_UPDATE_MAKE_NOP:
/* converting a call to a nop */ /* converting a call to a nop */
...@@ -469,7 +468,6 @@ static int add_update(struct dyn_ftrace *rec, int enable) ...@@ -469,7 +468,6 @@ static int add_update(struct dyn_ftrace *rec, int enable)
case FTRACE_UPDATE_IGNORE: case FTRACE_UPDATE_IGNORE:
return 0; return 0;
case FTRACE_UPDATE_MODIFY_CALL_REGS:
case FTRACE_UPDATE_MODIFY_CALL: case FTRACE_UPDATE_MODIFY_CALL:
case FTRACE_UPDATE_MAKE_CALL: case FTRACE_UPDATE_MAKE_CALL:
/* converting nop to call */ /* converting nop to call */
...@@ -516,7 +514,6 @@ static int finish_update(struct dyn_ftrace *rec, int enable) ...@@ -516,7 +514,6 @@ static int finish_update(struct dyn_ftrace *rec, int enable)
case FTRACE_UPDATE_IGNORE: case FTRACE_UPDATE_IGNORE:
return 0; return 0;
case FTRACE_UPDATE_MODIFY_CALL_REGS:
case FTRACE_UPDATE_MODIFY_CALL: case FTRACE_UPDATE_MODIFY_CALL:
case FTRACE_UPDATE_MAKE_CALL: case FTRACE_UPDATE_MAKE_CALL:
/* converting nop to call */ /* converting nop to call */
......
...@@ -362,14 +362,12 @@ enum { ...@@ -362,14 +362,12 @@ enum {
* IGNORE - The function is already what we want it to be * IGNORE - The function is already what we want it to be
* MAKE_CALL - Start tracing the function * MAKE_CALL - Start tracing the function
* MODIFY_CALL - Stop saving regs for the function * MODIFY_CALL - Stop saving regs for the function
* MODIFY_CALL_REGS - Start saving regs for the function
* MAKE_NOP - Stop tracing the function * MAKE_NOP - Stop tracing the function
*/ */
enum { enum {
FTRACE_UPDATE_IGNORE, FTRACE_UPDATE_IGNORE,
FTRACE_UPDATE_MAKE_CALL, FTRACE_UPDATE_MAKE_CALL,
FTRACE_UPDATE_MODIFY_CALL, FTRACE_UPDATE_MODIFY_CALL,
FTRACE_UPDATE_MODIFY_CALL_REGS,
FTRACE_UPDATE_MAKE_NOP, FTRACE_UPDATE_MAKE_NOP,
}; };
......
...@@ -1701,18 +1701,14 @@ static int ftrace_check_record(struct dyn_ftrace *rec, int enable, int update) ...@@ -1701,18 +1701,14 @@ static int ftrace_check_record(struct dyn_ftrace *rec, int enable, int update)
/* /*
* If this record is being updated from a nop, then * If this record is being updated from a nop, then
* return UPDATE_MAKE_CALL. * return UPDATE_MAKE_CALL.
* Otherwise, if the EN flag is set, then return
* UPDATE_MODIFY_CALL_REGS to tell the caller to convert
* from the non-save regs, to a save regs function.
* Otherwise, * Otherwise,
* return UPDATE_MODIFY_CALL to tell the caller to convert * return UPDATE_MODIFY_CALL to tell the caller to convert
* from the save regs, to a non-save regs function. * from the save regs, to a non-save regs function or
* vice versa.
*/ */
if (flag & FTRACE_FL_ENABLED) if (flag & FTRACE_FL_ENABLED)
return FTRACE_UPDATE_MAKE_CALL; return FTRACE_UPDATE_MAKE_CALL;
else if (rec->flags & FTRACE_FL_REGS_EN)
return FTRACE_UPDATE_MODIFY_CALL_REGS;
else
return FTRACE_UPDATE_MODIFY_CALL; return FTRACE_UPDATE_MODIFY_CALL;
} }
...@@ -1815,7 +1811,6 @@ __ftrace_replace_code(struct dyn_ftrace *rec, int enable) ...@@ -1815,7 +1811,6 @@ __ftrace_replace_code(struct dyn_ftrace *rec, int enable)
case FTRACE_UPDATE_MAKE_NOP: case FTRACE_UPDATE_MAKE_NOP:
return ftrace_make_nop(NULL, rec, ftrace_addr); return ftrace_make_nop(NULL, rec, ftrace_addr);
case FTRACE_UPDATE_MODIFY_CALL_REGS:
case FTRACE_UPDATE_MODIFY_CALL: case FTRACE_UPDATE_MODIFY_CALL:
return ftrace_modify_call(rec, ftrace_old_addr, ftrace_addr); return ftrace_modify_call(rec, ftrace_old_addr, ftrace_addr);
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment