Re: [perf-tools] Build-error in tools/perf/util/annotate.c with LLVM-14

From: Andres Freund
Date: Sun Jul 03 2022 - 12:51:25 EST


Hi,

On 2022-07-03 13:54:41 +0200, Sedat Dilek wrote:
> Andres, you have some test-cases how you verified the built perf is OK?

I ran an intentionally expensive workload, monitored it with bpftrace, then
took a perf profile. Then annotated the bpf "function" and verified it looked
the same before / after, using a perf built in a container (and thus
compiling).


Similar with bpftool, I dumped a jited program with a bpftool built with /
without the patches (inside the container using nsenter for the version
without the patches, so I could build it, using nsenter -t $pid -m -p) and
compared both the json and non-json output before / after.

V=4; nsenter -t 847325 -m -p /usr/src/linux/tools/bpf/bpftool/bpftool -j -d prog dump jited id 22 > /tmp/22.jit.json.$V; nsenter -t 847325 -m -p /usr/src/linux/tools/bpf/bpftool/bpftool -d prog dump jited id 22 > /tmp/22.jit.txt.$V

and then diffed the results.


bpf_jit_disasm was harder, because bpf_jit_enable = 2 is broken currently. So
I gathered output in a VM from an older kernel, and used bpf_jit_disasm -f ...
before / after the patches.

Greetings,

Andres Freund