mirror of
https://git.proxmox.com/git/mirror_ubuntu-kernels.git
synced 2025-11-21 13:24:00 +00:00
If 'struct rq' isn't defined in lock_contention.bpf.c then the type for
the 'runqueue' variable ends up being a forward declaration
(BTF_KIND_FWD) while the kernel has it defined (BTF_KIND_STRUCT).
This makes libbpf decide it has incompatible types and then fails to
load the BPF skeleton:
# perf lock con -ab sleep 1
libbpf: extern (var ksym) 'runqueues': incompatible types, expected [95] fwd rq, but kernel has [55509] struct rq
libbpf: failed to load object 'lock_contention_bpf'
libbpf: failed to load BPF skeleton 'lock_contention_bpf': -22
Failed to load lock-contention BPF skeleton
lock contention BPF setup failed
#
Add it as an empty struct to satisfy that type verification:
# perf lock con -ab sleep 1
contended total wait max wait avg wait type caller
2 50.64 us 25.38 us 25.32 us spinlock tick_do_update_jiffies64+0x25
1 26.18 us 26.18 us 26.18 us spinlock tick_do_update_jiffies64+0x25
#
Committer notes:
Extracted from a larger patch as Namhyung had already fixed the other
issues in
|
||
|---|---|---|
| .. | ||
| .gitignore | ||
| bperf_cgroup.bpf.c | ||
| bperf_follower.bpf.c | ||
| bperf_leader.bpf.c | ||
| bperf_u.h | ||
| bpf_prog_profiler.bpf.c | ||
| func_latency.bpf.c | ||
| kwork_trace.bpf.c | ||
| lock_contention.bpf.c | ||
| lock_data.h | ||
| off_cpu.bpf.c | ||
| sample_filter.bpf.c | ||
| sample-filter.h | ||
| vmlinux.h | ||