aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSteven Rostedt <rostedt@goodmis.org>2008-10-23 09:33:06 -0400
committerIngo Molnar <mingo@elte.hu>2008-10-23 10:00:23 -0400
commit4d296c24326783bff1282ac72f310d8bac8df413 (patch)
tree75751fdafc0fa5818a926478e78dd9e54f1cf872
parentcb7be3b2fc2cf089ee52b16f0fd9ebb29e9944e1 (diff)
ftrace: remove mcount set
The arch dependent function ftrace_mcount_set was only used by the daemon start up code. This patch removes it. Signed-off-by: Steven Rostedt <srostedt@redhat.com> Signed-off-by: Ingo Molnar <mingo@elte.hu>
-rw-r--r--arch/arm/kernel/ftrace.c13
-rw-r--r--arch/powerpc/kernel/ftrace.c17
-rw-r--r--arch/sparc64/kernel/ftrace.c18
-rw-r--r--arch/x86/kernel/ftrace.c7
-rw-r--r--include/linux/ftrace.h1
-rw-r--r--kernel/trace/ftrace.c9
6 files changed, 0 insertions, 65 deletions
diff --git a/arch/arm/kernel/ftrace.c b/arch/arm/kernel/ftrace.c
index 76d50e6091bc..6c90479e8974 100644
--- a/arch/arm/kernel/ftrace.c
+++ b/arch/arm/kernel/ftrace.c
@@ -95,19 +95,6 @@ int ftrace_update_ftrace_func(ftrace_func_t func)
95 return ret; 95 return ret;
96} 96}
97 97
98int ftrace_mcount_set(unsigned long *data)
99{
100 unsigned long pc, old;
101 unsigned long *addr = data;
102 unsigned char *new;
103
104 pc = (unsigned long)&mcount_call;
105 memcpy(&old, &mcount_call, MCOUNT_INSN_SIZE);
106 new = ftrace_call_replace(pc, *addr);
107 *addr = ftrace_modify_code(pc, (unsigned char *)&old, new);
108 return 0;
109}
110
111/* run from kstop_machine */ 98/* run from kstop_machine */
112int __init ftrace_dyn_arch_init(void *data) 99int __init ftrace_dyn_arch_init(void *data)
113{ 100{
diff --git a/arch/powerpc/kernel/ftrace.c b/arch/powerpc/kernel/ftrace.c
index 3855ceb937b0..6b75522e8b34 100644
--- a/arch/powerpc/kernel/ftrace.c
+++ b/arch/powerpc/kernel/ftrace.c
@@ -126,23 +126,6 @@ notrace int ftrace_update_ftrace_func(ftrace_func_t func)
126 return ret; 126 return ret;
127} 127}
128 128
129notrace int ftrace_mcount_set(unsigned long *data)
130{
131 unsigned long ip = (long)(&mcount_call);
132 unsigned long *addr = data;
133 unsigned char old[MCOUNT_INSN_SIZE], *new;
134
135 /*
136 * Replace the mcount stub with a pointer to the
137 * ip recorder function.
138 */
139 memcpy(old, &mcount_call, MCOUNT_INSN_SIZE);
140 new = ftrace_call_replace(ip, *addr);
141 *addr = ftrace_modify_code(ip, old, new);
142
143 return 0;
144}
145
146int __init ftrace_dyn_arch_init(void *data) 129int __init ftrace_dyn_arch_init(void *data)
147{ 130{
148 /* This is running in kstop_machine */ 131 /* This is running in kstop_machine */
diff --git a/arch/sparc64/kernel/ftrace.c b/arch/sparc64/kernel/ftrace.c
index 4298d0aee713..447942041a7c 100644
--- a/arch/sparc64/kernel/ftrace.c
+++ b/arch/sparc64/kernel/ftrace.c
@@ -69,24 +69,6 @@ notrace int ftrace_update_ftrace_func(ftrace_func_t func)
69 return ftrace_modify_code(ip, old, new); 69 return ftrace_modify_code(ip, old, new);
70} 70}
71 71
72notrace int ftrace_mcount_set(unsigned long *data)
73{
74 unsigned long ip = (long)(&mcount_call);
75 unsigned long *addr = data;
76 unsigned char old[MCOUNT_INSN_SIZE], *new;
77
78 /*
79 * Replace the mcount stub with a pointer to the
80 * ip recorder function.
81 */
82 memcpy(old, &mcount_call, MCOUNT_INSN_SIZE);
83 new = ftrace_call_replace(ip, *addr);
84 *addr = ftrace_modify_code(ip, old, new);
85
86 return 0;
87}
88
89
90int __init ftrace_dyn_arch_init(void *data) 72int __init ftrace_dyn_arch_init(void *data)
91{ 73{
92 ftrace_mcount_set(data); 74 ftrace_mcount_set(data);
diff --git a/arch/x86/kernel/ftrace.c b/arch/x86/kernel/ftrace.c
index da4fb0deecf7..b399eed23538 100644
--- a/arch/x86/kernel/ftrace.c
+++ b/arch/x86/kernel/ftrace.c
@@ -103,13 +103,6 @@ notrace int ftrace_update_ftrace_func(ftrace_func_t func)
103 return ret; 103 return ret;
104} 104}
105 105
106notrace int ftrace_mcount_set(unsigned long *data)
107{
108 /* mcount is initialized as a nop */
109 *data = 0;
110 return 0;
111}
112
113int __init ftrace_dyn_arch_init(void *data) 106int __init ftrace_dyn_arch_init(void *data)
114{ 107{
115 extern const unsigned char ftrace_test_p6nop[]; 108 extern const unsigned char ftrace_test_p6nop[];
diff --git a/include/linux/ftrace.h b/include/linux/ftrace.h
index ac58e94668b7..1c4835f86911 100644
--- a/include/linux/ftrace.h
+++ b/include/linux/ftrace.h
@@ -71,7 +71,6 @@ extern int ftrace_ip_converted(unsigned long ip);
71extern unsigned char *ftrace_nop_replace(void); 71extern unsigned char *ftrace_nop_replace(void);
72extern unsigned char *ftrace_call_replace(unsigned long ip, unsigned long addr); 72extern unsigned char *ftrace_call_replace(unsigned long ip, unsigned long addr);
73extern int ftrace_dyn_arch_init(void *data); 73extern int ftrace_dyn_arch_init(void *data);
74extern int ftrace_mcount_set(unsigned long *data);
75extern int ftrace_update_ftrace_func(ftrace_func_t func); 74extern int ftrace_update_ftrace_func(ftrace_func_t func);
76extern void ftrace_caller(void); 75extern void ftrace_caller(void);
77extern void ftrace_call(void); 76extern void ftrace_call(void);
diff --git a/kernel/trace/ftrace.c b/kernel/trace/ftrace.c
index e758cab0836f..226fd9132d53 100644
--- a/kernel/trace/ftrace.c
+++ b/kernel/trace/ftrace.c
@@ -620,7 +620,6 @@ static int ftrace_update_code(void *ignore);
620 620
621static int __ftrace_modify_code(void *data) 621static int __ftrace_modify_code(void *data)
622{ 622{
623 unsigned long addr;
624 int *command = data; 623 int *command = data;
625 624
626 if (*command & FTRACE_ENABLE_CALLS) { 625 if (*command & FTRACE_ENABLE_CALLS) {
@@ -639,14 +638,6 @@ static int __ftrace_modify_code(void *data)
639 if (*command & FTRACE_UPDATE_TRACE_FUNC) 638 if (*command & FTRACE_UPDATE_TRACE_FUNC)
640 ftrace_update_ftrace_func(ftrace_trace_function); 639 ftrace_update_ftrace_func(ftrace_trace_function);
641 640
642 if (*command & FTRACE_ENABLE_MCOUNT) {
643 addr = (unsigned long)ftrace_record_ip;
644 ftrace_mcount_set(&addr);
645 } else if (*command & FTRACE_DISABLE_MCOUNT) {
646 addr = (unsigned long)ftrace_stub;
647 ftrace_mcount_set(&addr);
648 }
649
650 return 0; 641 return 0;
651} 642}
652 643