aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSteven Rostedt (Red Hat) <rostedt@goodmis.org>2014-05-07 16:09:49 -0400
committerSteven Rostedt <rostedt@goodmis.org>2014-05-14 11:37:30 -0400
commitf1b2f2bd5821c6ab7feed2e133343dd54b212ed9 (patch)
tree8b967a4f24431d12012bceb72ee5891b0342940b
parent7c0868e03b7a7c50fa10957d8dddaebb09c72044 (diff)
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: Steven Rostedt <rostedt@goodmis.org>
-rw-r--r--arch/x86/kernel/ftrace.c3
-rw-r--r--include/linux/ftrace.h2
-rw-r--r--kernel/trace/ftrace.c13
3 files changed, 4 insertions, 14 deletions
diff --git a/arch/x86/kernel/ftrace.c b/arch/x86/kernel/ftrace.c
index 5ef43ce8492f..89de3eaf8772 100644
--- a/arch/x86/kernel/ftrace.c
+++ b/arch/x86/kernel/ftrace.c
@@ -366,7 +366,6 @@ static int add_breakpoints(struct dyn_ftrace *rec, int enable)
366 /* converting nop to call */ 366 /* converting nop to call */
367 return add_brk_on_nop(rec); 367 return add_brk_on_nop(rec);
368 368
369 case FTRACE_UPDATE_MODIFY_CALL_REGS:
370 case FTRACE_UPDATE_MODIFY_CALL: 369 case FTRACE_UPDATE_MODIFY_CALL:
371 case FTRACE_UPDATE_MAKE_NOP: 370 case FTRACE_UPDATE_MAKE_NOP:
372 /* converting a call to a nop */ 371 /* converting a call to a nop */
@@ -469,7 +468,6 @@ static int add_update(struct dyn_ftrace *rec, int enable)
469 case FTRACE_UPDATE_IGNORE: 468 case FTRACE_UPDATE_IGNORE:
470 return 0; 469 return 0;
471 470
472 case FTRACE_UPDATE_MODIFY_CALL_REGS:
473 case FTRACE_UPDATE_MODIFY_CALL: 471 case FTRACE_UPDATE_MODIFY_CALL:
474 case FTRACE_UPDATE_MAKE_CALL: 472 case FTRACE_UPDATE_MAKE_CALL:
475 /* converting nop to call */ 473 /* converting nop to call */
@@ -516,7 +514,6 @@ static int finish_update(struct dyn_ftrace *rec, int enable)
516 case FTRACE_UPDATE_IGNORE: 514 case FTRACE_UPDATE_IGNORE:
517 return 0; 515 return 0;
518 516
519 case FTRACE_UPDATE_MODIFY_CALL_REGS:
520 case FTRACE_UPDATE_MODIFY_CALL: 517 case FTRACE_UPDATE_MODIFY_CALL:
521 case FTRACE_UPDATE_MAKE_CALL: 518 case FTRACE_UPDATE_MAKE_CALL:
522 /* converting nop to call */ 519 /* converting nop to call */
diff --git a/include/linux/ftrace.h b/include/linux/ftrace.h
index 2f8cbffecd3d..3e6dfb31f8e6 100644
--- a/include/linux/ftrace.h
+++ b/include/linux/ftrace.h
@@ -362,14 +362,12 @@ enum {
362 * IGNORE - The function is already what we want it to be 362 * IGNORE - The function is already what we want it to be
363 * MAKE_CALL - Start tracing the function 363 * MAKE_CALL - Start tracing the function
364 * MODIFY_CALL - Stop saving regs for the function 364 * MODIFY_CALL - Stop saving regs for the function
365 * MODIFY_CALL_REGS - Start saving regs for the function
366 * MAKE_NOP - Stop tracing the function 365 * MAKE_NOP - Stop tracing the function
367 */ 366 */
368enum { 367enum {
369 FTRACE_UPDATE_IGNORE, 368 FTRACE_UPDATE_IGNORE,
370 FTRACE_UPDATE_MAKE_CALL, 369 FTRACE_UPDATE_MAKE_CALL,
371 FTRACE_UPDATE_MODIFY_CALL, 370 FTRACE_UPDATE_MODIFY_CALL,
372 FTRACE_UPDATE_MODIFY_CALL_REGS,
373 FTRACE_UPDATE_MAKE_NOP, 371 FTRACE_UPDATE_MAKE_NOP,
374}; 372};
375 373
diff --git a/kernel/trace/ftrace.c b/kernel/trace/ftrace.c
index 52c2b53b7953..cc07b7fc4372 100644
--- a/kernel/trace/ftrace.c
+++ b/kernel/trace/ftrace.c
@@ -1701,19 +1701,15 @@ static int ftrace_check_record(struct dyn_ftrace *rec, int enable, int update)
1701 /* 1701 /*
1702 * If this record is being updated from a nop, then 1702 * If this record is being updated from a nop, then
1703 * return UPDATE_MAKE_CALL. 1703 * return UPDATE_MAKE_CALL.
1704 * Otherwise, if the EN flag is set, then return
1705 * UPDATE_MODIFY_CALL_REGS to tell the caller to convert
1706 * from the non-save regs, to a save regs function.
1707 * Otherwise, 1704 * Otherwise,
1708 * return UPDATE_MODIFY_CALL to tell the caller to convert 1705 * return UPDATE_MODIFY_CALL to tell the caller to convert
1709 * from the save regs, to a non-save regs function. 1706 * from the save regs, to a non-save regs function or
1707 * vice versa.
1710 */ 1708 */
1711 if (flag & FTRACE_FL_ENABLED) 1709 if (flag & FTRACE_FL_ENABLED)
1712 return FTRACE_UPDATE_MAKE_CALL; 1710 return FTRACE_UPDATE_MAKE_CALL;
1713 else if (rec->flags & FTRACE_FL_REGS_EN) 1711
1714 return FTRACE_UPDATE_MODIFY_CALL_REGS; 1712 return FTRACE_UPDATE_MODIFY_CALL;
1715 else
1716 return FTRACE_UPDATE_MODIFY_CALL;
1717 } 1713 }
1718 1714
1719 if (update) { 1715 if (update) {
@@ -1815,7 +1811,6 @@ __ftrace_replace_code(struct dyn_ftrace *rec, int enable)
1815 case FTRACE_UPDATE_MAKE_NOP: 1811 case FTRACE_UPDATE_MAKE_NOP:
1816 return ftrace_make_nop(NULL, rec, ftrace_addr); 1812 return ftrace_make_nop(NULL, rec, ftrace_addr);
1817 1813
1818 case FTRACE_UPDATE_MODIFY_CALL_REGS:
1819 case FTRACE_UPDATE_MODIFY_CALL: 1814 case FTRACE_UPDATE_MODIFY_CALL:
1820 return ftrace_modify_call(rec, ftrace_old_addr, ftrace_addr); 1815 return ftrace_modify_call(rec, ftrace_old_addr, ftrace_addr);
1821 } 1816 }