diff --git a/internal/pwru/kprobe.go b/internal/pwru/kprobe.go index f59cd45f..32cd6722 100644 --- a/internal/pwru/kprobe.go +++ b/internal/pwru/kprobe.go @@ -198,7 +198,7 @@ func AttachKprobeMulti(ctx context.Context, bar *pb.ProgressBar, kprobes []Kprob return } -func KprobeSkbFuncs(ctx context.Context, funcs Funcs, coll *ebpf.Collection, a2n Addr2Name, useKprobeMulti bool, batch uint) *kprober { +func NewKprober(ctx context.Context, funcs Funcs, coll *ebpf.Collection, a2n Addr2Name, useKprobeMulti bool, batch uint) *kprober { msg := "kprobe" if useKprobeMulti { msg = "kprobe-multi" @@ -244,7 +244,7 @@ func KprobeSkbFuncs(ctx context.Context, funcs Funcs, coll *ebpf.Collection, a2n return &k } -func KprobeNonSkbFuncs(nonSkbFuncs []string, funcs Funcs, coll *ebpf.Collection) *kprober { +func NewNonSkbFuncsKprober(nonSkbFuncs []string, funcs Funcs, coll *ebpf.Collection) *kprober { var k kprober k.kprobeBatch = uint(len(nonSkbFuncs)) diff --git a/main.go b/main.go index 31e79514..a7cc5b7c 100644 --- a/main.go +++ b/main.go @@ -230,12 +230,12 @@ func main() { } if nonSkbFuncs := flags.FilterNonSkbFuncs; len(nonSkbFuncs) != 0 { - k := pwru.KprobeNonSkbFuncs(nonSkbFuncs, funcs, coll) + k := pwru.NewNonSkbFuncsKprober(nonSkbFuncs, funcs, coll) defer k.DetachKprobes() } if len(funcs) != 0 { - k := pwru.KprobeSkbFuncs(ctx, funcs, coll, addr2name, useKprobeMulti, flags.FilterKprobeBatch) + k := pwru.NewKprober(ctx, funcs, coll, addr2name, useKprobeMulti, flags.FilterKprobeBatch) defer k.DetachKprobes() }