feat: add --track-allocators toggle for memory mode#469
Open
not-matthias wants to merge 1 commit into
Open
Conversation
Greptile SummaryAdds configurable allocator tracking alongside expanded RSS accounting.
Confidence Score: 5/5The PR appears safe to merge because no blocking failures remain within the follow-up review scope. No blocking failures remain. Important Files Changed
|
Merging this PR will not alter performance
|
not-matthias
force-pushed
the
cod-3231-support-disabling-allocator-tracking
branch
from
July 24, 2026 09:23
27cfce8 to
d983261
Compare
Add a --track-allocators flag (default on, env CODSPEED_TRACK_ALLOCATORS) to the memtrack track subcommand. When disabled, memtrack skips the allocator uprobe machinery (exec watcher + attach worker) and only emits coarse mmap/munmap/brk events, reducing overhead on allocation-heavy programs. The mmap/munmap/brk syscall tracepoints are now always attached in every memory run. The runner does not add a CLI flag for this: it relies on the CODSPEED_TRACK_ALLOCATORS environment variable being inherited by the memtrack subprocess, keeping the runner decoupled from the installed memtrack version. Standalone memtrack can still use the CLI flag.
not-matthias
force-pushed
the
cod-3231-support-disabling-allocator-tracking
branch
from
July 24, 2026 10:40
d983261 to
131f8a3
Compare
not-matthias
changed the base branch from
main
to
cod-3089-collect-rss-in-memtrack
July 24, 2026 12:04
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.
What
Adds a
--track-allocatorsflag (default on, envCODSPEED_TRACK_ALLOCATORS) onrun/execand thememtrack tracksubcommand. When disabled (--track-allocators false), memtrack skips the per-allocation uprobe machinery and only emits coarsemmap/munmap/brkevents.Why
Allocation-heavy programs (e.g. a Rust build) generate an overwhelming number of
malloc/freeevents, and the per-allocation uprobes slow the target significantly. This flag lets users trade allocation granularity for lower overhead while still collecting RSS-relevant memory events.How
mmap/munmap/brksyscall tracepoints (already compiled into the BPF program but never attached) are now always attached in every memory run. The flag gates only the expensive allocator uprobes (exec-mapping watcher + attach worker).Tracker::new(track_allocators: bool)conditionally starts the exec watcher /AttachWorker;spawn/finishtolerate aNoneworker.ExecAndRunSharedArgs, threaded throughOrchestratorConfig→ExecutorConfig(mirroringexclude_allocations), and passed to the memtrack subprocess as an explicit--track-allocators <bool>arg (not via env inheritance, to survive glibc secure-execution env stripping).Default runs are unchanged in allocation coverage and now additionally emit
mmap/brkevents.Testing
cargo check --workspace --tests,cargo test --release -p codspeed-runner— green.run/exec/memtrack track --helpshow the flag (defaulttrue);CODSPEED_TRACK_ALLOCATORS=falseparses.test_track_allocators_disabled_skips_allocations) asserts that with allocators disabled, the trace containsMmapevents and zero allocation-kind events.Fixes COD-3231.