BPF List
 help / color / mirror / Atom feed
* Better error message for kernels not compiled with BTF
@ 2024-01-23  0:18 Ian Rogers
  2024-01-23  9:40 ` Alan Maguire
  0 siblings, 1 reply; 2+ messages in thread
From: Ian Rogers @ 2024-01-23  0:18 UTC (permalink / raw)
  To: bpf; +Cc: linux-perf-users

Hi,

if a kernel is compiled with CONFIG_DEBUG_INFO_BTF disabled then the
libbpf fails on perf lock contention with:
```
libbpf: failed to find valid kernel BTF
libbpf: Error loading vmlinux BTF: -3
libbpf: failed to load object 'lock_contention_bpf'
libbpf: failed to load BPF skeleton 'lock_contention_bpf': -3
Failed to load lock-contention BPF skeleton
lock contention BPF setup failed
```
The same error message is seen with BCC's libbpf-tools. I saw these
messages on default Rapberry Pi OS that is derived from Debian (more
context in https://bugzilla.kernel.org/show_bug.cgi?id=218401).

Given that distributions are shipping perf and libbpf-tools that
assume BTF is enabled, should CONFIG_DEBUG_INFO_BTF be enabled by
default in the kernel?

Perhaps:
```
libbpf: Error loading vmlinux BTF: -3
```
Would be better as (especially if the user is root):
```
libbpf: Error loading vmlinux BTF: -3 (was the kernel compiled with
CONFIG_DEBUG_INFO_BTF?)
```

Thanks,
Ian

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2024-01-23  9:41 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-01-23  0:18 Better error message for kernels not compiled with BTF Ian Rogers
2024-01-23  9:40 ` Alan Maguire

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox