public inbox for dtrace@lists.linux.dev
 help / color / mirror / Atom feed
* [PATCH v2 02/19] Add a hook for a provider-specific "update" function
@ 2024-09-28  2:15 eugene.loh
  2024-09-28  2:15 ` [PATCH v4 07/19] Create the BPF usdt_prids map eugene.loh
  0 siblings, 1 reply; 7+ messages in thread
From: eugene.loh @ 2024-09-28  2:15 UTC (permalink / raw)
  To: dtrace, dtrace-devel

From: Eugene Loh <eugene.loh@oracle.com>

For up-coming USDT-probe support, we need to update a BPF map
-- at least when the dtrace session starts but possibly also later
to support systemwide USDT tracing for processes that may start up
later.

One way to do this is with a USDT-specific update function.

For now, let's add a hook for providers to have provider-specific
update functions.  User space can either call

    for (i = 0; i < ARRAY_SIZE(dt_providers); i++) {
        if (dt_providers[i]->update)
            dt_providers[i]->update(...);
    }

any time it likes.  Or it can call dt_usdt.update(...).

This is for WIP.  A different approach can be adopted later instead.

Signed-off-by: Eugene Loh <eugene.loh@oracle.com>
---
 libdtrace/dt_provider.h | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/libdtrace/dt_provider.h b/libdtrace/dt_provider.h
index 17b1844cb..92df0cd28 100644
--- a/libdtrace/dt_provider.h
+++ b/libdtrace/dt_provider.h
@@ -68,6 +68,8 @@ typedef struct dt_provimpl {
 			      void *datap);
 	void (*destroy)(dtrace_hdl_t *dtp,	/* free provider data */
 			      void *datap);
+	int (*update)(dtrace_hdl_t *dtp,	/* update provider-specific info */
+			      void *datap);
 } dt_provimpl_t;
 
 /* list dt_dtrace first */
-- 
2.43.5


^ permalink raw reply related	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2024-10-09  4:58 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-09-28  2:15 [PATCH v2 02/19] Add a hook for a provider-specific "update" function eugene.loh
2024-09-28  2:15 ` [PATCH v4 07/19] Create the BPF usdt_prids map eugene.loh
2024-10-03  5:04   ` [DTrace-devel] " Kris Van Hees
2024-10-06  1:11     ` Eugene Loh
2024-10-07 15:52       ` Kris Van Hees
2024-10-07 16:57         ` Eugene Loh
2024-10-09  4:58           ` Eugene Loh

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox