]> git.ipfire.org Git - thirdparty/kernel/linux.git/commit
libbpf: Add debug messaging in dedup equivalence/identity matching
authorAlan Maguire <alan.maguire@oracle.com>
Wed, 3 Dec 2025 19:15:07 +0000 (19:15 +0000)
committerAndrii Nakryiko <andrii@kernel.org>
Fri, 5 Dec 2025 23:55:54 +0000 (15:55 -0800)
commit81f88f6ab674973d361b6d176aa4d3ebd32253ab
tree390a497ffb3f2e7820a7579da7ebc0c4e3b25785
parent835a50753579aa8368a08fca307e638723207768
libbpf: Add debug messaging in dedup equivalence/identity matching

We have seen a number of issues like [1]; failures to deduplicate
key kernel data structures like task_struct.  These are often hard
to debug from pahole even with verbose output, especially when
identity/equivalence checks fail deep in a nested struct comparison.

Here we add debug messages of the form

libbpf: STRUCT 'task_struct' size=2560 vlen=194 cand_id[54222] canon_id[102820] shallow-equal but not equiv for field#23 'sched_class': 0

These will be emitted during dedup from pahole when --verbose/-V
is specified.  This greatly helps identify exactly where dedup
failures are experienced.

[1] https://lore.kernel.org/bpf/b8e8b560-bce5-414b-846d-0da6d22a9983@oracle.com/

Changes since v1:

- updated debug messages to refer to shallow-equal, added ids (Andrii)

Signed-off-by: Alan Maguire <alan.maguire@oracle.com>
Signed-off-by: Andrii Nakryiko <andrii@kernel.org>
Link: https://lore.kernel.org/bpf/20251203191507.55565-1-alan.maguire@oracle.com
tools/lib/bpf/btf.c