Skip to content

Commit

Permalink
set to trace to reduce spammy offsetguess logs
Browse files Browse the repository at this point in the history
  • Loading branch information
akarpz committed Dec 19, 2023
1 parent 50b374e commit cfdfa8d
Show file tree
Hide file tree
Showing 4 changed files with 11 additions and 11 deletions.
2 changes: 1 addition & 1 deletion pkg/network/tracer/conntracker_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -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)
})
Expand Down
12 changes: 6 additions & 6 deletions pkg/network/tracer/offsetguess/conntrack.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
}
Expand All @@ -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
}
Expand All @@ -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
}
Expand All @@ -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())
Expand Down
2 changes: 1 addition & 1 deletion pkg/network/tracer/offsetguess_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -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)
}

Expand Down
6 changes: 3 additions & 3 deletions pkg/network/tracer/tracer_linux_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -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{}

Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down

0 comments on commit cfdfa8d

Please sign in to comment.