Skip to content

btf_encoder: do not encode functions consuming packed structs on stack

Alexis Lothoré (eBPF Foundation) bpf dwarves 3 versions – In review

Get series with b4
b4 am [email protected] change-id 20250617-btf_skip_structs_on_stack-006adf457d50

Versions newest first

  1. v3 Latest3 patches 12 repliesIn review
  2. v23 patches 8 repliesSuperseded
  3. v1 RFC1 patch 5 repliesSuperseded

Changes in v3 from the cover letter

- add uncertain param loc logic to saved_functions_combine to
deduplicate functions
- remove unneeded call to class__infer_holes
- bring a userspace binary instead of a OoT kernel module for testing
- consolidate paths used in the new test
- Link to v2: https://lore.kernel.org/r/[email protected]

Patches in v3 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/3btf_encoder: skip functions consuming packed structs passed by value on stackbtf_encoder.c dwarves.h+51 -34 replies
2/3tests: add some tests validating skipped functions due to uncertain arg locationtests/bin/Makefile tests/bin/test_bin.c tests/btf_functions.sh+167 -08 replies
3/3gitignore: ignore all the test kmod build-related files.gitignore+3 -00 replies

Reviews trailers per patch

1 of 3 patches has a Reviewed-by or Acked-by.

PatchIhor SolodraiJiri Olsa
1/3A-b A-b
2/3
3/3

Trailers given in replies are filled; those carried in the patches from earlier versions are outlined with dashes.

Read the v3 thread

Cover letter [PATCH v3 0/3] btf_encoder: do not encode functions consuming packed structs on stack

Hello,
this is the v3 of the packed-struct-passed-on-stack series. This revision follows on Ihor's comments on v2.

---
Changes in v3:
- add uncertain param loc logic to saved_functions_combine to
deduplicate functions
- remove unneeded call to class__infer_holes
- bring a userspace binary instead of a OoT kernel module for testing
- consolidate paths used in the new test
- Link to v2: https://lore.kernel.org/r/[email protected]

Changes in v2:
- infer structs attributes
- skip function encoded if some consumed struct (passed on stack) is
marked as packed
- add some tests in btf_functions.sh
- drop RFC prefix
- Link to v1: https://lore.kernel.org/r/[email protected]

---
Alexis Lothoré (eBPF Foundation) (3):
btf_encoder: skip functions consuming packed structs passed by value on stack
tests: add some tests validating skipped functions due to uncertain arg location
gitignore: ignore all the test kmod build-related files

 .gitignore             |  3 ++
 btf_encoder.c          | 53 +++++++++++++++++++++++++++--
 dwarves.h              |  1 +
 tests/bin/Makefile     | 10 ++++++
 tests/bin/test_bin.c   | 66 ++++++++++++++++++++++++++++++++++++
 tests/btf_functions.sh | 91 ++++++++++++++++++++++++++++++++++++++++++++++++++
 6 files changed, 221 insertions(+), 3 deletions(-)

---
base-commit: 042d73962d35fdd1466e056f1ea14590b1cdbb9b
change-id: 20250617-btf_skip_structs_on_stack-006adf457d50

Best regards,

Signature · 3 lines
Alexis Lothoré, Bootlin
Embedded Linux and Kernel engineering
https://bootlin.com