From: Kris Van Hees <kris.van.hees@oracle.com>
To: Nick Alcock <nick.alcock@oracle.com>
Cc: dtrace@lists.linux.dev, dtrace-devel@oss.oracle.com
Subject: Re: [PATCH v3 0/6] usdt typed args, translators and arg remapping
Date: Thu, 31 Oct 2024 14:56:31 -0400 [thread overview]
Message-ID: <ZyPS35JNqCM9msZ6@oracle.com> (raw)
In-Reply-To: <20241030120850.256884-1-nick.alcock@oracle.com>
Can you please rebase on github's devel? Eugene's USDT work is on there and
that impacts patches 5/6 and 6/6.
Also, 1/6 is already on devel.
Please also searc hfor any occurences of /remap/ and fix those to use the
more consistent "map" and "mapping" language.
On Wed, Oct 30, 2024 at 12:08:44PM +0000, Nick Alcock wrote:
> 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 while reshuffling
> things into dt_argdesc_t's, 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,
> when arg counts change, and when there are no args at all, 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.
>
> Changes since v2:
> Populate dt_argdesc_t's in USDT probe discovery rather than in
> probe_info.
>
> Changes since v1:
> Adapted to review comments (all comments but the stuff around
> trampolines and arg mapping, which I don't understand well
> enough to implement); in particular track xlated args and
> mappings together, and move from a flags word in the
> dof_parser struct's DIT_PROBE record to an arg count
>
> 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 mapping in the trampoline
> usdt: typed args and arg mapping
> usdt: fix create_underlying error path
>
> dtprobed/dof_stash.c | 21 +--
> dtprobed/dtprobed.c | 10 +-
> include/dtrace/pid.h | 7 +
> libcommon/dof_parser.c | 150 ++++++++++++----
> libcommon/dof_parser.h | 64 ++++++-
> libdtrace/dt_cg.c | 36 +++-
> libdtrace/dt_cg.h | 1 +
> libdtrace/dt_error.c | 3 +-
> libdtrace/dt_pid.c | 60 +++++++
> libdtrace/dt_prov_uprobe.c | 168 +++++++++++++++++-
> test/triggers/usdt-tst-argmap-prov.d | 5 +-
> test/triggers/usdt-tst-argmap.c | 5 +-
> .../dtrace-util/tst.ListProbesArgsUSDT.r | 34 ++++
> .../dtrace-util/tst.ListProbesArgsUSDT.r.p | 2 +
> .../dtrace-util/tst.ListProbesArgsUSDT.sh | 83 +++++++++
> test/unittest/usdt/err.argmap-null.d | 40 +++++
> test/unittest/usdt/err.argmap-null.r | 2 +
> test/unittest/usdt/err.argmap-null.r.p | 2 +
> test/unittest/usdt/tst.argmap-null.d | 32 ++++
> test/unittest/usdt/tst.argmap-typed-partial.d | 49 +++++
> test/unittest/usdt/tst.argmap-typed.d | 48 +++++
> test/unittest/usdt/tst.argmap.d | 3 +-
> test/utils/showUSDT.c | 5 +-
> 23 files changed, 759 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/err.argmap-null.d
> create mode 100644 test/unittest/usdt/err.argmap-null.r
> create mode 100755 test/unittest/usdt/err.argmap-null.r.p
> create mode 100644 test/unittest/usdt/tst.argmap-null.d
> create mode 100644 test/unittest/usdt/tst.argmap-typed-partial.d
> create mode 100644 test/unittest/usdt/tst.argmap-typed.d
>
>
> base-commit: 8a1264bf0e818c8624be250eb5174714b62ed93c
> --
> 2.46.0.278.g36e3a12567
>
prev parent reply other threads:[~2024-10-31 18:56 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-10-30 12:08 [PATCH v3 0/6] usdt typed args, translators and arg remapping Nick Alcock
2024-10-30 12:08 ` [PATCH REVIEWED v3 1/6] error: add missing EDT_PRINT entry Nick Alcock
2024-10-30 12:08 ` [PATCH v3 2/6] usdt: get arg types and xlations into DTrace from the DOF Nick Alcock
2024-10-30 12:08 ` [PATCH REVIEWED v3 3/6] dtprobed: stop skipping zero-tracepoint probes in dof_stash.c Nick Alcock
2024-10-30 12:08 ` [PATCH v3 4/6] cg: add argument mapping in the trampoline Nick Alcock
2024-10-30 12:08 ` [PATCH v3 5/6] usdt: typed args and arg mapping Nick Alcock
2024-10-30 12:08 ` [PATCH REVIEWED v3 6/6] usdt: fix create_underlying error path Nick Alcock
2024-10-31 18:56 ` Kris Van Hees [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=ZyPS35JNqCM9msZ6@oracle.com \
--to=kris.van.hees@oracle.com \
--cc=dtrace-devel@oss.oracle.com \
--cc=dtrace@lists.linux.dev \
--cc=nick.alcock@oracle.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.