From: Nick Alcock <nick.alcock@oracle.com>
To: eugene.loh@oracle.com
Cc: dtrace@lists.linux.dev, dtrace-devel@oss.oracle.com
Subject: Re: [PATCH 2/3] Defer stripping out "__data_loc" until we know that is useful
Date: Sun, 14 Sep 2025 14:17:29 +0100 [thread overview]
Message-ID: <87jz21w4uu.fsf@esperi.org.uk> (raw)
In-Reply-To: <20250913155619.22299-2-eugene.loh@oracle.com> (eugene loh's message of "Sat, 13 Sep 2025 11:56:18 -0400")
On 13 Sep 2025, eugene loh uttered the following:
> From: Eugene Loh <eugene.loh@oracle.com>
>
> Signed-off-by: Eugene Loh <eugene.loh@oracle.com>
Reviewed-by: Nick Alcock <nick.alcock@oracle.com>
with the tiny caveat below.
> ---
> libdtrace/dt_provider_tp.c | 3 ++-
> 1 file changed, 2 insertions(+), 1 deletion(-)
>
> diff --git a/libdtrace/dt_provider_tp.c b/libdtrace/dt_provider_tp.c
> index 33821f2c7..a6f978e3f 100644
> --- a/libdtrace/dt_provider_tp.c
> +++ b/libdtrace/dt_provider_tp.c
> @@ -208,12 +208,13 @@ dt_tp_event_info(dtrace_hdl_t *dtp, FILE *f, int skip, tp_probe_t *tpp,
> p = buf;
> if (sscanf(buf, " field:%[^;]", p) <= 0)
> continue;
> - sscanf(p, "__data_loc %[^;]", p);
>
> /* We found a field: description - see if we should skip it. */
> if (argc < 0)
> goto skip;
>
> + sscanf(p, "__data_loc %[^;]", p);
> +
... why not defer the sscanf above it too? The manipulation of argc at
this point looks like this:
argc = -skip;
(in getline loop)
/* We found a field: description - see if we should skip it. */
if (argc < 0)
goto skip;
(at loop end)
skip:
argc++;
}
So if argc is < 0, it's going to *stay* like that until a given number
of getlines have happened. Doing more work than just skipping and
getlining is pointless. (This affects the next patch as much as this
one. More generally, it might be clearer to move skipping to a separate
getline loop entirely, above this one that also does all the other work.)
--
NULL && (void)
next prev parent reply other threads:[~2025-09-14 13:17 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-09-13 15:56 [PATCH 1/3] Clean up unused argsz eugene.loh
2025-09-13 15:56 ` [PATCH 2/3] Defer stripping out "__data_loc" until we know that is useful eugene.loh
2025-09-14 13:17 ` Nick Alcock [this message]
2025-09-15 4:50 ` Eugene Loh
2025-09-13 15:56 ` [PATCH v2 3/3] Add more robust mechanism to skip tracepoint common fields eugene.loh
2025-09-14 13:26 ` [DTrace-devel] " Nick Alcock
2025-09-15 4:56 ` Eugene Loh
2025-09-14 13:11 ` [DTrace-devel] [PATCH 1/3] Clean up unused argsz Nick Alcock
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=87jz21w4uu.fsf@esperi.org.uk \
--to=nick.alcock@oracle.com \
--cc=dtrace-devel@oss.oracle.com \
--cc=dtrace@lists.linux.dev \
--cc=eugene.loh@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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox