From cfdfa8da06e3292408d548f0357ec4224a408dda Mon Sep 17 00:00:00 2001 From: Adam Karpowich Date: Mon, 18 Dec 2023 23:56:58 -0500 Subject: [PATCH] set to trace to reduce spammy offsetguess logs --- pkg/network/tracer/conntracker_test.go | 2 +- pkg/network/tracer/offsetguess/conntrack.go | 12 ++++++------ pkg/network/tracer/offsetguess_test.go | 2 +- pkg/network/tracer/tracer_linux_test.go | 6 +++--- 4 files changed, 11 insertions(+), 11 deletions(-) diff --git a/pkg/network/tracer/conntracker_test.go b/pkg/network/tracer/conntracker_test.go index 712e009938a2d..1ca924fd64f76 100644 --- a/pkg/network/tracer/conntracker_test.go +++ b/pkg/network/tracer/conntracker_test.go @@ -34,7 +34,7 @@ const ( ) func TestConntrackers(t *testing.T) { - ebpftest.LogLevel(t, "debug") + ebpftest.LogLevel(t, "trace") t.Run("netlink", func(t *testing.T) { runConntrackerTest(t, "netlink", setupNetlinkConntracker) }) diff --git a/pkg/network/tracer/offsetguess/conntrack.go b/pkg/network/tracer/offsetguess/conntrack.go index 7a37a696fc91b..cb1e74db152dd 100644 --- a/pkg/network/tracer/offsetguess/conntrack.go +++ b/pkg/network/tracer/offsetguess/conntrack.go @@ -145,7 +145,7 @@ func (c *conntrackOffsetGuesser) checkAndUpdateCurrentOffset(mp *ebpf.Map, expec case GuessCtTupleOrigin: c.status.Offset_origin, overlapped = skipOverlaps(c.status.Offset_origin, c.nfConnRanges()) if overlapped { - log.Debugf("offset %v overlaps with another field, skipping", whatString[GuessWhat(c.status.What)]) + log.Tracef("offset %v overlaps with another field, skipping", whatString[GuessWhat(c.status.What)]) // adjusted offset from eBPF overlapped with another field, we need to check new offset break } @@ -156,14 +156,14 @@ func (c *conntrackOffsetGuesser) checkAndUpdateCurrentOffset(mp *ebpf.Map, expec c.logAndAdvance(c.status.Offset_origin, GuessCtTupleReply) break } - log.Debugf("%v %d does not match expected %d, incrementing offset %d", + log.Tracef("%v %d does not match expected %d, incrementing offset %d", whatString[GuessWhat(c.status.What)], c.status.Saddr, expected.saddr, c.status.Offset_origin) c.status.Offset_origin++ c.status.Offset_origin, _ = skipOverlaps(c.status.Offset_origin, c.nfConnRanges()) case GuessCtTupleReply: c.status.Offset_reply, overlapped = skipOverlaps(c.status.Offset_reply, c.nfConnRanges()) if overlapped { - log.Debugf("offset %v overlaps with another field, skipping", whatString[GuessWhat(c.status.What)]) + log.Tracef("offset %v overlaps with another field, skipping", whatString[GuessWhat(c.status.What)]) // adjusted offset from eBPF overlapped with another field, we need to check new offset break } @@ -172,14 +172,14 @@ func (c *conntrackOffsetGuesser) checkAndUpdateCurrentOffset(mp *ebpf.Map, expec c.logAndAdvance(c.status.Offset_reply, GuessCtNet) break } - log.Debugf("%v %d does not match expected %d, incrementing offset %d", + log.Tracef("%v %d does not match expected %d, incrementing offset %d", whatString[GuessWhat(c.status.What)], c.status.Saddr, expected.daddr, c.status.Offset_reply) c.status.Offset_reply++ c.status.Offset_reply, _ = skipOverlaps(c.status.Offset_reply, c.nfConnRanges()) case GuessCtNet: c.status.Offset_netns, overlapped = skipOverlaps(c.status.Offset_netns, c.nfConnRanges()) if overlapped { - log.Debugf("offset %v overlaps with another field, skipping", whatString[GuessWhat(c.status.What)]) + log.Tracef("offset %v overlaps with another field, skipping", whatString[GuessWhat(c.status.What)]) // adjusted offset from eBPF overlapped with another field, we need to check new offset break } @@ -188,7 +188,7 @@ func (c *conntrackOffsetGuesser) checkAndUpdateCurrentOffset(mp *ebpf.Map, expec c.logAndAdvance(c.status.Offset_netns, GuessNotApplicable) return c.setReadyState(mp) } - log.Debugf("%v %d does not match expected %d, incrementing offset %d", + log.Tracef("%v %d does not match expected %d, incrementing offset %d", whatString[GuessWhat(c.status.What)], c.status.Netns, expected.netns, c.status.Offset_netns) c.status.Offset_netns++ c.status.Offset_netns, _ = skipOverlaps(c.status.Offset_netns, c.nfConnRanges()) diff --git a/pkg/network/tracer/offsetguess_test.go b/pkg/network/tracer/offsetguess_test.go index fab9aeaa48c00..5a51dfe0b6fef 100644 --- a/pkg/network/tracer/offsetguess_test.go +++ b/pkg/network/tracer/offsetguess_test.go @@ -126,7 +126,7 @@ func (o offsetT) String() string { } func TestOffsetGuess(t *testing.T) { - ebpftest.LogLevel(t, "debug") + ebpftest.LogLevel(t, "trace") ebpftest.TestBuildMode(t, ebpftest.RuntimeCompiled, "", testOffsetGuess) } diff --git a/pkg/network/tracer/tracer_linux_test.go b/pkg/network/tracer/tracer_linux_test.go index 4fee251e104df..8d4aac590cf58 100644 --- a/pkg/network/tracer/tracer_linux_test.go +++ b/pkg/network/tracer/tracer_linux_test.go @@ -383,7 +383,7 @@ func (s *TracerSuite) TestConnectionExpirationRegression() { func (s *TracerSuite) TestConntrackExpiration() { t := s.T() - ebpftest.LogLevel(t, "debug") + ebpftest.LogLevel(t, "trace") netlinktestutil.SetupDNAT(t) wg := sync.WaitGroup{} @@ -2029,7 +2029,7 @@ func (s *TracerSuite) TestGetHelpersTelemetry() { } func TestEbpfConntrackerFallback(t *testing.T) { - ebpftest.LogLevel(t, "debug") + ebpftest.LogLevel(t, "trace") type testCase struct { enableRuntimeCompiler bool allowPrecompiledFallback bool @@ -2105,7 +2105,7 @@ func TestEbpfConntrackerFallback(t *testing.T) { } func TestConntrackerFallback(t *testing.T) { - ebpftest.LogLevel(t, "debug") + ebpftest.LogLevel(t, "trace") cfg := testConfig() cfg.EnableEbpfConntracker = false cfg.AllowNetlinkConntrackerFallback = true