- 
                Notifications
    
You must be signed in to change notification settings  - Fork 5.2k
 
[cDAC] Remaining GC data APIs #119324
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
          
     Merged
      
      
            max-charlamb
  merged 17 commits into
  dotnet:main
from
max-charlamb:cdac-dynamicadaptationmode
  
      
      
   
  Sep 22, 2025 
      
    
  
     Merged
                    [cDAC] Remaining GC data APIs #119324
Changes from all commits
      Commits
    
    
            Show all changes
          
          
            17 commits
          
        
        Select commit
          Hold shift + click to select a range
      
      338ba79
              
                ISOSDacInterface16::GetGCDynamicAdaptationMode
              
              
                max-charlamb 40cd236
              
                more GC api work
              
              
                max-charlamb 2e9cbb1
              
                HeapAnalyze
              
              
                max-charlamb 51e7545
              
                Implement GCInterestingInfoData APIs
              
              
                max-charlamb a06c5bb
              
                implement HeapSegmentData
              
              
                max-charlamb 93b18a9
              
                fix GetGCDynamicAdaptationMode
              
              
                max-charlamb 183d35c
              
                fix assert
              
              
                max-charlamb a1a032b
              
                fix
              
              
                max-charlamb d5bf8c2
              
                Merge branch 'main' into cdac-dynamicadaptationmode
              
              
                max-charlamb e3e0ddc
              
                Merge branch 'cdac-dynamicadaptationmode' of github.com:max-charlamb/…
              
              
                max-charlamb 9524a93
              
                update docs
              
              
                max-charlamb 22e03de
              
                finish docs
              
              
                max-charlamb e645e66
              
                rename OOM -> Oom
              
              
                max-charlamb 9888940
              
                rename APIs using overloading
              
              
                max-charlamb 4f79948
              
                copilot comments
              
              
                max-charlamb f361a80
              
                Update docs/design/datacontracts/GC.md
              
              
                max-charlamb 906f3e7
              
                Merge remote-tracking branch 'origin/main' into cdac-dynamicadaptatio…
              
              
                max-charlamb File filter
Filter by extension
Conversations
          Failed to load comments.   
        
        
          
      Loading
        
  Jump to
        
          Jump to file
        
      
      
          Failed to load files.   
        
        
          
      Loading
        
  Diff view
Diff view
There are no files selected for viewing
Large diffs are not rendered by default.
      
      Oops, something went wrong.
      
    
  
  
    
      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
    
  
  
    
              
  
    
      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
    
  
  
    
              
  
    
      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
    
  
  
    
              
  
    
      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
    
  
  
    
              | Original file line number | Diff line number | Diff line change | 
|---|---|---|
| 
          
            
          
           | 
    @@ -140,4 +140,6 @@ public enum DataType | |
| GCHeap, | ||
| Generation, | ||
| CFinalize, | ||
| HeapSegment, | ||
| OomHistory, | ||
| } | ||
  
    
      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
    
  
  
    
              
            File renamed without changes.
          
    
        
          
          
            60 changes: 60 additions & 0 deletions
          
          60 
        
  ...managed/cdac/Microsoft.Diagnostics.DataContractReader.Contracts/Contracts/GC/GCHeapWKS.cs
  
  
      
      
   
        
      
      
    
  
    
      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
    
  
  
    
              | Original file line number | Diff line number | Diff line change | 
|---|---|---|
| @@ -0,0 +1,60 @@ | ||
| // Licensed to the .NET Foundation under one or more agreements. | ||
| // The .NET Foundation licenses this file to you under the MIT license. | ||
| 
     | 
||
| namespace Microsoft.Diagnostics.DataContractReader.Contracts.GCHelpers; | ||
| 
     | 
