Re: [PATCH V7 13/17] perf, x86: enable LBR callstack when recording callchain

From: Andi Kleen
Date: Wed Nov 05 2014 - 12:57:20 EST


> LBR callstack fails for leaf function optimization. Where the callee does
> not return to its caller but instead to the caller's caller. That is the one
> case I know about. There are others I believe.

No it should work fine for this case. You just don't see the tail call,
but the call stack does not get out of sync, so future calls work fine.
It's the same as with frame pointers or even dwarf.

Typical cases that throw it off are throwing exceptions or user space
context switching.

One somewhat common case that used to throw it off was the
call 1f ; 1: pop %ebx
older 32bit binaries used to do to get the PIC offset. That has been
fixed in newer compilers by using an out of line function
(and also Broadwell has a workaround for this)

-Andi

--
ak@xxxxxxxxxxxxxxx -- Speaking for myself only
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/