Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions perfmap.go
Original file line number Diff line number Diff line change
Expand Up @@ -264,6 +264,8 @@ func (m *PerfMap) Resume() error {

// BufferSize is the size in bytes of each per-CPU buffer
func (m *PerfMap) BufferSize() int {
m.stateLock.Lock()
defer m.stateLock.Unlock()
return m.bufferSize
}

Expand Down
2 changes: 2 additions & 0 deletions ringbuffer.go
Original file line number Diff line number Diff line change
Expand Up @@ -185,6 +185,8 @@ func (rb *RingBuffer) Stop(cleanup MapCleanupType) error {

// BufferSize returns the size in bytes of the ring buffer
func (rb *RingBuffer) BufferSize() int {
rb.stateLock.Lock()
defer rb.stateLock.Unlock()
return rb.bufferSize
}

Expand Down
Loading