All of lore.kernel.org
 help / color / mirror / Atom feed
From: Elena Zannoni <elena.zannoni@oracle.com>
To: Kris Van Hees <kris.van.hees@oracle.com>,
	dtrace@lists.linux.dev, dtrace-devel@oss.oracle.com
Subject: Re: [PATCH] provider: only call discover for the provider implementations
Date: Fri, 28 Aug 2026 14:50:30 -0600	[thread overview]
Message-ID: <0d314b71-d474-408e-a56c-7df0e82ee8a3@oracle.com> (raw)
In-Reply-To: <15cd034ae8698f3fefbc8259c3ce031e@oracle.com>


Reviewed-by: Elena Zannoni <elena.zannoni@oracle.com>

On 8/28/26 12:48 PM, Kris Van Hees wrote:

> Since the discover() functionality is provided by the implementation
> of a provider type rather than being specific to a provider, we only
> need to loop over dt_providers[].  The discover hooks themselves should
> take care of any newly discovered probes.
> 
> Suggested-by: Eugene Loh <eugene.loh@oracle.com>
> Signed-off-by: Kris Van Hees <kris.van.hees@oracle.com>
> ---
>  libdtrace/dt_provider.c | 9 +++++----
>  1 file changed, 5 insertions(+), 4 deletions(-)
> 
> diff --git a/libdtrace/dt_provider.c b/libdtrace/dt_provider.c
> index e073e1f2..818390d2 100644
> --- a/libdtrace/dt_provider.c
> +++ b/libdtrace/dt_provider.c
> @@ -186,12 +186,13 @@ int
>  dt_provider_discover(dtrace_hdl_t *dtp)
>  {
>  	int		prid = dtp->dt_probe_id;
> -	dt_htab_next_t	*it = NULL;
> -	dt_provider_t	*pvp;
> +	int		i;
>  
>  	/* Discover new probes. */
> -	while ((pvp = dt_htab_next(dtp->dt_provs, &it)) != NULL) {
> -		if (pvp->impl->discover && pvp->impl->discover(dtp) < 0)
> +	for (i = 0; dt_providers[i]; i++) {
> +		const dt_provimpl_t	*pvops = dt_providers[i];
> +
> +		if (pvops->discover && pvops->discover(dtp) < 0)
>  			return -1;        /* errno is already set */
>  	}
>  
> -- 
> 2.52.0
> 
> 


      reply	other threads:[~2026-08-28 20:50 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-08-28 18:48 [PATCH] provider: only call discover for the provider implementations Kris Van Hees
2026-08-28 20:50 ` Elena Zannoni [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=0d314b71-d474-408e-a56c-7df0e82ee8a3@oracle.com \
    --to=elena.zannoni@oracle.com \
    --cc=dtrace-devel@oss.oracle.com \
    --cc=dtrace@lists.linux.dev \
    --cc=kris.van.hees@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.