Closed
Description
It appears impossible to profile the CPU usage of exceptions. There seems to be some issue with stack walking.
while (true)
{
try
{
var reader = new Utf8JsonReader(new byte[] { (byte)'{' });
while (reader.Read()) ;
}
catch
{
}
}
Process Explorer shows a truncated stack with unusual 0x0000 entries:
PerfView loses track of where the time is spent:
Note, that 95% of the time is unaccounted for and it appears as if JSON code calls into Main
.
DotTrace shows a lot of time spent in "Unsafe Stack Walking" but in the wrong place:
There might be some quicks in how the tools are functioning. But it seems that the basic stack walking data available to profilers is broken.
Environment:
- In 3.0.100-preview7-012821
- Windows 10
- Latest Windows SDK for dbghelp.dll
- Latest PerfView