Skip to content

Commit

Permalink
Fix rounding function for max entries
Browse files Browse the repository at this point in the history
Do not round to 0, round to at least N
  • Loading branch information
rafaelroquetto committed Nov 19, 2024
1 parent 4fd1d09 commit 0d46bf1
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions pkg/internal/ebpf/tracer_linux.go
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,10 @@ type instrumenter struct {
}

func roundToNearestMultiple(x, n uint32) uint32 {
if x < n {
return n
}

return (x + n/2) / n * n
}

Expand Down

0 comments on commit 0d46bf1

Please sign in to comment.