public inbox for dtrace@lists.linux.dev
 help / color / mirror / Atom feed
* [PATCH 0/6] usdt typed args, translators and arg remapping
@ 2024-10-18 19:58 Nick Alcock
  2024-10-18 19:58 ` [PATCH 1/6] error: add missing EDT_PRINT entry Nick Alcock
                   ` (5 more replies)
  0 siblings, 6 replies; 23+ messages in thread
From: Nick Alcock @ 2024-10-18 19:58 UTC (permalink / raw)
  To: dtrace, dtrace-devel

This series adds back support for the probe foo (...) : (...) syntax
in USDT provider definitions.  The dtprobed side is routine, pulling
in the DOF and adding it to a new set of dof_parser.h records fed
through to the DOF stash and ultimately to dt_pid.c and eventually
dt_prov_uprobe.c: the end result is that the DOF for a given probe's
remappings ends up in the dt_uprobe_t in more or less the same form
as it was in the DOF.

After that things get tricky, because we want to remap not only arg[N]
but also argN references (the single existing test for USDT arg
remapping verifies that this works), but the SDT machinery depends on
argN being unremapped!  So we do the remapping in dt_prov_uprobe.c and
tell the higher layers that no arg remapping is ever being performed,
then do the remapping in the trampoline by physically reshuffling
the arguments.  This seems to work without breaking SDT on all supported
architectures, and is surprisingly simple (at least, it surprised me:
multiple places where I thought I'd need hundreds of lines of complex
code turned out to need only three or four lines).

New tests are added to verify that USDT translators work when types
change, and that dtrace -vln produces the right output (all previous
tests for USDT -vln, translated or not, are currently disabled
because they all use wildcards: this new one doesn't).

We also fix a couple of tiny error-related bugs encountered in the
course of development, one in usdt, one related to the print action.

Nick Alcock (6):
  error: add missing EDT_PRINT entry
  usdt: get arg types and xlations into DTrace from the DOF
  dtprobed: stop skipping zero-tracepoint probes in dof_stash.c
  cg: add argument remapping in the trampoline
  usdt: typed args and arg remapping
  usdt: fix create_underlying error path

 dtprobed/dof_stash.c                          |  20 +--
 dtprobed/dtprobed.c                           |  12 +-
 include/dtrace/pid.h                          |   9 +
 libcommon/dof_parser.c                        | 167 ++++++++++++++----
 libcommon/dof_parser.h                        |  80 ++++++++-
 libdtrace/dt_cg.c                             |  35 +++-
 libdtrace/dt_cg.h                             |   1 +
 libdtrace/dt_error.c                          |   3 +-
 libdtrace/dt_pid.c                            |  71 ++++++++
 libdtrace/dt_prov_uprobe.c                    | 165 ++++++++++++++++-
 test/triggers/usdt-tst-argmap-prov.d          |   3 +-
 test/triggers/usdt-tst-argmap.c               |   3 +-
 .../dtrace-util/tst.ListProbesArgsUSDT.r      |  34 ++++
 .../dtrace-util/tst.ListProbesArgsUSDT.r.p    |   2 +
 .../dtrace-util/tst.ListProbesArgsUSDT.sh     |  83 +++++++++
 test/unittest/usdt/tst.argmap-typed.d         |  40 +++++
 test/unittest/usdt/tst.argmap.d               |   3 +-
 17 files changed, 660 insertions(+), 71 deletions(-)
 create mode 100644 test/unittest/dtrace-util/tst.ListProbesArgsUSDT.r
 create mode 100755 test/unittest/dtrace-util/tst.ListProbesArgsUSDT.r.p
 create mode 100755 test/unittest/dtrace-util/tst.ListProbesArgsUSDT.sh
 create mode 100644 test/unittest/usdt/tst.argmap-typed.d


base-commit: 8a1264bf0e818c8624be250eb5174714b62ed93c
-- 
2.46.0.278.g36e3a12567


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

end of thread, other threads:[~2024-10-29 14:52 UTC | newest]

Thread overview: 23+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-10-18 19:58 [PATCH 0/6] usdt typed args, translators and arg remapping Nick Alcock
2024-10-18 19:58 ` [PATCH 1/6] error: add missing EDT_PRINT entry Nick Alcock
2024-10-21  9:10   ` Alan Maguire
2024-10-22 14:40   ` Kris Van Hees
2024-10-18 19:58 ` [PATCH 2/6] usdt: get arg types and xlations into DTrace from the DOF Nick Alcock
2024-10-22 17:03   ` Kris Van Hees
2024-10-18 19:58 ` [PATCH 3/6] dtprobed: stop skipping zero-tracepoint probes in dof_stash.c Nick Alcock
2024-10-22 17:12   ` Kris Van Hees
2024-10-24 14:12     ` Nick Alcock
2024-10-18 19:58 ` [PATCH 4/6] cg: add argument remapping in the trampoline Nick Alcock
2024-10-22 17:43   ` Kris Van Hees
2024-10-25 15:56     ` Nick Alcock
2024-10-25 19:15       ` Kris Van Hees
2024-10-28 21:11         ` Nick Alcock
2024-10-28 21:20           ` Kris Van Hees
2024-10-29 13:09         ` Nick Alcock
2024-10-29 14:51           ` Kris Van Hees
2024-10-18 19:58 ` [PATCH 5/6] usdt: typed args and arg remapping Nick Alcock
2024-10-22 18:40   ` Kris Van Hees
2024-10-28 12:52     ` Nick Alcock
2024-10-28 16:00       ` Kris Van Hees
2024-10-18 19:58 ` [PATCH 6/6] usdt: fix create_underlying error path Nick Alcock
2024-10-22 18:46   ` Kris Van Hees

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