[3/5] tools perf: Fix compilation error with new binutils
authorAndres Freund <andres@anarazel.de>
Sun, 3 Jul 2022 21:25:49 +0000 (14:25 -0700)
committerSalvatore Bonaccorso <carnil@debian.org>
Sat, 24 Sep 2022 11:05:59 +0000 (12:05 +0100)
commitde058120d4c79ca0fd1d542bcc165ddd1ad7c6d5
tree9889b271c22cbc8bb4a51af2140df3bbc1602bca
parent602abc659d657af8b3faa700c12b98ebd8f37cb7
[3/5] tools perf: Fix compilation error with new binutils

Origin: https://lore.kernel.org/lkml/20220703212551.1114923-4-andres@anarazel.de/

binutils changed the signature of init_disassemble_info(), which now causes
compilation failures for tools/perf/util/annotate.c, e.g. on debian
unstable. Relevant binutils commit:
https://sourceware.org/git/?p=binutils-gdb.git;a=commit;h=60a3da00bd5407f07

Wire up the feature test and switch to init_disassemble_info_compat(),
which were introduced in prior commits, fixing the compilation failure.

I verified that perf can still disassemble bpf programs by using bpftrace
under load, recording a perf trace, and then annotating the bpf "function"
with and without the changes. With old binutils there's no change in output
before/after this patch. When comparing the output from old binutils (2.35)
to new bintuils with the patch (upstream snapshot) there are a few output
differences, but they are unrelated to this patch. An example hunk is:

     1.15 :   55:mov    %rbp,%rdx
     0.00 :   58:add    $0xfffffffffffffff8,%rdx
     0.00 :   5c:xor    %ecx,%ecx
-    1.03 :   5e:callq  0xffffffffe12aca3c
+    1.03 :   5e:call   0xffffffffe12aca3c
     0.00 :   63:xor    %eax,%eax
-    2.18 :   65:leaveq
-    2.82 :   66:retq
+    2.18 :   65:leave
+    2.82 :   66:ret

Cc: Arnaldo Carvalho de Melo <acme@redhat.com>
Cc: Sedat Dilek <sedat.dilek@gmail.com>
Link: http://lore.kernel.org/lkml/20220622181918.ykrs5rsnmx3og4sv@alap3.anarazel.de
Signed-off-by: Andres Freund <andres@anarazel.de>
Gbp-Pq: Topic bugfix/all
Gbp-Pq: Name tools-perf-fix-compilation-error-with-new-binutils.patch
tools/perf/Makefile.config
tools/perf/util/annotate.c