[sheepdog] [PATCH v2 05/10] trace: move nop5 to trace.c
MORITA Kazutaka
morita.kazutaka at gmail.com
Fri Aug 9 05:21:59 CEST 2013
From: MORITA Kazutaka <morita.kazutaka at lab.ntt.co.jp>
No need to write it with an assembly code.
Signed-off-by: MORITA Kazutaka <morita.kazutaka at lab.ntt.co.jp>
---
sheep/trace/mcount.S | 4 ----
sheep/trace/trace.c | 3 +++
sheep/trace/trace.h | 1 -
3 files changed, 3 insertions(+), 5 deletions(-)
diff --git a/sheep/trace/mcount.S b/sheep/trace/mcount.S
index 54b1c97..36fedb6 100644
--- a/sheep/trace/mcount.S
+++ b/sheep/trace/mcount.S
@@ -58,7 +58,3 @@ ENTRY(trace_return_caller)
movq (%rsp), %rax
addq $24, %rsp
jmp *%rdi
-
-.globl NOP5
-NOP5:
- .byte 0x0f,0x1f,0x44,0x00,0x00 # Intel recommended one for 5 bytes nops
diff --git a/sheep/trace/trace.c b/sheep/trace/trace.c
index bcd528e..eeeee3e 100644
--- a/sheep/trace/trace.c
+++ b/sheep/trace/trace.c
@@ -15,6 +15,9 @@
#include "trace.h"
+/* Intel recommended one for 5 bytes nops (nopl 0x0(%rax,%rax,1)) */
+static const unsigned char NOP5[INSN_SIZE] = {0x0f, 0x1f, 0x44, 0x00, 0x00};
+
static LIST_HEAD(tracers);
static __thread int ret_stack_index;
static __thread struct {
diff --git a/sheep/trace/trace.h b/sheep/trace/trace.h
index 19701d5..e90ee9a 100644
--- a/sheep/trace/trace.h
+++ b/sheep/trace/trace.h
@@ -37,7 +37,6 @@ typedef void (*trace_func_graph_ent_t)(struct trace_graph_item *);
void mcount(void);
void trace_caller(void);
void trace_call(unsigned long, unsigned long *);
-extern const unsigned char NOP5[];
void trace_return_caller(void);
unsigned long trace_return_call(void);
--
1.7.9.5
More information about the sheepdog
mailing list