Skip to content

Commit

Permalink
fix(perf) skip to process nil ring
Browse files Browse the repository at this point in the history
Signed-off-by: zhuhuijun <zhuhuijunzhj@gmail.com>
  • Loading branch information
Ghostbaby committed Jul 9, 2024
1 parent f2b2f6d commit e9ba616
Show file tree
Hide file tree
Showing 4 changed files with 23 additions and 0 deletions.
8 changes: 8 additions & 0 deletions .idea/.gitignore

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 4 additions & 0 deletions .idea/ebpf.iml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 6 additions & 0 deletions .idea/vcs.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

5 changes: 5 additions & 0 deletions perf/reader.go
Original file line number Diff line number Diff line change
Expand Up @@ -386,6 +386,11 @@ func (pr *Reader) ReadInto(rec *Record) error {
// Waking up userspace is expensive, make the most of it by checking
// all rings.
for _, ring := range pr.rings {
// Skip rings that are not currently enabled.
if ring == nil {
continue
}

ring.loadHead()
pr.epollRings = append(pr.epollRings, ring)
}
Expand Down

0 comments on commit e9ba616

Please sign in to comment.