diff --git a/pkg/plugin/linuxutil/linuxutil_linux.go b/pkg/plugin/linuxutil/linuxutil_linux.go index 715acc358a..d549814a0c 100644 --- a/pkg/plugin/linuxutil/linuxutil_linux.go +++ b/pkg/plugin/linuxutil/linuxutil_linux.go @@ -71,24 +71,12 @@ func (lu *linuxUtil) run(ctx context.Context) error { return nil case <-ticker.C: opts := &NetstatOpts{ - CuratedKeys: true, - AddZeroVal: false, - ListenSock: false, - PrevTCPSockStats: lu.prevTCPSockStats, + CuratedKeys: true, + AddZeroVal: false, + ListenSock: false, } - var wg sync.WaitGroup ns := &Netstat{} - nsReader := NewNetstatReader(opts, ns) - wg.Add(1) - go func() { - defer wg.Done() - tcpSocketStats, err := nsReader.readAndUpdate() - if err != nil { - lu.l.Error("Reading netstat failed", zap.Error(err)) - } - lu.prevTCPSockStats = tcpSocketStats - }() ethtoolOpts := &EthtoolOpts{ errOrDropKeysOnly: true, @@ -107,6 +95,7 @@ func (lu *linuxUtil) run(ctx context.Context) error { lu.l.Error("Error while creating ethReader") return fmt.Errorf("error while creating ethReader") } + var wg sync.WaitGroup wg.Add(1) go func() { defer wg.Done() diff --git a/pkg/plugin/linuxutil/types_linux.go b/pkg/plugin/linuxutil/types_linux.go index a5263c3e25..c8a3de296b 100644 --- a/pkg/plugin/linuxutil/types_linux.go +++ b/pkg/plugin/linuxutil/types_linux.go @@ -12,10 +12,9 @@ const name = "linuxutil" //go:generate go run go.uber.org/mock/mockgen@v0.4.0 -source=types_linux.go -destination=linuxutil_mock_generated_linux.go -package=linuxutil type linuxUtil struct { - cfg *kcfg.Config - l *log.ZapLogger - isRunning bool - prevTCPSockStats *SocketStats + cfg *kcfg.Config + l *log.ZapLogger + isRunning bool } var netstatCuratedKeys = map[string]struct{}{ @@ -86,9 +85,6 @@ type NetstatOpts struct { // get only listening sockets ListenSock bool - - // previous TCP socket stats - PrevTCPSockStats *SocketStats } type EthtoolStats struct {