From: Kris Van Hees <kris.van.hees@oracle.com>
To: eugene.loh@oracle.com
Cc: dtrace@lists.linux.dev, dtrace-devel@oss.oracle.com
Subject: Re: [PATCH 1/2] fbt: Populate just once
Date: Thu, 15 Jan 2026 16:35:41 -0500 [thread overview]
Message-ID: <aWldrTXBAla0jjKO@oracle.com> (raw)
In-Reply-To: <20260113214205.9159-1-eugene.loh@oracle.com>
On Tue, Jan 13, 2026 at 04:42:04PM -0500, eugene.loh@oracle.com wrote:
> From: Eugene Loh <eugene.loh@oracle.com>
>
> In commit 0b7c5a632 ("fbt, rawfbt: consolidate code to avoid duplication"),
> the populate() functions for fbt and rawfbt were combined, populating both
> providers, but the function was still called twice. That is, dt_open.c
> tries to insert each provider twice.
Where do you see evidence that the populate function is being called twice?
Only the providers listed in the static initial list have populate() called,
and while &dt_fbt is in that list, &dt_rawfbt is not. Also, adding debugging
output to populate() in dt_prov_fbt.c (or enabling DTRACE_DEBUG) shows that
it is only called once.
> One solution would be to have a different populate() function for each
> provider.
>
> Here, we employ another solution: in dt_provider_create(), check to see
> if a specified provider has already been inserted.
This change is not needed but it is also harmless and can avoid future problems
so I would not object having this as a safety net.
> This also requires a corresponding change in dt_provider_lookup(), so
> that it will work even if no providers have yet been inserted.
>
> Also, fix a minor comment in the fbt provider.
Thanks for this fix.
>
> Signed-off-by: Eugene Loh <eugene.loh@oracle.com>
> ---
> libdtrace/dt_prov_fbt.c | 2 +-
> libdtrace/dt_provider.c | 6 ++++++
> 2 files changed, 7 insertions(+), 1 deletion(-)
>
> diff --git a/libdtrace/dt_prov_fbt.c b/libdtrace/dt_prov_fbt.c
> index bbe44a842..3feac56ea 100644
> --- a/libdtrace/dt_prov_fbt.c
> +++ b/libdtrace/dt_prov_fbt.c
> @@ -228,7 +228,7 @@ static int provide(dtrace_hdl_t *dtp, const dtrace_probedesc_t *pdp)
> if (!dt_symbol_traceable(sym))
> continue;
>
> - /* Function name cannot be synthetic and must match. */
> + /* Function name cannot be synthetic (unless rawfbt) and must match. */
> fun = dt_symbol_name(sym);
> if ((!rawfbt && strchr(fun, '.')) || !dt_gmatch(fun, pdp->fun))
> continue;
> diff --git a/libdtrace/dt_provider.c b/libdtrace/dt_provider.c
> index 848fdc132..9d75225fa 100644
> --- a/libdtrace/dt_provider.c
> +++ b/libdtrace/dt_provider.c
> @@ -114,6 +114,8 @@ dt_provider_lookup(dtrace_hdl_t *dtp, const char *name)
> return NULL;
>
> strcpy(tmpl.desc.dtvd_name, name);
> + if (dtp->dt_provs == NULL)
> + return NULL;
> return dt_htab_lookup(dtp->dt_provs, &tmpl);
> }
>
> @@ -124,6 +126,10 @@ dt_provider_create(dtrace_hdl_t *dtp, const char *name,
> {
> dt_provider_t *pvp;
>
> + pvp = dt_provider_lookup(dtp, name);
> + if (pvp)
> + return pvp;
> +
> if ((pvp = dt_zalloc(dtp, sizeof(dt_provider_t))) == NULL)
> goto nomem;
>
> --
> 2.47.3
>
next prev parent reply other threads:[~2026-01-15 21:35 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-01-13 21:42 [PATCH 1/2] fbt: Populate just once eugene.loh
2026-01-13 21:42 ` [PATCH 2/2] rawfbt: prvname is not properly set eugene.loh
2026-01-15 22:18 ` Kris Van Hees
2026-01-16 5:18 ` Eugene Loh
2026-01-16 22:02 ` Kris Van Hees
2026-01-16 22:43 ` Eugene Loh
2026-01-26 21:11 ` Kris Van Hees
2026-01-15 21:35 ` Kris Van Hees [this message]
2026-01-15 22:07 ` [PATCH 1/2] fbt: Populate just once Eugene Loh
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=aWldrTXBAla0jjKO@oracle.com \
--to=kris.van.hees@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