From ee6513d58c43302144fe275f0e25151ba66e7fe4 Mon Sep 17 00:00:00 2001 From: Kris Van Hees Date: Mon, 15 May 2017 22:42:30 -0400 Subject: [PATCH] dtrace: adjust FBT entry probe dection for OL7 On OL7, function prologues can be prefixed by a (5-byte) call instruction on x86_64, which breaks the logic to determine if we can place an FBT entry probe on that function. The new logic accounts for the possibility that the anticipated prologue does not show up as first instruction of the function. Orabug: 25921361 Signed-off-by: Kris Van Hees Reviewed-by: Nick Alcock --- arch/x86/kernel/dtrace_fbt.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/arch/x86/kernel/dtrace_fbt.c b/arch/x86/kernel/dtrace_fbt.c index 4d6c0777f67e..923d10820628 100644 --- a/arch/x86/kernel/dtrace_fbt.c +++ b/arch/x86/kernel/dtrace_fbt.c @@ -79,7 +79,7 @@ void dtrace_fbt_init(fbt_add_probe_fn fbt_add_probe) kallsyms_iter_reset(&sym, 0); while (kallsyms_iter_update(&sym, pos++)) { asm_instr_t *addr, *end; - int state = 0; + int state = 0, insc = 0; void *efbp = NULL; void *fbtp = NULL; @@ -148,11 +148,13 @@ void dtrace_fbt_init(fbt_add_probe_fn fbt_add_probe) while (addr < end) { struct insn insn; + insc++; + switch (state) { case 0: /* start of function */ if (*addr == FBT_PUSHL_EBP) state = 1; - else + else if (insc > 2) state = 2; break; case 1: /* push %rbp seen */ -- 2.50.1