[sheepdog] [PATCH 06/10] trace: move nop5 to trace.c

Liu Yuan namei.unix at gmail.com
Wed Aug 7 19:38:50 CEST 2013


On Thu, Aug 08, 2013 at 12:49:04AM +0900, MORITA Kazutaka wrote:
> 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 014741c..0ae5a8a 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)) */
> +const unsigned char NOP5[INSN_SIZE] = {0x0f, 0x1f, 0x44, 0x00, 0x00};

Better set NOP5 as static

Thanks
Yuan



More information about the sheepdog mailing list