Skip to contentSkip to conversation

Fix fprobe/kprobe selection

PATCH In review [email protected] 2 participants 2 messages Feb 19, 2025

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 Fix fprobe/kprobe selection

From: Eugene Loh <[email protected]>

In commit 2a09b3bea504 ("fbt: clean up fprobe/kprobe support"), libdtrace/dt_prov_fbt.c populate() has this change:

- impl = BPF_HAS(dtp, BPF_FEAT_FENTRY) ? &dt_fbt_fprobe : &dt_fbt_kprobe;
+ dt_fbt = BPF_HAS(dtp, BPF_FEAT_FENTRY) ? dt_fbt_kprobe : dt_fbt_kprobe;

That is, regardless of the BPF_HAS() test, dt_fbt_kprobe is chosen.

Restore the choice to pick up dt_fbt_fprobe when appropriate.

It is hard to devise a test for this unique problem.

---
 libdtrace/dt_prov_fbt.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
libdtrace/dt_prov_fbt.c +1 -1
index f0910c371..eef93879d 100644
@@ -75,7 +75,7 @@ static int populate(dtrace_hdl_t *dtp)
 	dtrace_syminfo_t	sip;
 	dtrace_probedesc_t	pd;
 
-	dt_fbt = BPF_HAS(dtp, BPF_FEAT_FENTRY) ? dt_fbt_kprobe : dt_fbt_kprobe;
+	dt_fbt = BPF_HAS(dtp, BPF_FEAT_FENTRY) ? dt_fbt_fprobe : dt_fbt_kprobe;
 
 	prv = dt_provider_create(dtp, prvname, &dt_fbt, &pattr, NULL);
 	if (prv == NULL)
Signature · 1 line
2.43.5
Reviewed-by on v1 1/1
#1 lore raw
Quoted 8 lines · eugene.loh--- via DTrace-devel

From: Eugene Loh <[email protected]>

In commit 2a09b3bea504 ("fbt: clean up fprobe/kprobe support"), libdtrace/dt_prov_fbt.c populate() has this change:

- impl = BPF_HAS(dtp, BPF_FEAT_FENTRY) ? &dt_fbt_fprobe : &dt_fbt_kprobe;
+ dt_fbt = BPF_HAS(dtp, BPF_FEAT_FENTRY) ? dt_fbt_kprobe : dt_fbt_kprobe;

Quoted 7 lines

That is, regardless of the BPF_HAS() test, dt_fbt_kprobe is chosen.

Restore the choice to pick up dt_fbt_fprobe when appropriate.

It is hard to devise a test for this unique problem.

and my aplogies for introducing this problem. I believe it was caused by needing to force test verification in the case that the kprobe option was selected on a system, and I clearly forgot to revert that before preparing the actual patch.

Kris

Quoted 25 lines
---
 libdtrace/dt_prov_fbt.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
libdtrace/dt_prov_fbt.c +1 -1
index f0910c371..eef93879d 100644
@@ -75,7 +75,7 @@ static int populate(dtrace_hdl_t *dtp)
 	dtrace_syminfo_t	sip;
 	dtrace_probedesc_t	pd;
 
-	dt_fbt = BPF_HAS(dtp, BPF_FEAT_FENTRY) ? dt_fbt_kprobe : dt_fbt_kprobe;
+	dt_fbt = BPF_HAS(dtp, BPF_FEAT_FENTRY) ? dt_fbt_fprobe : dt_fbt_kprobe;
 
 	prv = dt_provider_create(dtp, prvname, &dt_fbt, &pattr, NULL);
 	if (prv == NULL)
Signature · 7 lines
2.43.5


_______________________________________________
DTrace-devel mailing list
[email protected]
https://oss.oracle.com/mailman/listinfo/dtrace-devel