[DTrace-devel] [PATCH 1/2] error: report probe name on failed enabling error

Kris Van Hees kris.van.hees at oracle.com
Mon Mar 17 20:03:40 UTC 2025


On Mon, Mar 17, 2025 at 03:57:18PM -0400, Eugene Loh wrote:
> I don't 100% get our error reporting, but
> Reviewed-by: Eugene Loh <eugene.loh at oracle.com>
> 
> A few things...
> 
> The various files need updated copyright years.

Good point.

> On 2/24/25 13:43, Kris Van Hees wrote:
> 
> I don't know if anyone else sees this, but this is the second patch in a few
> days that has gotten buried in my inbox due to a stale date.  (On Friday, I
> got one dated 1/24.)  Anyhow, I suppose I now know to look for such emails.

My fault - due to how I was sending the patches, it took the date stamp on the
actual patch and this one was written end of last month, but never sent because
I was still working on some other things and it wasn't needed yet.

Will avoid that in the future.

> > diff --git a/libdtrace/dt_bpf.c b/libdtrace/dt_bpf.c
> > +int
> > +dt_attach_error(dtrace_hdl_t *dtp, int rc, ...)
> > +{
> > +	va_list	ap, apc;
> > +	char	*fmt;
> 
> If you asprintf(&fmt), do you want a matching free() to prevent a memory
> leak?  (Clearly not a big deal, but...)
> and finally...

Good catch - fixed.

> > diff --git a/libdtrace/dt_error.c b/libdtrace/dt_error.c
> > @@ -111,6 +111,8 @@ dtrace_errmsg(dtrace_hdl_t *dtp, int error)
> >   	if (error == EDT_COMPILER && dtp != NULL && dtp->dt_errmsg[0] != '\0')
> >   		str = dtp->dt_errmsg;
> > +	if (error == EDT_ENABLING_ERR && dtp != NULL && dtp->dt_errmsg[0] != '\0')
> > +		str = dtp->dt_errmsg;
> >   	else if (error == EDT_BPF && dtp != NULL && dtp->dt_errmsg[0] != '\0')
> >   		str = dtp->dt_errmsg;
> >   	else if (error == EDT_CTF && dtp != NULL && dtp->dt_ctferr != 0)
> 
> Should that be "else if"?  Otherwise, if error==EDT_COMPILER, you trigger
> both that clause and the later "else" clause.

Absolutely - fixed.



More information about the DTrace-devel mailing list