Skip to content

RFC Add btf__permute API

Donglin Peng bpf lkml 1 version In review

Get series with b4
b4 am [email protected]

Versions newest first

  1. v1 RFC Latest2 patches 2 repliesIn review

Patches in v1 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/2libbpf: Add BTF permutation support for type reorderingtools/lib/bpf/btf.c tools/lib/bpf/btf.h tools/lib/bpf/libbpf.map+230 -01 reply
2/2selftests/bpf: Add test cases for btf__permute functionalitytools/testing/selftests/bpf/prog_tests/btf_permute.c+626 -01 reply

Reviews trailers per patch

No Reviewed-by, Acked-by or Tested-by trailers for v1 yet.

Read the v1 thread

Cover letter [RFC PATCH 0/2] Add btf__permute API

From: Donglin Peng <[email protected]>

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/[email protected]/

Key difference: this implementation adopts the ID mapping approach suggested by Andrii Nakryiko.

Link to v4:
https://lore.kernel.org/all/[email protected]/

Link to v3:
https://lore.kernel.org/all/[email protected]/

Link to v2:
https://lore.kernel.org/all/[email protected]/

Link to v1:
https://lore.kernel.org/all/[email protected]/

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
Signature · 1 line
2.34.1