[Profiler] Collect eeheap equivalent #8843
Conversation
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 871ab6b7d6
ℹ️ About Codex in GitHub
Codex has been enabled to automatically review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".
| void EnumerateGcMemoryRegions(ISOSDacInterface* sos, std::vector<ClrNativeHeapInfo>& results) | ||
| { | ||
| ISOSDacInterface13* sos13 = nullptr; | ||
| if (FAILED(sos->QueryInterface(__uuidof(ISOSDacInterface13), reinterpret_cast<void**>(&sos13))) || sos13 == nullptr) |
There was a problem hiding this comment.
Define the Linux IID before querying interface 13
On non-Windows builds, the PAL headers define __uuidof(T) as IID_T; this new call therefore requires an IID_ISOSDacInterface13 symbol, but DacInterface13.h only declares the interface and does not define that IID. Because the Linux CMake target globs this common .cpp, enabling the DAC backend makes Linux profiler builds fail at this line instead of falling back when interface 13 is unavailable.
Useful? React with 👍 / 👎.
| bool LogicalDescriptor::Build(IMemoryReader& reader, uintptr_t rootAddress) | ||
| { | ||
| _reader = &reader; | ||
| if (!Merge(rootAddress, /*isRoot*/ true)) |
There was a problem hiding this comment.
Honor cDAC baseline descriptors before merging deltas
When a .NET 11 in-memory descriptor includes a baseline, this build path only merges the root descriptor and pending sub-descriptors; it never loads and merges the named baseline first. In that case compact descriptors can omit fields/types that the cDAC heap walkers later require via HasType/HasField, so valid runtime descriptors can silently produce incomplete or empty eeheap.json output.
Useful? React with 👍 / 👎.
| auto* segv = ProfilerSignalManager::Get(SIGSEGV); | ||
| if (segv != nullptr) | ||
| { | ||
| segv->RegisterHandler(&MemoryReadFaultHandler); |
There was a problem hiding this comment.
Share the Linux fault handler with existing readers
On Linux, this registers a different SIGSEGV/SIGBUS handler than ReferenceChainTraverser uses, but ProfilerSignalManager only accepts a second registration when it is the same function pointer. If EEHeap and heap-snapshot/reference-chain traversal are enabled in the same process, whichever component starts second silently loses its fault guard; an unmapped read during cDAC/DAC probing can then be passed to the wrong handler and crash the process. Route both readers through a shared handler or make the signal manager multiplex handlers before adding this registration.
Useful? React with 👍 / 👎.
| ? _heapSnapshotManager->GetAndClearReferenceTreeContent() | ||
| : std::vector<IHeapSnapshotManager::FileEntry>{}; | ||
| auto eeHeapContent = (_eeHeapReporter != nullptr) | ||
| ? _eeHeapReporter->GetAndClearEEHeapContent() |
There was a problem hiding this comment.
Defer EEHeap enumeration until a profile will be sent
With EEHeap enabled, GetAndClearEEHeapContent() runs before the exporter knows whether any runtime id has a non-empty profile; keys.empty() only logs and profiles with samplesCount == 0 are skipped later. During idle intervals or endpoint-only entries this still loads the DAC/cDAC backend, flushes/walks CLR heaps, and probes pages, then discards the JSON because no send occurs, adding avoidable in-process pause/CPU cost. Move the call inside the branch that is about to send a non-empty profile, or return early when no profile can be sent.
Useful? React with 👍 / 👎.
BenchmarksBenchmark execution time: 2026-07-03 13:50:15 Comparing candidate commit 38bc13d in PR branch Found 0 performance improvements and 0 performance regressions! Performance is the same for 72 metrics, 0 unstable metrics, 61 known flaky benchmarks, 65 flaky benchmarks without significant changes.
|
Execution-Time Benchmarks Report ⏱️Execution-time results for samples comparing This PR (8843) and master. ✅ No regressions detected - check the details below Full Metrics ComparisonFakeDbCommand
HttpMessageHandler
Comparison explanationExecution-time benchmarks measure the whole time it takes to execute a program, and are intended to measure the one-off costs. Cases where the execution time results for the PR are worse than latest master results are highlighted in **red**. The following thresholds were used for comparing the execution times:
Note that these results are based on a single point-in-time result for each branch. For full results, see the dashboard. Graphs show the p99 interval based on the mean and StdDev of the test run, as well as the mean value of the run (shown as a diamond below the graph). Duration chartsFakeDbCommand (.NET Framework 4.8)gantt
title Execution time (ms) FakeDbCommand (.NET Framework 4.8)
dateFormat x
axisFormat %Q
todayMarker off
section Baseline
This PR (8843) - mean (70ms) : 68, 73
master - mean (72ms) : 69, 75
section Bailout
This PR (8843) - mean (74ms) : 72, 75
master - mean (74ms) : 72, 77
section CallTarget+Inlining+NGEN
This PR (8843) - mean (1,083ms) : 1039, 1127
master - mean (1,082ms) : 1039, 1124
FakeDbCommand (.NET Core 3.1)gantt
title Execution time (ms) FakeDbCommand (.NET Core 3.1)
dateFormat x
axisFormat %Q
todayMarker off
section Baseline
This PR (8843) - mean (110ms) : 106, 114
master - mean (113ms) : 107, 119
section Bailout
This PR (8843) - mean (110ms) : 108, 112
master - mean (110ms) : 108, 113
section CallTarget+Inlining+NGEN
This PR (8843) - mean (779ms) : 761, 797
master - mean (781ms) : 757, 805
FakeDbCommand (.NET 6)gantt
title Execution time (ms) FakeDbCommand (.NET 6)
dateFormat x
axisFormat %Q
todayMarker off
section Baseline
This PR (8843) - mean (99ms) : 93, 105
master - mean (96ms) : 93, 99
section Bailout
This PR (8843) - mean (98ms) : 96, 100
master - mean (98ms) : 95, 100
section CallTarget+Inlining+NGEN
This PR (8843) - mean (943ms) : 905, 981
master - mean (940ms) : 898, 983
FakeDbCommand (.NET 8)gantt
title Execution time (ms) FakeDbCommand (.NET 8)
dateFormat x
axisFormat %Q
todayMarker off
section Baseline
This PR (8843) - mean (96ms) : 92, 100
master - mean (99ms) : 92, 105
section Bailout
This PR (8843) - mean (100ms) : 94, 105
master - mean (96ms) : 93, 100
section CallTarget+Inlining+NGEN
This PR (8843) - mean (812ms) : 774, 850
master - mean (814ms) : 781, 847
HttpMessageHandler (.NET Framework 4.8)gantt
title Execution time (ms) HttpMessageHandler (.NET Framework 4.8)
dateFormat x
axisFormat %Q
todayMarker off
section Baseline
This PR (8843) - mean (204ms) : 199, 209
master - mean (203ms) : 198, 208
section Bailout
This PR (8843) - mean (208ms) : 205, 212
master - mean (206ms) : 202, 210
section CallTarget+Inlining+NGEN
This PR (8843) - mean (1,213ms) : 1174, 1252
master - mean (1,210ms) : 1173, 1246
HttpMessageHandler (.NET Core 3.1)gantt
title Execution time (ms) HttpMessageHandler (.NET Core 3.1)
dateFormat x
axisFormat %Q
todayMarker off
section Baseline
This PR (8843) - mean (291ms) : 286, 296
master - mean (291ms) : 283, 298
section Bailout
This PR (8843) - mean (293ms) : 289, 297
master - mean (294ms) : 289, 298
section CallTarget+Inlining+NGEN
This PR (8843) - mean (973ms) : 950, 996
master - mean (975ms) : 952, 998
HttpMessageHandler (.NET 6)gantt
title Execution time (ms) HttpMessageHandler (.NET 6)
dateFormat x
axisFormat %Q
todayMarker off
section Baseline
This PR (8843) - mean (285ms) : 277, 292
master - mean (286ms) : 278, 294
section Bailout
This PR (8843) - mean (284ms) : 277, 291
master - mean (286ms) : 282, 290
section CallTarget+Inlining+NGEN
This PR (8843) - mean (1,174ms) : 1142, 1205
master - mean (1,171ms) : 1132, 1210
HttpMessageHandler (.NET 8)gantt
title Execution time (ms) HttpMessageHandler (.NET 8)
dateFormat x
axisFormat %Q
todayMarker off
section Baseline
This PR (8843) - mean (284ms) : 278, 291
master - mean (284ms) : 277, 291
section Bailout
This PR (8843) - mean (282ms) : 276, 288
master - mean (284ms) : 278, 290
section CallTarget+Inlining+NGEN
This PR (8843) - mean (1,046ms) : 1009, 1084
master - mean (1,051ms) : 1005, 1097
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
Summary of changes
Collect native memory information
Reason for change
Missing native memory consumption details at the runtime level
Implementation details
Use DAC for .NET Framework, Core up to 10 and cDAC for .NET 11+
Test coverage
Updated
Other details