https://sourceware.org/bugzilla/show_bug.cgi?id=32886

Bruno Haible <bruno at clisp dot org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
               Host|                            |x86_64-linux-gnu

--- Comment #1 from Bruno Haible <bruno at clisp dot org> ---
I guess that the cause of the problem is that when the x86_64 CPU executes an
instruction, and the gprofng's sampling interrupts the thread, the address of
the *next* instruction is found on the stack.

The fix that I would propose is to decrement the PC / %rip values found on the
stack by 1, when they are not in the beginning of a basic blocks.

For PC / %rip values that correspond to the beginning of a basic block, there
is an ambiguity: The time spent could be in a jump or call instruction, or it
could be in the immediately preceding instruction; one cannot tell these two
cases apart. This means that some wrong attribution of spent time may exist on
ca. 10% of the instructions. But that is not an excuse for doing a wrong
attribution on the other 90% of the instructions, namely those that are
*inside* a basic block.

-- 
You are receiving this mail because:
You are on the CC list for the bug.

Reply via email to