[DTrace-devel] [PATCH 2/4] fbt: clean up fprobe/kprobe support

Kris Van Hees kris.van.hees at oracle.com
Thu Dec 5 22:17:23 UTC 2024


On Thu, Dec 05, 2024 at 05:05:15PM -0500, Eugene Loh wrote:
> I wouldn't mind a few commit msg words on what "clean up" means.
> 
> Mostly, how/where is dt_fbt_fprobe used?  Put another way...
> 
> On 12/5/24 13:53, Kris Van Hees via DTrace-devel wrote:
> > diff --git a/libdtrace/dt_prov_fbt.c b/libdtrace/dt_prov_fbt.c
> > @@ -73,9 +75,10 @@ static int populate(dtrace_hdl_t *dtp)
> >   	dtrace_syminfo_t	sip;
> >   	dtrace_probedesc_t	pd;
> > -	impl = BPF_HAS(dtp, BPF_FEAT_FENTRY) ? &dt_fbt_fprobe : &dt_fbt_kprobe;
> > +	if (!BPF_HAS(dtp, BPF_FEAT_FENTRY))
> > +		dt_fbt = dt_fbt_kprobe;
> 
> If the BPF_HAS() test passes, shouldn't we have basically
> dt_fbt=dt_fbt_fprobe?  In which case, one might arguably go back to the
> ternary op?

Since dt_fbt is initialized as dt_fbt_fprobe (the default), this conditional
sets it to dt_fbt_kprobe if fprobes are not available.  I figured that was
obvious from the code.



More information about the DTrace-devel mailing list