Skip to content

Commit

Permalink
Rename KprobeFuncs to NewKprober
Browse files Browse the repository at this point in the history
Address comments in PR #340.

Signed-off-by: Leon Hwang <[email protected]>
  • Loading branch information
Asphaltt committed Jul 7, 2024
1 parent e561e14 commit 92b4665
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
4 changes: 2 additions & 2 deletions internal/pwru/kprobe.go
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down Expand Up @@ -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))

Expand Down
4 changes: 2 additions & 2 deletions main.go
Original file line number Diff line number Diff line change
Expand Up @@ -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()
}

Expand Down

0 comments on commit 92b4665

Please sign in to comment.