fix(memtrack): handle dropped events better#321
Open
not-matthias wants to merge 4 commits intomainfrom
Open
Conversation
The eBPF ring buffer was 256 KiB (~4.7k events). High-allocation benchmarks could fill it faster than userspace drained, silently losing events. Bump it to 16 MiB (~300k events) and add a single-slot BPF array that bpf_ringbuf_reserve() failures atomically increment, so userspace can detect when the trace is incomplete. Refs COD-2577.
Replace the 10ms-timeout poll loop with a blocking epoll wait that combines the ring buffer's epoll fd and a shutdown eventfd. The kernel now wakes the drain thread the moment events arrive, which removes the polling-induced backlog under bursty workloads. Refs COD-2577.
The streamed event file has no header, so per-run summary data has
nowhere to live. Add a small JSON sidecar (`{pid}.MemtrackMeta.json`)
carrying the dropped-event count so the backend can invalidate
benchmarks whose trace is incomplete.
Refs COD-2577.
After the tracked command exits, read the eBPF dropped-event counter, log a warning if non-zero, and persist the value as a MemtrackMeta sidecar next to the events file. Lets the backend mark a benchmark as incomplete instead of silently accepting a truncated memory trace. Refs COD-2577.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
No description provided.