* [PATCH] provider: only call discover for the provider implementations
@ 2026-08-28 18:48 Kris Van Hees
2026-08-28 20:50 ` Elena Zannoni
0 siblings, 1 reply; 2+ messages in thread
From: Kris Van Hees @ 2026-08-28 18:48 UTC (permalink / raw)
To: dtrace, dtrace-devel
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
^ permalink raw reply related [flat|nested] 2+ messages in thread* Re: [PATCH] provider: only call discover for the provider implementations
2026-08-28 18:48 [PATCH] provider: only call discover for the provider implementations Kris Van Hees
@ 2026-08-28 20:50 ` Elena Zannoni
0 siblings, 0 replies; 2+ messages in thread
From: Elena Zannoni @ 2026-08-28 20:50 UTC (permalink / raw)
To: Kris Van Hees, dtrace, dtrace-devel
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
>
>
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2026-08-28 20:50 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
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 is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox