Add live allocation diagnostics#447
Merged
Merged
Conversation
Benchmark results for collatzParameters
SummaryFound 0 performance improvements and 0 performance regressions! Performance is the same for 1 metrics, 0 unstable metrics. See unchanged results
|
Benchmark results for BadBoggleSolver_runParameters
SummaryFound 0 performance improvements and 0 performance regressions! Performance is the same for 1 metrics, 0 unstable metrics. See unchanged results
|
nsavoire
force-pushed
the
nsavoire/add_live_alloc_diagnostics
branch
from
October 13, 2025 10:54
13ceda7 to
9e75ba3
Compare
nsavoire
force-pushed
the
nsavoire/add_live_alloc_diagnostics
branch
from
October 13, 2025 11:38
9e75ba3 to
e166a13
Compare
nsavoire
force-pushed
the
nsavoire/add_live_alloc_diagnostics
branch
from
October 13, 2025 11:42
e166a13 to
03acfa5
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.
Description
This PR enhances the live allocation profiling system with comprehensive diagnostic capabilities to better track and troubleshoot allocation/deallocation mismatches and data loss.
Key Changes:
1. New Performance Event Types
PERF_CUSTOM_EVENT_LOST_ALLOCATIONto track lost allocation and deallocation events separatelyPERF_CUSTOM_EVENT_ALLOCATION_TRACKER_STATEto periodically report the allocation tracker's internal state2. Enhanced Event Structures
LostAllocationEvent: Replaces generic lost events with separate counters forlost_alloc_countandlost_dealloc_countAllocationTrackerStateEvent: Reportstracked_addresse_countandaddress_conflict_countfrom the library3. Improved Statistics Tracking
EVENT_DEALLOC_LOSTstat to separately track lost deallocation eventsALREADY_EXISTING_ALLOCATION_COUNTstat to count duplicate allocations at the same address (indicating missed free events)4. Allocation Tracker Enhancements
lost_countinto separatelost_alloc_countandlost_dealloc_countatomics for granular trackingaddress_conflict_countto track hash collisions in the address setpush_allocation_tracker_state()to periodically report library state to the profiler5. Live Allocation Diagnostics
register_library_state()method to synchronize library state with profiler's viewaddress_conflict_countandtracked_address_countper PID6. Enhanced Logging and Visibility
register_library_state()showing:_address_map.size())_unique_stacks.size())_tracked_address_count)_address_conflict_count)Benefits:
These diagnostics provide better visibility into allocation tracking health, making it easier to identify when events are lost, when allocations/deallocations are mismatched, and when the library and profiler states diverge. This is crucial for debugging live heap profiling in production environments.