Skip to content

Commit

Permalink
bpflbr: Only trace kfunc when no -p
Browse files Browse the repository at this point in the history
Signed-off-by: Leon Hwang <[email protected]>
  • Loading branch information
Asphaltt committed Dec 5, 2024
1 parent 6a58c06 commit 2233c3a
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions main.go
Original file line number Diff line number Diff line change
Expand Up @@ -95,8 +95,13 @@ func main() {
".data.lbrs": lbrs,
}

tracings, err := bpflbr.NewBPFTracing(bpfSpec, reusedMaps, tracingTargets, flags.Kfuncs())
assert.NoVerifierErr(err, "Failed to trace bpf progs: %v")
kfuncs := flags.Kfuncs()
if len(kfuncs) != 0 && len(progs) == 0 {
tracingTargets = tracingTargets[:0]
}

tracings, err := bpflbr.NewBPFTracing(bpfSpec, reusedMaps, tracingTargets, kfuncs)
assert.NoVerifierErr(err, "Failed to trace: %v")
defer tracings.Close()

err = bpfProgs.AddProgs(tracings.Progs(), engine, true)
Expand Down

0 comments on commit 2233c3a

Please sign in to comment.