I tried to use dotnet-trace with WSL Ubuntu 18.04 and .NET Core 3.1.300 in my project. I have chosen speedscope output, and I do get trace.speedscope.json file, but it does not open in https://www.speedscope.app/ and browser's Javascript console gives following error:
Failed to load format Error: Tried to leave frame "System.Console!System.ConsolePal.Write(class Microsoft.Win32.SafeHandles.SafeFileHandle,unsigned int8*,int32,bool)" while frame "System.Console!System.ConsolePal.Read(class Microsoft.Win32.SafeHandles.SafeFileHandle,unsigned int8[],int32,int32)" was at the top at 5.2182000003814695
at n._leaveFrame (speedscope.ca4dd7be.js:156)
at n.leaveFrame (speedscope.ca4dd7be.js:156)
at speedscope.ca4dd7be.js:162
at a (speedscope.ca4dd7be.js:162)
at speedscope.ca4dd7be.js:162
at Array.map ()
at s (speedscope.ca4dd7be.js:162)
at import.67a00871.js:111
at Generator.next ()
at s (import.67a00871.js:111)
How to replicate:
dotnet run -c release < /dev/zero > /dev/nulldotnet-trace psdotnet-trace collect --process-id PID_HERE --format speedscopeSpeedscope tracing works OK in another project of mine
@josalem
Looks like this is an error caused by a recent change in Speedscope (jlfwong/speedscope#273) that decided to change behavior and fail hard on some ordering constraints. I'll take a look at our logic for conversion over in Microsoft/PerfView and see if I can figure out what causes the ordering issue.
CC @adamsitnik
Issue in Microsoft/PerfView: microsoft/perfview#1178.
Based on the comments here, it looks like we should be able to fix this by picking up the newest TraceEvent version.
I've provided a fix https://github.com/microsoft/perfview/pull/1212
Thanks for fixing it!
Is there any schedule for a release that would include this patch?
I've provided a fix microsoft/perfview#1212
Thank you for fixing the problem. However, how do I make use of the fix as I am still getting the error? More details of the error here: https://stackoverflow.com/questions/63020262/why-does-tracing-c-sharp-code-in-linux-fail-when-imported-into-speedscope
I believe this fix is in the most recent release: https://github.com/dotnet/diagnostics/releases/tag/3.1.137102
Yes, it works! 馃殌
Most helpful comment
I've provided a fix https://github.com/microsoft/perfview/pull/1212