Skip to content

RFC dwarves: improvements/fixes to BTF function skip logic

Alan Maguire bpf 1 version In review

Get series with b4
b4 am [email protected]

Versions newest first

  1. v1 RFC Latest3 patches 2 repliesIn review

Patches in v1 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/3dwarf_loader: fix detection of struct parametersdwarf_loader.c+4 -60 replies
2/3dwarf_loader: fix parameter location retrieval for location listsdwarf_loader.c+12 -20 replies
3/3dwarf_loader: only mark parameter as using an unexpected register when it doesdwarf_loader.c+2 -40 replies

Reviews trailers per patch

None of the 3 patches has a Reviewed-by or Acked-by.

PatchJiri Olsa
SeriesT-b
1/3
2/3
3/3

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

Read the v1 thread

Cover letter [RFC dwarves 0/3] dwarves: improvements/fixes to BTF function skip logic

As discussed in [1], there are a few issues with how we determine whether to skip functions for BTF encoding:

- when detecting unexpected registers, functions which have struct parameters need to be skipped as they can use multiple registers to pass the struct, and as a result later parameters use unexpected registers. However, struct detection does not always work; it needs to be fixed for const struct parameters and cases where a parameter references the original parameter (which has the type info) via abstract origin (patch 1)
- when looking for unexpected registers, location lists are not supported. Fix that by using dwarf_getlocations() (patch 2).
- when marking parameters as using unexpected registers, we should stick to the case where we expect register x and register y is used; other cases such as optimized-out parameters are no guarantee that we were not _passed_ the correct parameters (patch 3).

This series can be applied on top of the dwarves "next" branch, as a follow-on to [2]

[1] https://lore.kernel.org/bpf/20230220190335.bk6jzayfqivsh7rv@macbook-pro-6.dhcp.thefacebook.com/
[2] https://lore.kernel.org/bpf/[email protected]/

Alan Maguire (3):
dwarf_loader: fix detection of struct parameters
dwarf_loader: fix parameter location retrieval for location lists
dwarf_loader: only mark parameter as using an unexpected register when
it does

 dwarf_loader.c | 30 ++++++++++++++++++------------
 1 file changed, 18 insertions(+), 12 deletions(-)
Signature · 1 line
2.31.1