-
Notifications
You must be signed in to change notification settings - Fork 358
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
[dotnet trace] Add Chromium Trace Event file format to list of supported formats #894
Conversation
I just release TraceEvent 2.0.50. It is now available on GitHub and should be available on NuGet within the hour: https://www.nuget.org/packages/Microsoft.Diagnostics.Tracing.TraceEvent/2.0.50. |
/azp run |
Commenter does not have sufficient privileges for PR 894 in repo dotnet/diagnostics |
…void "Could not load file or assembly” error
@@ -13,6 +13,7 @@ | |||
<PackageReference Include="System.CommandLine.Experimental" Version="$(SystemCommandLineExperimentalVersion)" /> | |||
<PackageReference Include="System.CommandLine.Rendering" Version="$(SystemCommandLineRenderingVersion)" /> | |||
<PackageReference Include="Microsoft.Diagnostics.Tracing.TraceEvent" Version="$(MicrosoftDiagnosticsTracingTraceEventVersion)" /> | |||
<PackageReference Include="System.Runtime.CompilerServices.Unsafe" Version="4.7.0" /> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Without this change I was getting following error:
PS C:\Projects\diagnostics\src\Tools\dotnet-trace> dotnet run -c Release convert --format chromium
Writing: C:\Projects\diagnostics\src\Tools\dotnet-trace\trace.chromium.json
System.IO.FileNotFoundException: Could not load file or assembly 'System.Runtime.CompilerServices.Unsafe, Version=4.0.4.1, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a'. The system cannot find the file specified.
File name: 'System.Runtime.CompilerServices.Unsafe, Version=4.0.4.1, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a'
at Microsoft.Diagnostics.Tracing.TraceEventRawReaders.ReadInt32(IntPtr pointer, Int32 offset)
at Microsoft.Diagnostics.Tracing.Etlx.TraceLog.<>c__DisplayClass82_0.<SetupCallbacks>b__36(GCMarkWithTypeTraceData data)
at Microsoft.Diagnostics.Tracing.TraceEventDispatcher.DoDispatch(TraceEvent anEvent)
at Microsoft.Diagnostics.Tracing.EventPipeEventSource.DispatchEventRecord(EVENT_RECORD* eventRecord)
at Microsoft.Diagnostics.Tracing.EventPipeEventSource.EventCache_OnEvent(EventPipeEventHeader& header)
at Microsoft.Diagnostics.Tracing.EventPipe.EventCache.SortAndDispatch(Int64 stopTimestamp)
at Microsoft.Diagnostics.Tracing.EventPipe.EventCache.ProcessEventBlock(Byte[] eventBlockData)
at Microsoft.Diagnostics.Tracing.EventPipeBlock.FromStream(Deserializer deserializer)
at FastSerialization.Deserializer.ReadObjectDefinition(Tags tag, StreamLabel objectLabel)
at FastSerialization.Deserializer.ReadObject()
at Microsoft.Diagnostics.Tracing.EventPipeEventSource.Process()
at Microsoft.Diagnostics.Tracing.Etlx.TraceLog.CopyRawEvents(TraceEventDispatcher rawEvents, IStreamWriter writer)
at Microsoft.Diagnostics.Tracing.Etlx.TraceLog.<>c__DisplayClass118_0.<FastSerialization.IFastSerializable.ToStream>b__0()
at FastSerialization.DeferedRegion.Write(Serializer serializer, Action toStream)
at Microsoft.Diagnostics.Tracing.Etlx.TraceLog.FastSerialization.IFastSerializable.ToStream(Serializer serializer)
at FastSerialization.Serializer.WriteObjectData(IFastSerializable obj, Tags beginTag)
at FastSerialization.Serializer.WriteObjectRef(IFastSerializable obj, Boolean defered)
at FastSerialization.Serializer..ctor(IStreamWriter writer, IFastSerializable entryObject)
at Microsoft.Diagnostics.Tracing.Etlx.TraceLog.CreateFromEventPipeEventSources(TraceEventDispatcher source, String etlxFilePath, TraceLogOptions options)
at Microsoft.Diagnostics.Tracing.Etlx.TraceLog.CreateFromEventPipeDataFile(String filePath, String etlxFilePath, TraceLogOptions options)
at Microsoft.Diagnostics.Tools.Trace.TraceFileFormatConverter.Convert(TraceFileFormat format, String fileToConvert, String outputFilename, Boolean continueOnError) in C:\Projects\diagnostics\src\Tools\dotnet-trace\TraceFileFormatConverter.cs:line 68
at Microsoft.Diagnostics.Tools.Trace.TraceFileFormatConverter.ConvertToFormat(TraceFileFormat format, String fileToConvert, String outputFilename) in C:\Projects\diagnostics\src\Tools\dotnet-trace\TraceFileFormatConverter.cs:line 42
When I include the lastest version of the package in explicit way, the problem is gone.
# Conflicts: # eng/Versions.props
Thanks Adam!! Really excited to see this :) |
This is awesome! ❤️ 🚀 |
@adamsitnik, it looks like you tripped over a bug in the TraceEvent package authoring since version 2.0.50 adds a new dependency on System.Runtime.CompilerServices.Unsafe. The dependency was added but it is not expressed in the nuspec file. I have posted microsoft/perfview#1118 to fix this. |
@brianrob nice catch! I assumed that this is some dotnet cli|MSBuild error and just worked around. It's great that you have provided a clean fix. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🚀 Awesome stuff @adamsitnik! @brianrob is it worth waiting for your nuspec update release of TraceEvent to merge this?
If you can, that would be great. That way we confirm this issue is fixed for everyone. I should have this wrapped up later today. |
I just posted https://www.nuget.org/packages/Microsoft.Diagnostics.Tracing.TraceEvent/2.0.51 which contains the dependency fix. It should be available within the hour and should allow you to revert the extra dependency here. |
@josalem I've updated the TraceEvent version, reverted the workaround and tested it locally. Everything works as expected, the PR is ready to be merged ;) |
It seems like it always shows 17ms as the trace runtime and leaves off most of the user code calls? Are you guys experiencing this at all. To reproduce dotnet trace collect -p 49940 --format chromium, chrome://tracing load. I see the calls show up in the json but not on the viewer |
Hi @jnuic7
|
Hey Adam, apologies was just giving a rough example by giving that process id and appreciate the quick response. Was just checking to see if you guys have run into this issue but I will open an issue |
Just added an issue #1315. Any help is greatly appreciate and looking forward to being able to use this tool for perf profiling |
This is a continuation of microsoft/perfview#1113
The only thing I was not sure was whether we should compress the file by default or not. There are two ways of opening the trace file in chromium browsers and only one supports compressed files:
chrome://tracing
oredge://tracing/
- it supports compressed filesDevTools
(F12 in chromium based formats) - it does not support compressed files and IMHO has better visualization capabilities thantracing
viewI am open to suggestions and changing it to always compress the file. Or perhaps in the future we should add an extra argument to the
convert
command that would control the compression?The CI is going to be red until a new version (2.0.50) of
TraceEvent
is pushed to nuget.org which should happen soon (@brianrob has already bumped the version numbers in perfview repo microsoft/perfview@2c8fd78)I have tested it locally against a local build of TraceEvent.
Fixes #447
/cc @josalem @tmds @noahfalk