||
| internal sealed class GCHeapWKS : IGCHeap | ||
| { | ||
| public GCHeapWKS(Target target) | ||
| { | ||
| MarkArray = target.ReadPointer(target.ReadGlobalPointer(Constants.Globals.GCHeapMarkArray)); | ||
| NextSweepObj = target.ReadPointer(target.ReadGlobalPointer(Constants.Globals.GCHeapNextSweepObj)); | ||
| BackgroundMinSavedAddr = target.ReadPointer(target.ReadGlobalPointer(Constants.Globals.GCHeapBackgroundMinSavedAddr)); | ||
| BackgroundMaxSavedAddr = target.ReadPointer(target.ReadGlobalPointer(Constants.Globals.GCHeapBackgroundMaxSavedAddr)); | ||
| AllocAllocated = target.ReadPointer(target.ReadGlobalPointer(Constants.Globals.GCHeapAllocAllocated)); | ||
| EphemeralHeapSegment = target.ReadPointer(target.ReadGlobalPointer(Constants.Globals.GCHeapEphemeralHeapSegment)); | ||
| CardTable = target.ReadPointer(target.ReadGlobalPointer(Constants.Globals.GCHeapCardTable)); | ||
| FinalizeQueue = target.ReadPointer(target.ReadGlobalPointer(Constants.Globals.GCHeapFinalizeQueue)); | ||
| GenerationTable = target.ReadGlobalPointer(Constants.Globals.GCHeapGenerationTable); | ||
| 
     | 
||
| if (target.TryReadGlobalPointer(Constants.Globals.GCHeapSavedSweepEphemeralSeg, out TargetPointer? savedSweepEphemeralSegPtr)) | ||
| SavedSweepEphemeralSeg = target.ReadPointer(savedSweepEphemeralSegPtr.Value); | ||
| if (target.TryReadGlobalPointer(Constants.Globals.GCHeapSavedSweepEphemeralStart, out TargetPointer? savedSweepEphemeralStartPtr)) | ||
| SavedSweepEphemeralStart = target.ReadPointer(savedSweepEphemeralStartPtr.Value); | ||
| 
     | 
||
| OomData = target.ProcessedData.GetOrAdd<Data.OomHistory>(target.ReadGlobalPointer(Constants.Globals.GCHeapOomData)); | ||
| 
     | 
||
| InternalRootArray = target.ReadPointer(target.ReadGlobalPointer(Constants.Globals.GCHeapInternalRootArray)); | ||
| InternalRootArrayIndex = target.ReadNUInt(target.ReadGlobalPointer(Constants.Globals.GCHeapInternalRootArrayIndex)); | ||
| HeapAnalyzeSuccess = target.Read<int>(target.ReadGlobalPointer(Constants.Globals.GCHeapHeapAnalyzeSuccess)) != 0; | ||
| 
     | 
||
| InterestingData = target.ReadGlobalPointer(Constants.Globals.GCHeapInterestingData); | ||
| CompactReasons = target.ReadGlobalPointer(Constants.Globals.GCHeapCompactReasons); | ||
| ExpandMechanisms = target.ReadGlobalPointer(Constants.Globals.GCHeapExpandMechanisms); | ||
| InterestingMechanismBits = target.ReadGlobalPointer(Constants.Globals.GCHeapInterestingMechanismBits); | ||
| } | ||
| 
     | 
||
| public TargetPointer MarkArray { get; } | ||
| public TargetPointer NextSweepObj { get; } | ||
| public TargetPointer BackgroundMinSavedAddr { get; } | ||
| public TargetPointer BackgroundMaxSavedAddr { get; } | ||
| public TargetPointer AllocAllocated { get; } | ||
| public TargetPointer EphemeralHeapSegment { get; } | ||
| public TargetPointer CardTable { get; } | ||
| public TargetPointer FinalizeQueue { get; } | ||
| public TargetPointer GenerationTable { get; } | ||
| 
     | 
||
| public TargetPointer? SavedSweepEphemeralSeg { get; } | ||
| public TargetPointer? SavedSweepEphemeralStart { get; } | ||
| 
     | 
||
| public Data.OomHistory OomData { get; } | ||
| 
     | 
||
| public TargetPointer InternalRootArray { get; } | ||
| public TargetNUInt InternalRootArrayIndex { get; } | ||
| public bool HeapAnalyzeSuccess { get; } | ||
| 
     | 
||
| public TargetPointer InterestingData { get; } | ||
| public TargetPointer CompactReasons { get; } | ||
| public TargetPointer ExpandMechanisms { get; } | ||
| public TargetPointer InterestingMechanismBits { get; } | ||
| } | ||
      
      Oops, something went wrong.
        
    
  
      
      Oops, something went wrong.
        
    
  
  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.
  
    
  
    
Uh oh!
There was an error while loading. Please reload this page.