BPF List
 help / color / mirror / Atom feed
* [RFC dwarves 0/5] pahole: support BTF inline encoding
@ 2025-10-24  7:33 Alan Maguire
  2025-10-24  7:33 ` [RFC dwarves 1/5] dwarf_loader: Add parameters list to inlined expansion Alan Maguire
                   ` (4 more replies)
  0 siblings, 5 replies; 11+ messages in thread
From: Alan Maguire @ 2025-10-24  7:33 UTC (permalink / raw)
  To: dwarves
  Cc: andrii, eddyz87, ast, daniel, martin.lau, acme, ttreyer,
	yonghong.song, song, john.fastabend, kpsingh, sdf, haoluo, jolsa,
	qmo, ihor.solodrai, david.faust, jose.marchesi, bpf, Alan Maguire

This series is the RFC companion to [1]; while it has some issues
(including segmentation faults which will be fixed in follups)
hopefully it illustrates the approach.

These patches were developed with help from prior work by
Eduard Zingerman on inline site decoding and Thierry Treyer
on inline encoding, but the scheme used here is somewhat simpler.
It relies on using standard BTF kinds (_LOC_PARAM for parameters
at inline sites, _LOC_PROTO for collections of paraeters at inline
sites, _LOCSEC for descriptions of inline sites; names, function
prototypes, location prototypes and relative address offsets).

Patches 1-3 focus on preparing the DWARF loader to collect
inline info.

Patch 4 does the BTF encoding, and patch 5 adds the inline option.

The target of encoding is either the .BTF section (if "inline"
is specified as btf_feature) or .BTF.extra (for the inline.extra
feature).

One challenge here is that we need to stash info about function
prototypes while walking DWARF CUs for later use in inline
encoding.  However, if the inlines are encoded in a separate
split BTF section (inline.extra) dedup that happens to the
main BTF will not renumber these type references.  As a result
we need to ask dedup to hand us back the old->new BTF id
mappings to fix things up.

Note that since RFC of the bpf-next series we will be changing
a lot of this, but it still gives a rough sense of how things
are done.

[1] https://lore.kernel.org/bpf/20251008173512.731801-1-alan.maguire@oracle.com/

Alan Maguire (3):
  dwarf_loader: Collect inline expansion location information
  btf_encoder: Support encoding of inline location information
  pahole: Support inline encoding with inline[.extra] BTF feature

Thierry Treyer (2):
  dwarf_loader: Add parameters list to inlined expansion
  dwarf_loader: Add name to inline expansion

 btf_encoder.c  | 396 +++++++++++++++++++++++++++++++++++++++++----
 dwarf_loader.c | 428 ++++++++++++++++++++++++++++++++++++-------------
 dwarves.c      |  26 +++
 dwarves.h      |  60 +++++++
 pahole.c       |  33 +++-
 5 files changed, 791 insertions(+), 152 deletions(-)

-- 
2.39.3


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

end of thread, other threads:[~2025-10-29 18:47 UTC | newest]

Thread overview: 11+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-10-24  7:33 [RFC dwarves 0/5] pahole: support BTF inline encoding Alan Maguire
2025-10-24  7:33 ` [RFC dwarves 1/5] dwarf_loader: Add parameters list to inlined expansion Alan Maguire
2025-10-24  7:33 ` [RFC dwarves 2/5] dwarf_loader: Add name to inline expansion Alan Maguire
2025-10-24  7:33 ` [RFC dwarves 3/5] dwarf_loader: Collect inline expansion location information Alan Maguire
2025-10-24 17:55   ` Eduard Zingerman
2025-10-29 17:40     ` Alan Maguire
2025-10-29 18:32       ` Eduard Zingerman
2025-10-29 18:46         ` Alan Maguire
2025-10-24  7:33 ` [RFC dwarves 4/5] btf_encoder: Support encoding of inline " Alan Maguire
2025-10-24 18:04   ` Eduard Zingerman
2025-10-24  7:33 ` [RFC dwarves 5/5] pahole: Support inline encoding with inline[.extra] BTF feature Alan Maguire

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