]> www.infradead.org Git - users/jedix/linux-maple.git/commitdiff
dtrace: adjust FBT entry probe dection for OL7
authorKris Van Hees <kris.van.hees@oracle.com>
Tue, 16 May 2017 02:42:30 +0000 (22:42 -0400)
committerKris Van Hees <kris.van.hees@oracle.com>
Tue, 23 May 2017 13:44:26 +0000 (09:44 -0400)
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 <kris.van.hees@oracle.com>
Reviewed-by: Nick Alcock <nick.alcock@oracle.com>
arch/x86/kernel/dtrace_fbt.c

index 4d6c0777f67e128a0f1f51800a057a9241c5e3f0..923d10820628458626e471321acf0fedab4a0cf3 100644 (file)
@@ -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 */