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-tools/biosnoop: Fix run error if not support fentry #5023

Closed cuibixuan1 closed 3 months ago

cuibixuan1 commented 5 months ago

Running biosnoop causes the following errors if not support fentry and btf: libbpf: prog 'blk_account_io_start': BPF program load failed: Invalid argument libbpf: prog 'blk_account_io_start': failed to load: -22 libbpf: failed to load object 'biosnoop_bpf' libbpf: failed to load BPF skeleton 'biosnoop_bpf': -22 failed to load BPF object: -22

yonghong-song commented 5 months ago

fentry is supported since 5.5. which kernel you are using? If possible, we should try to avoid adding supports for old kernels.

cuibixuan1 commented 5 months ago

fentry is supported since 5.5. which kernel you are using? If possible, we should try to avoid adding supports for old kernels.

In fact, we are on Android 13 and Android 14 platforms, with aarch64 architecture. The kernel versions mainly include Linux 5.10, Linux 5.15 and Linux 6.1. Android has not yet enabled -mfentry (for higher performance), and currently only supports btf and kprobe.

Thanks