* [PATCH 1/2] dlib: remove obsolete dt_dlib_add_probe_var()
@ 2025-03-21 14:42 Kris Van Hees
2025-03-21 15:04 ` [DTrace-devel] " Nick Alcock
0 siblings, 1 reply; 2+ messages in thread
From: Kris Van Hees @ 2025-03-21 14:42 UTC (permalink / raw)
To: dtrace-devel, dtrace
The dt_dlib_add_probe_var() function was added to allow for relcoation
processing filling in probe ids for dependent probes, but since the
probe ids are known at code generation time, there is no need for this.
Signed-off-by: Kris Van Hees <kris.van.hees@oracle.com>
---
libdtrace/dt_cg.c | 3 +--
libdtrace/dt_dlibs.c | 16 ----------------
libdtrace/dt_prov_uprobe.c | 6 +-----
3 files changed, 2 insertions(+), 23 deletions(-)
diff --git a/libdtrace/dt_cg.c b/libdtrace/dt_cg.c
index 8cc99246..e954173b 100644
--- a/libdtrace/dt_cg.c
+++ b/libdtrace/dt_cg.c
@@ -905,14 +905,13 @@ dt_cg_add_dependent(dtrace_hdl_t *dtp, dt_probe_t *prp, void *arg)
{
dt_pcb_t *pcb = dtp->dt_pcb;
dt_irlist_t *dlp = &pcb->pcb_ir;
- dt_ident_t *idp = dt_dlib_add_probe_var(pcb->pcb_hdl, prp);
uint_t exitlbl = dt_irlist_label(dlp);
int skip = 0;
dt_cg_tramp_save_args(pcb);
pcb->pcb_parent_probe = pcb->pcb_probe;
pcb->pcb_probe = prp;
- emite(dlp, BPF_STORE_IMM(BPF_W, BPF_REG_7, DMST_PRID, prp->desc->id), idp);
+ emit(dlp, BPF_STORE_IMM(BPF_W, BPF_REG_7, DMST_PRID, prp->desc->id));
if (prp->prov->impl->trampoline != NULL)
skip = prp->prov->impl->trampoline(pcb, exitlbl);
diff --git a/libdtrace/dt_dlibs.c b/libdtrace/dt_dlibs.c
index 9ad4f5e7..9a2970c7 100644
--- a/libdtrace/dt_dlibs.c
+++ b/libdtrace/dt_dlibs.c
@@ -250,22 +250,6 @@ dt_dlib_add_var(dtrace_hdl_t *dtp, const char *name, uint_t id)
return dt_dlib_add_sym_id(dtp, name, DT_IDENT_SCALAR, id);
}
-/*
- * Add a BPF variable for a probe.
- * The fully qualified probe name is tha variable name, and the probe ID is the
- * value of the variable.
- */
-dt_ident_t *
-dt_dlib_add_probe_var(dtrace_hdl_t *dtp, const dt_probe_t *prp)
-{
- char pn[DTRACE_FULLNAMELEN + 1];
-
- snprintf(pn, DTRACE_FULLNAMELEN, "%s:%s:%s:%s", prp->desc->prv,
- prp->desc->mod, prp->desc->fun, prp->desc->prb);
-
- return dt_dlib_add_var(dtp, pn, prp->desc->id);
-}
-
/*
* Return the DIFO for an external symbol.
*/
diff --git a/libdtrace/dt_prov_uprobe.c b/libdtrace/dt_prov_uprobe.c
index 8dbd2aed..28762eb3 100644
--- a/libdtrace/dt_prov_uprobe.c
+++ b/libdtrace/dt_prov_uprobe.c
@@ -947,7 +947,6 @@ static int trampoline(dt_pcb_t *pcb, uint_t exitlbl)
const dt_probe_t *prp = pop->probe;
uint_t lbl_next = dt_irlist_label(dlp);
pid_t pid;
- dt_ident_t *idp;
if (prp->prov->impl != &dt_pid)
continue;
@@ -955,9 +954,6 @@ static int trampoline(dt_pcb_t *pcb, uint_t exitlbl)
pid = dt_pid_get_pid(prp->desc, pcb->pcb_hdl, pcb, NULL);
assert(pid != -1);
- idp = dt_dlib_add_probe_var(pcb->pcb_hdl, prp);
- assert(idp != NULL);
-
/*
* Populate probe arguments.
*/
@@ -971,7 +967,7 @@ static int trampoline(dt_pcb_t *pcb, uint_t exitlbl)
* process, and emit a sequence of clauses for it when it does.
*/
emit(dlp, BPF_BRANCH_IMM(BPF_JNE, BPF_REG_6, pid, lbl_next));
- emite(dlp, BPF_STORE_IMM(BPF_W, BPF_REG_7, DMST_PRID, prp->desc->id), idp);
+ emit(dlp, BPF_STORE_IMM(BPF_W, BPF_REG_7, DMST_PRID, prp->desc->id));
dt_cg_tramp_call_clauses(pcb, prp, DT_ACTIVITY_ACTIVE);
emitl(dlp, lbl_next,
BPF_NOP());
--
2.45.2
^ permalink raw reply related [flat|nested] 2+ messages in thread
* Re: [DTrace-devel] [PATCH 1/2] dlib: remove obsolete dt_dlib_add_probe_var()
2025-03-21 14:42 [PATCH 1/2] dlib: remove obsolete dt_dlib_add_probe_var() Kris Van Hees
@ 2025-03-21 15:04 ` Nick Alcock
0 siblings, 0 replies; 2+ messages in thread
From: Nick Alcock @ 2025-03-21 15:04 UTC (permalink / raw)
To: Kris Van Hees via DTrace-devel; +Cc: dtrace, Kris Van Hees
On 21 Mar 2025, Kris Van Hees via DTrace-devel outgrape:
> The dt_dlib_add_probe_var() function was added to allow for relcoation
> processing filling in probe ids for dependent probes, but since the
> probe ids are known at code generation time, there is no need for this.
I guess this is removing a relocation/fixup which was always the
identity transformation (prp->desc->id being reset to itself at reloc
resolution time).
If so...
> Signed-off-by: Kris Van Hees <kris.van.hees@oracle.com>
Reviewed-by: Nick Alcock <nick.alcock@oracle.com>
--
NULL && (void)
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2025-03-21 15:05 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-03-21 14:42 [PATCH 1/2] dlib: remove obsolete dt_dlib_add_probe_var() Kris Van Hees
2025-03-21 15:04 ` [DTrace-devel] " Nick Alcock
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox