Commit 9f2dfd61 authored by Peter Zijlstra's avatar Peter Zijlstra Committed by Ingo Molnar

x86,ftrace: Shrink ftrace_regs_caller() by one byte

'Optimize' ftrace_regs_caller. Instead of comparing against an
immediate, the more natural way to test for zero on x86 is: 'test
%r,%r'.

  48 83 f8 00             cmp    $0x0,%rax
  74 49                   je     226 <ftrace_regs_call+0xa3>

  48 85 c0                test   %rax,%rax
  74 49                   je     225 <ftrace_regs_call+0xa2>
Signed-off-by: default avatarPeter Zijlstra (Intel) <peterz@infradead.org>
Reviewed-by: default avatarMiroslav Benes <mbenes@suse.cz>
Reviewed-by: default avatarAlexandre Chartre <alexandre.chartre@oracle.com>
Acked-by: default avatarJosh Poimboeuf <jpoimboe@redhat.com>
Link: https://lkml.kernel.org/r/20200416115118.867411350@infradead.orgSigned-off-by: default avatarIngo Molnar <mingo@kernel.org>
parent dc2745b6
...@@ -240,8 +240,8 @@ SYM_INNER_LABEL(ftrace_regs_call, SYM_L_GLOBAL) ...@@ -240,8 +240,8 @@ SYM_INNER_LABEL(ftrace_regs_call, SYM_L_GLOBAL)
* See arch_ftrace_set_direct_caller(). * See arch_ftrace_set_direct_caller().
*/ */
movq ORIG_RAX(%rsp), %rax movq ORIG_RAX(%rsp), %rax
cmpq $0, %rax testq %rax, %rax
je 1f jz 1f
/* Swap the flags with orig_rax */ /* Swap the flags with orig_rax */
movq MCOUNT_REG_SIZE(%rsp), %rdi movq MCOUNT_REG_SIZE(%rsp), %rdi
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment