public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* [RFC PATCH 0/2] Add btf__permute API
@ 2025-11-14  9:02 Donglin Peng
  2025-11-14  9:02 ` [RFC PATCH 1/2] libbpf: Add BTF permutation support for type reordering Donglin Peng
  2025-11-14  9:02 ` [RFC PATCH 2/2] selftests/bpf: Add test cases for btf__permute functionality Donglin Peng
  0 siblings, 2 replies; 7+ messages in thread
From: Donglin Peng @ 2025-11-14  9:02 UTC (permalink / raw)
  To: ast; +Cc: eddyz87, andrii.nakryiko, zhangxiaoqin, linux-kernel, bpf,
	Donglin Peng

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


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

end of thread, other threads:[~2025-11-14 10:38 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-11-14  9:02 [RFC PATCH 0/2] Add btf__permute API Donglin Peng
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

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