Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

optimal nettop so that we avoid scan the whole /proc #139

Merged
merged 7 commits into from
Jan 10, 2024
Merged
Show file tree
Hide file tree
Changes from 6 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions bpf/netns.c
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@

SEC("tracepoint/task/newtask")
int netns(){
}
1 change: 0 additions & 1 deletion pkg/exporter/cmd/list_probe.go
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,6 @@ var (
indent := " "
for _, s := range l {
fmt.Printf("%s%s\n", indent, s)

}
}
},
Expand Down
3 changes: 0 additions & 3 deletions pkg/exporter/cmd/root.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,6 @@ import (

log "github.com/sirupsen/logrus"

"github.com/alibaba/kubeskoop/pkg/exporter/nettop"

"github.com/spf13/cobra"
)

Expand All @@ -16,7 +14,6 @@ var (
Use: "inspector",
Short: "network inspection tool",
PersistentPreRun: func(cmd *cobra.Command, args []string) {
nettop.Init(sidecar)
if debug {
log.SetLevel(log.DebugLevel)
} else {
Expand Down
6 changes: 5 additions & 1 deletion pkg/exporter/cmd/server.go
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,11 @@ var (
}

// nolint
go nettop.StartCache(insp.ctx)
if err := nettop.StartCache(insp.ctx, sidecar); err != nil {
log.Errorf("failed start cache: %v", err)
return
}

defer nettop.StopCache()

// config hot reload process
Expand Down
Loading
Loading