Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
What does this PR do?
Adds
WakeupEvents
to perf buffers andFlush
to both perf buffers and ring buffers.Motivation
WakeupEvents
is used to queue data in perf buffers without waking up userspace. Ring buffers have this builtin control from the eBPF side with flags to helper calls.Flush
is used to manually wakeup userspace to read any data already queued in the buffer. This is useful to have a synchronization point where you have read all available data.Additional Notes
A sentinel error
perf.ErrFlushed
is reported by the upstream library when aFlush
has completed reading all available data. This is turned into aRecord
with an emptyRawSample
field. This is so there is an in-band way of detecting the end. Using the error channel or something else would require potentially complex synchronization.Describe how to test your changes