Package: bpftool Version: 6.8.0+5.18.14-1 Severity: normal Dear Maintainer,I was trying to dump the jited version of a BPF program that was pinned in /sys/fs/bpf but I received a warning about libbpf that it wasn't supported.
Here is the content of the minimalist BPF program:
==============================
#include <linux/bpf.h>
#include <bpf/bpf_helpers.h>
SEC("socket")
int bpf_prog (struct __sk_buff *skb)
{
return 1;
}
==============================
Built with:
#> clang -target bpf -o basic.o -c basic.c
Inserted and pinned:
#(root)> bpftool prog load basic.o /sys/fs/bpf/bar
Checking that it is present in the loaded BPF programs:
#(root)> bpftool prog list
...
37: type 31 name bpf_prog tag cba989f8e5d0e900
loaded_at 2022-08-02T16:31:18+0200 uid 0
xlated 24B jited 29B memlock 4096B
Dump the BPF format:
#(root)> bpftool prog dump xlated id 37
0: (7b) *(u64 *)(r10 -8) = r1
1: (b7) r0 = 1
2: (95) exit
Attempt to dump the jitted format:
#(root)> bpftool prog dump jited pinned /sys/fs/bpf/foo
Error: No libbfd support
I suppose that the support for BPF must be add to libbfd in the binutils-dev
package by default.
Feel free to ask for more details if I was not clear in my report. -- System Information: Debian Release: bookworm/sid APT prefers unstable APT policy: (500, 'unstable') Architecture: amd64 (x86_64) Foreign Architectures: i386 Kernel: Linux 5.18.0-3-amd64 (SMP w/8 CPU threads; PREEMPT) Locale: LANG=en_US.UTF-8, LC_CTYPE=en_US.UTF-8 (charmap=UTF-8), LANGUAGE=en_US:\ en Shell: /bin/sh linked to /usr/bin/dash Init: systemd (via /run/systemd/system) LSM: AppArmor: enabled Versions of packages bpftool depends on: ii libc6 2.33-8 ii libcap2 1:2.44-1 ii libelf1 0.187-1 ii zlib1g 1:1.2.11.dfsg-4 bpftool recommends no packages. bpftool suggests no packages. -- no debconf information
Attachment:
OpenPGP_0x926F8BC41D699DBC.asc
Description: OpenPGP public key
Attachment:
OpenPGP_signature
Description: OpenPGP digital signature