Add GetStressLogMemoryRanges to ISOSDacInterface17#130038
Conversation
Adds a new GetStressLogMemoryRanges method to ISOSDacInterface17 that enumerates the memory ranges (chunks) backing the stress log, returned as an ISOSMemoryEnum. - sospriv.idl: declare the new interface method. - IStressLog contract: add StressLogMemoryRange record and GetStressLogMemoryRanges contract API. - StressLog contract implementation: enumerate stress log chunks using the existing StressLogMemory processed data, sized by the StressLogChunk type, and surface them through StressLog_1/StressLog_2. - SOSDacImpl: implement ISOSDacInterface17.GetStressLogMemoryRanges, projecting the ranges into SOSMemoryRegion entries; add a SOSMemoryEnum constructor taking a precomputed region array. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
There was a problem hiding this comment.
Pull request overview
Adds a new SOS DAC entrypoint to enumerate the in-memory StressLog backing chunks as ISOSMemoryEnum, wiring it through the cDAC StressLog contract and exposing the COM signature via sospriv.idl.
Changes:
- Extend
ISOSDacInterface17withGetStressLogMemoryRangesreturning anISOSMemoryEnumofSOSMemoryRegionranges. - Add a StressLog contract API (
StressLogMemoryRange+GetStressLogMemoryRanges) and implement it for bothStressLog_1andStressLog_2via existing processed StressLog chunk traversal. - Add a
SOSMemoryEnumconstructor that accepts a precomputedSOSMemoryRegion[]to project contract ranges efficiently.
Reviewed changes
Copilot reviewed 5 out of 5 changed files in this pull request and generated 2 comments.
Show a summary per file
| File | Description |
|---|---|
| src/native/managed/cdac/Microsoft.Diagnostics.DataContractReader.Legacy/SOSDacImpl.cs | Implements ISOSDacInterface17.GetStressLogMemoryRanges and adds a SOSMemoryEnum(SOSMemoryRegion[]) constructor to return regions. |
| src/native/managed/cdac/Microsoft.Diagnostics.DataContractReader.Legacy/ISOSDacInterface.cs | Adds the managed COM interface declaration for GetStressLogMemoryRanges. |
| src/native/managed/cdac/Microsoft.Diagnostics.DataContractReader.Contracts/Contracts/StressLog.cs | Implements GetStressLogMemoryRanges by enumerating StressLog chunks and surfacing it from both contract versions. |
| src/native/managed/cdac/Microsoft.Diagnostics.DataContractReader.Abstractions/Contracts/IStressLog.cs | Introduces StressLogMemoryRange and a new IStressLog.GetStressLogMemoryRanges API. |
| src/coreclr/inc/sospriv.idl | Adds the new ISOSDacInterface17::GetStressLogMemoryRanges method signature. |
Copilot Code ReviewHolistic AssessmentMotivation: Justified — diagnostic tools need a way to enumerate stress log memory regions, not just check point containment. The existing Approach: Sound. The implementation reuses the existing Summary: Detailed FindingsDetailed Findings✅ Contract Implementation — Correct and consistentThe ✅ SOSDacImpl wiring — Follows established patterns
✅ IDL & interface ordering — CorrectThe new
|
|
Tagging subscribers to this area: @steveisok, @tommcdon, @dotnet/dotnet-diag |
Summary
Adds
GetStressLogMemoryRangestoISOSDacInterface17. This interface has not been used by shipping products so I'm okay with this breaking change. The method enumerates the memory ranges (chunks) that back the in-memory stress log and returns them as anISOSMemoryEnum, so diagnostic tools can discover and read stress-log memory regions. This functionality wasn't required by SOS, but is exposed by CLRMD.Changes
sospriv.idl-- declareHRESULT GetStressLogMemoryRanges([out] ISOSMemoryEnum **ppEnum)onISOSDacInterface17.IStressLog(Abstractions) -- add aStressLogMemoryRange(TargetPointer Start, ulong Size)record and aGetStressLogMemoryRanges(StressLogData)contract API.StressLogcontract -- implement the API by enumerating the stress log chunks from the existingStressLogMemoryprocessed data, sized by theStressLogChunktype; surfaced through bothStressLog_1andStressLog_2.SOSDacImpl-- implementISOSDacInterface17.GetStressLogMemoryRanges, projecting the contract ranges intoSOSMemoryRegionentries; add aSOSMemoryEnumconstructor that takes a precomputed region array.