public inbox for dwarves@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH v2 dwarves 0/2] Check DW_OP_[GNU_]entry_value for possible parameter matching
@ 2024-11-14 15:58 Alan Maguire
  2024-11-14 15:58 ` [PATCH v2 dwarves 1/2] dwarf_loader: " Alan Maguire
                   ` (2 more replies)
  0 siblings, 3 replies; 13+ messages in thread
From: Alan Maguire @ 2024-11-14 15:58 UTC (permalink / raw)
  To: acme
  Cc: yonghong.song, dwarves, ast, andrii, bpf, daniel, kernel-team,
	song, eddyz87, olsajiri, Alan Maguire

Currently, pahole relies on DWARF to find whether a particular func
has its parameter mismatched with standard or optimized away.
In both these cases, the func will not be put in BTF and this
will prevent fentry/fexit tracing for these functions.

The current parameter checking focuses on the first location/expression
to match intended parameter register. But in some cases, the first
location/expression does not have expected matching information,
but further location like DW_OP_[GNU_]entry_value can provide
information which matches the expected parameter register.

Patch 1 supports this; patch 2 adds locking around dwarf_getlocation*
as it is unsafe in a multithreaded environment.

Run ~4000 times without observing a segmentation fault (as compared
to without patch 2, where a segmentation fault is observed approximately
every 200 invokations).

Changes since v1:

- used Eduard's approach of using a __dwarf_getlocations()
  internal wrapper (Eduard, patch 1).
- renamed function to parameter__reg(); did not rename
  __dwarf_getlocations() since its functionality is based around
  retrieving DWARF location info rather than parameter register
  indices (Yonghong, patch 2)
- added locking around dwarf_getlocation*() usage in dwarf_loader
  to avoid segmentation faults reported by Eduard (Jiri, Arnaldo,
  patch 2)

Alan Maguire (1):
  dwarf_loader: use libdw__lock for dwarf_getlocation(s)

Eduard Zingerman (1):
  dwarf_loader: Check DW_OP_[GNU_]entry_value for possible parameter
    matching

 dwarf_loader.c | 121 +++++++++++++++++++++++++++++++++++++++----------
 1 file changed, 96 insertions(+), 25 deletions(-)

-- 
2.31.1


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

end of thread, other threads:[~2024-11-15 15:00 UTC | newest]

Thread overview: 13+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-11-14 15:58 [PATCH v2 dwarves 0/2] Check DW_OP_[GNU_]entry_value for possible parameter matching Alan Maguire
2024-11-14 15:58 ` [PATCH v2 dwarves 1/2] dwarf_loader: " Alan Maguire
2024-11-14 16:51   ` Yonghong Song
2024-11-14 16:59     ` Alan Maguire
2024-11-14 18:21     ` Eduard Zingerman
2024-11-14 20:04       ` Yonghong Song
2024-11-14 21:38         ` Eduard Zingerman
2024-11-15  8:47         ` Jiri Olsa
2024-11-14 15:58 ` [PATCH v2 dwarves 2/2] dwarf_loader: use libdw__lock for Alan Maguire
2024-11-14 18:01   ` Eduard Zingerman
2024-11-15  9:34 ` [PATCH v2 dwarves 0/2] Check DW_OP_[GNU_]entry_value for possible parameter matching Jiri Olsa
2024-11-15 14:52   ` Arnaldo Carvalho de Melo
2024-11-15 15:00     ` Jiri Olsa

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