iovisor / bcc

BCC - Tools for BPF-based Linux IO analysis, networking, monitoring, and more
Apache License 2.0
20.59k stars 3.88k forks source link

libbpf tcptop: Fix "unrecognized bpf_ld_imm64 insn" on 4.19 #4987

Open bernhardkaindl opened 6 months ago

bernhardkaindl commented 6 months ago

Fix the BPF load error unrecognized bpf_ld_imm64 insn in tcptop on 4.19 by converting .rodata config variables to a map. (global data is not supported in 4.19)

tcptop can use CO-RE including on 4.19 when a detached vmlinux BTF file is provided. It can be generated from a DWARF vmlinux using pahole:

pahole -J;objcopy --only-section=.BTF vmlinux /boot/vmlinux-$(uname -r)

PS: GitHub CI fails on a few test cases (flaky) so I added a minor commits to make CI less flaky.