From 92b4665f564c1d8dbea015bc2e9c6bc4303cc117 Mon Sep 17 00:00:00 2001 From: Leon Hwang Date: Tue, 18 Jun 2024 00:28:57 +0800 Subject: [PATCH] Rename KprobeFuncs to NewKprober Address comments in PR https://github.com/cilium/pwru/pull/340. Signed-off-by: Leon Hwang --- internal/pwru/kprobe.go | 4 ++-- main.go | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) 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() }