Skip to content

Chromium trace file format exporter#1113

Merged
brianrob merged 8 commits into
microsoft:masterfrom
adamsitnik:chromiumTraceFileFormat
Mar 9, 2020
Merged

Chromium trace file format exporter#1113
brianrob merged 8 commits into
microsoft:masterfrom
adamsitnik:chromiumTraceFileFormat

Conversation

@adamsitnik
Copy link
Copy Markdown
Member

While working on improving our results in TechEmpower I realized that we don't have any way of visualizing the work of all CPUs on a single screen using Linux. Speedscope is great, but it has a per-thread view and it's hard to diagnose threading issues. I was basically missing VS Concurrency Visualizer on Linux.

I've reminded myself about the work @josalem did in dotnet/diagnostics#447 (comment) to implement an exporter to Chromium Trace Event File format.

By using it I was able to quickly identify one major bottleneck and improve almost all TechEmpower benchmarks by 2-10% RPS (including the super-optimized Plaintext).

obraz

obraz

How to use it:

  1. In PerfView, choose "File => Save View As => Chromium Trace Event" and export the trace file.

obraz

  1. Go to chromium and type chrome://tracing/ (or edge://tracing/ if you are using latest Edge)

  2. Choose "Load" from the top left corner, select the exported trace file and click open

obraz

  1. Enjoy

obraz

An alternative: Go to Chromium, press F12 (to open Developer Tools) and choose "Load profile" from top left corner:

obraz

The Trace Event Format is very similar to speedscope and I was able to reuse 95% of speedscope exporter code and just extend it with the missing 5%.

This PR combined with #1112 is going to allow me to extend dotnet trace with the possibility to convert .nettrace and .trace.zip files to the new file format and improve our user experience on Linux.

/cc @brianrob @tmds @noahfalk

@josalem
Copy link
Copy Markdown
Contributor

josalem commented Mar 6, 2020

This is phenomenal @adamsitnik! I'm happy to see that experiment prove helpful 😃

CC - @tommcdon @sywhang: this will be a great new way to view traces on non-Windows (and Windows for that matter) platforms.

@brianrob
Copy link
Copy Markdown
Member

brianrob commented Mar 6, 2020

@adamsitnik this is great. Does the chromium view show you stacks?

@adamsitnik
Copy link
Copy Markdown
Member Author

Does the chromium view show you stacks?

Yes, when I select something from the graph (every sample is represented as event and it's clickable) in the edge://tracing/ it shows a simple call stack:

obraz

The "DevTools View" (F12) can also show it, but it requires the user to expand the call stack manually by clicking on the arrow ;/

obraz

Also, if you zoom in the time you can see method names:

obraz

@brianrob
Copy link
Copy Markdown
Member

brianrob commented Mar 6, 2020

That's awesome! Let me take a look at the code diff here and get back to you.

Comment thread src/TraceEvent/Stacks/ChromiumStackSourceWriter.cs Outdated
Copy link
Copy Markdown
Member

@brianrob brianrob left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM. Thanks @adamsitnik!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants