feat(memtrack): resolve allocator libs without scanning the whole nix store#431
Draft
GuillaumeLagrange wants to merge 1 commit into
Draft
feat(memtrack): resolve allocator libs without scanning the whole nix store#431GuillaumeLagrange wants to merge 1 commit into
GuillaumeLagrange wants to merge 1 commit into
Conversation
… store Dynamic discovery globs /nix/store/*glibc*/lib/libc.so.6 and *gcc*/libstdc++, matching every version in the store (each a distinct file, so dedup can't collapse them). memtrack then attaches uprobes to all of them even though the target loads one, which made a trivial run take minutes on a nix machine. Add two opt-in escape hatches, checked before the glob: - CODSPEED_MEMTRACK_ALLOCATOR_LIBS: explicit path-list of allocator libraries. - CODSPEED_MEMTRACK_AUTO_LIBS: toggle that auto-resolves the libraries the target binaries (CODSPEED_MEMTRACK_BINARIES, already set by the runner) actually load, via each binary's own loader in list mode (honours nix RPATH). Both fall back to the existing glob when nothing is set or resolved, so default behaviour is unchanged. On a nix box this cuts discovery from 25 attached allocator instances (>2 min) to 1 (~1.8 s). Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Merging this PR will not alter performance
|
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.
Dynamic discovery globs /nix/store/glibc/lib/libc.so.6 and gcc/libstdc++, matching every version in the store (each a distinct file, so dedup can't collapse them). memtrack then attaches uprobes to all of them even though the target loads one, which made a trivial run take minutes on a nix machine.
Add two opt-in escape hatches, checked before the glob:
Both fall back to the existing glob when nothing is set or resolved, so default behaviour is unchanged. On a nix box this cuts discovery from 25 attached allocator instances (>2 min) to 1 (~1.8 s).