aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--arch/arm/kernel/ftrace.c10
-rw-r--r--arch/powerpc/kernel/ftrace.c10
-rw-r--r--arch/sparc64/kernel/ftrace.c7
-rw-r--r--arch/x86/kernel/ftrace.c10
-rw-r--r--kernel/trace/ftrace.c7
5 files changed, 0 insertions, 44 deletions
diff --git a/arch/arm/kernel/ftrace.c b/arch/arm/kernel/ftrace.c
index f4cb4cc3fa0c..22f3d6e309f9 100644
--- a/arch/arm/kernel/ftrace.c
+++ b/arch/arm/kernel/ftrace.c
@@ -22,16 +22,6 @@
22static unsigned long bl_insn; 22static unsigned long bl_insn;
23static const unsigned long NOP = 0xe1a00000; /* mov r0, r0 */ 23static const unsigned long NOP = 0xe1a00000; /* mov r0, r0 */
24 24
25/* return true if mcount call site is already patched/no-op'ed */
26int ftrace_ip_converted(unsigned long pc)
27{
28 unsigned long save;
29
30 pc -= INSN_SIZE;
31 save = *(unsigned long *)pc;
32 return save == NOP;
33}
34
35unsigned char *ftrace_nop_replace(void) 25unsigned char *ftrace_nop_replace(void)
36{ 26{
37 return (char *)&NOP; 27 return (char *)&NOP;
diff --git a/arch/powerpc/kernel/ftrace.c b/arch/powerpc/kernel/ftrace.c
index 69ed41223468..e12c593ab9ca 100644
--- a/arch/powerpc/kernel/ftrace.c
+++ b/arch/powerpc/kernel/ftrace.c
@@ -27,16 +27,6 @@ static unsigned int ftrace_nop = 0x60000000;
27# define GET_ADDR(addr) *(unsigned long *)addr 27# define GET_ADDR(addr) *(unsigned long *)addr
28#endif 28#endif
29 29
30notrace int ftrace_ip_converted(unsigned long ip)
31{
32 unsigned int save;
33
34 ip -= CALL_BACK;
35 save = *(unsigned int *)ip;
36
37 return save == ftrace_nop;
38}
39
40static unsigned int notrace ftrace_calc_offset(long ip, long addr) 30static unsigned int notrace ftrace_calc_offset(long ip, long addr)
41{ 31{
42 return (int)((addr + CALL_BACK) - ip); 32 return (int)((addr + CALL_BACK) - ip);
diff --git a/arch/sparc64/kernel/ftrace.c b/arch/sparc64/kernel/ftrace.c
index f449e6df6c4a..c17373195b1e 100644
--- a/arch/sparc64/kernel/ftrace.c
+++ b/arch/sparc64/kernel/ftrace.c
@@ -7,13 +7,6 @@
7 7
8static const u32 ftrace_nop = 0x01000000; 8static const u32 ftrace_nop = 0x01000000;
9 9
10notrace int ftrace_ip_converted(unsigned long ip)
11{
12 u32 insn = *(u32 *) ip;
13
14 return (insn == ftrace_nop);
15}
16
17notrace unsigned char *ftrace_nop_replace(void) 10notrace unsigned char *ftrace_nop_replace(void)
18{ 11{
19 return (char *)&ftrace_nop; 12 return (char *)&ftrace_nop;
diff --git a/arch/x86/kernel/ftrace.c b/arch/x86/kernel/ftrace.c
index 498608c015fb..bc5cf8d46742 100644
--- a/arch/x86/kernel/ftrace.c
+++ b/arch/x86/kernel/ftrace.c
@@ -31,16 +31,6 @@ union ftrace_code_union {
31 } __attribute__((packed)); 31 } __attribute__((packed));
32}; 32};
33 33
34notrace int ftrace_ip_converted(unsigned long ip)
35{
36 unsigned long save;
37
38 ip -= CALL_BACK;
39 save = *(long *)ip;
40
41 return save == *ftrace_nop;
42}
43
44static int notrace ftrace_calc_offset(long ip, long addr) 34static int notrace ftrace_calc_offset(long ip, long addr)
45{ 35{
46 return (int)(addr - ip); 36 return (int)(addr - ip);
diff --git a/kernel/trace/ftrace.c b/kernel/trace/ftrace.c
index ec54cb7d69d6..a8929e4c77c1 100644
--- a/kernel/trace/ftrace.c
+++ b/kernel/trace/ftrace.c
@@ -306,13 +306,6 @@ ftrace_record_ip(unsigned long ip)
306 if (ftrace_ip_in_hash(ip, key)) 306 if (ftrace_ip_in_hash(ip, key))
307 goto out_unlock; 307 goto out_unlock;
308 308
309 /*
310 * There's a slight race that the ftraced will update the
311 * hash and reset here. If it is already converted, skip it.
312 */
313 if (ftrace_ip_converted(ip))
314 goto out_unlock;
315
316 node = ftrace_alloc_dyn_node(ip); 309 node = ftrace_alloc_dyn_node(ip);
317 if (!node) 310 if (!node)
318 goto out_unlock; 311 goto out_unlock;