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>
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;
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 */