[DTrace-devel] [PATCH 03/14] Let USDT module names contain dots
eugene.loh at oracle.com
eugene.loh at oracle.com
Tue Jun 4 18:11:02 UTC 2024
From: Eugene Loh <eugene.loh at oracle.com>
Signed-off-by: Eugene Loh <eugene.loh at oracle.com>
---
dtprobed/dof_stash.c | 5 +++++
libdtrace/dt_pid.c | 2 ++
2 files changed, 7 insertions(+)
diff --git a/dtprobed/dof_stash.c b/dtprobed/dof_stash.c
index 62418b66..44c67462 100644
--- a/dtprobed/dof_stash.c
+++ b/dtprobed/dof_stash.c
@@ -589,6 +589,10 @@ dof_stash_write_parsed(pid_t pid, dev_t dev, ino_t ino, dt_list_t *accum)
mod, fun, prb)) == NULL)
goto err_provider;
+#if 0
+This does not make any sense. We are checking parsedfn against "." and "..",
+but parsedfn comes from make_probespec_name(), whose output is of the form
+"%s:%s:%s:%s" and therefore can never be "." or "..".
/*
* Ban "." and ".." as name components. Obviously names
* containing dots are commonplace (shared libraries,
@@ -604,6 +608,7 @@ dof_stash_write_parsed(pid_t pid, dev_t dev, ino_t ino, dt_list_t *accum)
if (strcmp(parsedfn, ".") == 0 ||
strcmp(parsedfn, "..") == 0)
goto err_provider;
+#endif
op = "probe module";
diff --git a/libdtrace/dt_pid.c b/libdtrace/dt_pid.c
index 7c7d7e30..93a7ce76 100644
--- a/libdtrace/dt_pid.c
+++ b/libdtrace/dt_pid.c
@@ -833,6 +833,7 @@ dt_pid_create_usdt_probes(dtrace_hdl_t *dtp, dt_proc_t *dpr, dtrace_probedesc_t
assert(pvp->impl != NULL && pvp->impl->provide_probe != NULL);
+#if 0
if (strchr(pdp->prv, '.') != NULL ||
strchr(pdp->mod, '.') != NULL ||
strchr(pdp->fun, '.') != NULL ||
@@ -840,6 +841,7 @@ dt_pid_create_usdt_probes(dtrace_hdl_t *dtp, dt_proc_t *dpr, dtrace_probedesc_t
dt_dprintf("Probe component contains dots: cannot be a USDT probe.\n");
return 0;
}
+#endif
if (asprintf(&probepath, "%s/probes/%i/%s/%s/%s/%s", dtp->dt_dofstash_path,
dpr->dpr_pid, pdp->prv[0] == '\0' ? "*" : pdp->prv,
--
2.18.4
More information about the DTrace-devel
mailing list