Repository navigation
feat: strip capture-machinery frames in pprof encoder - #2
Merged
Merged
Conversation
rupert648
force-pushed
the
feat/encoder-frame-stripping
branch
from
May 21, 2026 21:16
bf8717d to
292afe8
Compare
culpert: allocation diff
RegressionsNone. ImprovementsNone. 2 span(s) suppressed by thresholds. |
`backtrace::trace`, `culpert::sampler`, `alloc::raw_vec::` and similar internal frames are now filtered out during pprof encoding, not only in the `culpert report` CLI display path. Stock `go tool pprof` / `pprof -text` now shows real user code at the leaf without any culpert scaffolding. If an entire stack consists of machinery frames the sample is still emitted (bytes are preserved) but with an empty location_id list, rather than being silently dropped. `MACHINERY_NEEDLES` and `is_machinery` are pub in `culpert::pprof`; the CLI now imports them directly instead of maintaining a duplicate copy. Two new unit tests cover these cases.
rupert648
force-pushed
the
feat/encoder-frame-stripping
branch
from
May 21, 2026 21:18
292afe8 to
6b730c6
Compare
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.
Summary
MACHINERY_NEEDLES/is_machineryinto the coreculpertcrate (pprof.rs) so frame filtering happens at encode time, not just in CLI displaybacktrace::trace,culpert::sampler,alloc::raw_vec::and similar internal frames are now absent from the emitted.pb.gz— stockgo tool pprof/pprof -textshows real user code at the leaf without any scaffoldinglocation_idlist rather than droppedformat_leaf_callsiteand its own copy ofMACHINERY_NEEDLESare kept as-is for backward compatibility with existing profiles on diskTest plan
pprof::tests::machinery_frames_stripped_from_encoder— verifies machinery frame names don't appear in any encodedFunction; verifies user frames survivepprof::tests::all_machinery_stack_emits_empty_location_list— verifies all-machinery stack emits the sample with correct byte count but zero locationscargo test --workspace)cargo clippy --all-targets --all-featurescleancargo fmt --allclean🤖 Generated with Claude Code