diff options
| author | Alexei Starovoitov <ast@kernel.org> | 2026-09-30 09:04:26 +0000 |
|---|---|---|
| committer | Alexei Starovoitov <ast@kernel.org> | 2026-09-30 09:04:26 +0000 |
| commit | c20c470eb620b86acb1e8218b262760b2c0d7401 (patch) | |
| tree | 6f1896016bb995a8e73300ab127d6b3c311ad50f /include/linux/timerqueue.h | |
| parent | cc6010e6e5cbe1f743d3011991041f227d976a5e (diff) | |
| parent | 2c964f6c5d8eb4319ec9ba3b79f99a8c77bdb564 (diff) | |
| download | linux-next-c20c470eb620b86acb1e8218b262760b2c0d7401.tar.gz linux-next-c20c470eb620b86acb1e8218b262760b2c0d7401.zip | |
Merge branch 'libbpf-render-decl_tags-in-btf_dump'
Ihor Solodrai says:
====================
libbpf: Render decl_tags in btf_dump
BTF supports arbitrary __attribute__ encoding via decl tags and type
tags [1]. However btf_dump facility only outputs the attributes
encoded in BTF as type tags, which was implemented in commit
2019c58318b8 ("libbpf: Check the kflag of type tags in btf_dump").
BTF_KIND_DECL_TAG has been left out of btf_dump entirely, independent
of the kflag value. An attribute a BTF producer encoded is silently
dropped from the C output.
Implement decl_tag support in btf_dump. The btf_dump limits rendered
BTF types to records, record members and typedefs. Other types,
particularly functions, are deliberately skipped. Therefore decl_tag
rendering works only for the same subset of target types.
To be efficient, decl_tag dump support requires a reverse index from
the target type id to the list of tags pointing at it.
With decl_tag dump support, provided a validly constructed BTF, it is
now possible to obtain C-syntax output like the following example:
struct foo {
int a __attribute__((bar));
int b: 3 __attribute__((bar));
} __attribute__((bar));
typedef struct { ... } __attribute__((bar)) foo_t __attribute__((baz));
This closes a generic gap in btf_dump, which silently dropped every
decl tag it was given. The in-tree consumer is:
bpftool btf dump ... format c
A BPF object now keeps its member tags, such as the "contains:" tags.
[1] https://lore.kernel.org/bpf/20250130201239.1429648-1-ihor.solodrai@linux.dev/
---
v1->v2:
* index all decl tags in btf_dump (Andrii)
* roll the decl tag count back on resize errors (Alexei, sashiko)
* new patch #3 with the ASSERT_TEXT_EQ() text-comparison helper (Eduard)
* fold the incremental subtest into test_btf_dump_incremental (Eduard)
* cut test_btf_attrs down to bare API calls plus VALIDATE_RAW_BTF,
with no BTF_*_ENC macros (sashiko, Eduard)
v1: https://lore.kernel.org/bpf/20260917012037.1396254-1-ihor.solodrai@linux.dev/
---
====================
Link: https://patch.msgid.link/20260929234608.48503-1-ihor.solodrai@linux.dev
Signed-off-by: Alexei Starovoitov <ast@kernel.org>
Diffstat (limited to 'include/linux/timerqueue.h')
0 files changed, 0 insertions, 0 deletions
