Deduplicate rows in table reporter with identical displayed fields#892
Open
abhiojha8 wants to merge 1 commit intobloomberg:mainfrom
Open
Deduplicate rows in table reporter with identical displayed fields#892abhiojha8 wants to merge 1 commit intobloomberg:mainfrom
abhiojha8 wants to merge 1 commit intobloomberg:mainfrom
Conversation
The table reporter creates one row per AllocationRecord but only displays the top stack frame. Records with different full call stacks mapping to the same top frame appeared as duplicate rows. Aggregate records sharing the same (tid, allocator, top_frame) key, summing size and n_allocations. Also add --split-threads option to the table command, matching the flamegraph reporter. Signed-off-by: Abhi Ojha <abhiojha8@gmail.com>
Collaborator
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.

Issue number of the reported bug or feature request: #857
Describe your changes
The table reporter creates one row per
AllocationRecordbut only displays the top stack frame (max_stacks=1). Records with different full call stacks that map to the same displayed top frame appeared as duplicate rows in the HTML table.This change aggregates records in
TableReporter.from_snapshot()by their displayed key(tid, allocator, top_frame), summingsizeandn_allocations. No data is lost — the totals are preserved exactly.Additionally, this adds a
--split-threadsoption to thetablecommand, matching theflamegraphreporter's existing flag. By default threads are merged;--split-threadskeeps them separate.Closes: #857
Testing performed
exercise_3/lru_cache.pytutorial: 21 leaked allocation records that previously produced 21 rows (with 18 visual duplicates) now correctly produce 3 deduplicated rows with identical size/allocation totals