[DTrace-devel] [PATCH 2/4] fbt: clean up fprobe/kprobe support
Kris Van Hees
kris.van.hees at oracle.com
Thu Dec 5 23:09:26 UTC 2024
On Thu, Dec 05, 2024 at 05:58:04PM -0500, Eugene Loh wrote:
> On 12/5/24 17:17, Kris Van Hees wrote:
>
> > 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.
>
> Sorry, where should I look to see that dt_fbt is initialized to
> dt_fbt_fprobe?
Oh right - that was in the previous version. But on OL7, gcc complained about
that assignment. But I didn't complete the change in the patch I posted.
Let me post the corrct one (and yes, the ternary comes back).
More information about the DTrace-devel
mailing list