`perf annotate` (and other disassemblies) do not show source code by default anymore
Description:
By default, perf
's disassemblies (perf report
, perf annotate
...) do not interleave source code. This appears to be a regression of sorts, and can be worked around by explicitly passing the --objdump
flag.
By default, since Arch builds perf
with libLLVM support, that has priority over parsing objdump
output, unless --objdump
is passed. (My debugging stopped at determining that LLVM does correctly map the assembly lines back to source code, but I couldn't determine why they aren't printed.) I'd argue this is a usability regression, though reverting to objdump
also adds some noise that could also be considered a usability regression.
Additional info:
- package version(s):
perf 6.12-1
,llvm-libs 18.1.8-4
,binutils 2.43+r4+g7999dae6961-1
- config and/or log files: N/A
- link to upstream bug report, if any: N/A
Steps to reproduce:
- Save the following as, say,
test.c
:int main(int argc, char *argv[]) { for (;;) { asm("nop"); } }
gcc -O0 -g test.c -o test
-
perf record ./test
, and Ctrl-C soon after. -
perf annotate
, notice the lack of source code, even when pressing the s key. -
perf annotate --objdump=$(which objdump)
, notice that source code is now interleaved. (Together with a lot of extra cruft, though.)
(This has been reproduced with real-world programs as well, though.)