From: Donglin Peng <dolinux.peng@gmail.com>
To: ast@kernel.org
Cc: eddyz87@gmail.com, andrii.nakryiko@gmail.com,
zhangxiaoqin@xiaomi.com, linux-kernel@vger.kernel.org,
bpf@vger.kernel.org, Donglin Peng <pengdonglin@xiaomi.com>
Subject: [RFC PATCH 0/2] Add btf__permute API
Date: Fri, 14 Nov 2025 17:02:29 +0800 [thread overview]
Message-ID: <20251114090231.2786984-1-dolinux.peng@gmail.com> (raw)
From: Donglin Peng <pengdonglin@xiaomi.com>
This patch adds btf__permute() function that reorganizes BTF types according
to a provided ID mapping array, updating all internal type references to
maintain consistency after permutation.
The API enables custom BTF type layouts for specialized use cases such as
BTF sorting optimizations.
This series is extracted from the previous patch set:
https://lore.kernel.org/all/20251106131956.1222864-1-dolinux.peng@gmail.com/
Key difference: this implementation adopts the ID mapping approach
suggested by Andrii Nakryiko.
Link to v4:
https://lore.kernel.org/all/20251104134033.344807-1-dolinux.peng@gmail.com/
Link to v3:
https://lore.kernel.org/all/20251027135423.3098490-1-dolinux.peng@gmail.com/
Link to v2:
https://lore.kernel.org/all/20251020093941.548058-1-dolinux.peng@gmail.com/
Link to v1:
https://lore.kernel.org/all/20251013131537.1927035-1-dolinux.peng@gmail.com/
Donglin Peng (2):
libbpf: Add BTF permutation support for type reordering
selftests/bpf: Add test cases for btf__permute functionality
tools/lib/bpf/btf.c | 186 ++++++
tools/lib/bpf/btf.h | 43 ++
tools/lib/bpf/libbpf.map | 1 +
.../selftests/bpf/prog_tests/btf_permute.c | 626 ++++++++++++++++++
4 files changed, 856 insertions(+)
create mode 100644 tools/testing/selftests/bpf/prog_tests/btf_permute.c
--
2.34.1
next reply other threads:[~2025-11-14 9:03 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-11-14 9:02 Donglin Peng [this message]
2025-11-14 9:02 ` [RFC PATCH 1/2] libbpf: Add BTF permutation support for type reordering Donglin Peng
2025-11-14 9:47 ` bot+bpf-ci
2025-11-14 10:38 ` Donglin Peng
2025-11-14 9:02 ` [RFC PATCH 2/2] selftests/bpf: Add test cases for btf__permute functionality Donglin Peng
2025-11-14 9:39 ` bot+bpf-ci
2025-11-14 9:44 ` Donglin Peng
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20251114090231.2786984-1-dolinux.peng@gmail.com \
--to=dolinux.peng@gmail.com \
--cc=andrii.nakryiko@gmail.com \
--cc=ast@kernel.org \
--cc=bpf@vger.kernel.org \
--cc=eddyz87@gmail.com \
--cc=linux-kernel@vger.kernel.org \
--cc=pengdonglin@xiaomi.com \
--cc=zhangxiaoqin@xiaomi.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox