Chrome Trace Viewer

1,378 views
Skip to first unread message

Brad Hallisey

unread,
Apr 3, 2017, 7:17:08 PM4/3/17
to tra...@chromium.org
Greetings,

I recently ran across the trace viewer in Chrome and I am very excited about it.  Having used RAD Game Tools' Telemetry viewer in the past, I find this form of profiling to be extraordinarily useful.  However, I am having some difficulties in figuring out the formats to make things viewable in Chrome.

I have read through https://docs.google.com/document/d/1CvAClvFfyA5R-PhYUmn5OOQtYMH4h6I0nSsKchNAySU/preview# .  When I generate events in those formats, nothing shows up in Chrome.  I also note that it is from 2013.  Often I get an error message about "Failed to find main browser thread, some features may not be available."  I have also tried recording a trace in Chrome and working backwards from that.  The problem there is a short 1-2s trace generates 10's of thousands of events, which is too much data to sort.  Even some of the unit tests do not appear in Chrome's viewer.

I have noticed that certain "name" tags tend to show up in the trace viewer.  Currently I am using "Parse HTML" and then putting my function names inside that to see my traces.  Functional but not great.  I have been unable to get process wide events to appear, such as frame delimiters.

So, my questions are:  
Is there a way to make Chrome view these elements that are not appearing?  Is there some setting or plug-in I'm missing?
Is there current documentation on the JSON Chrome is looking for, so that I can generate these events?
Are there smaller examples of data that generates a trace in Chrome, that I could work off of?  Ideally it would be complex enough to have multiple threads, asynch events, frame delimiters, etc.  Stack traces are not terribly important as I can parse that out from the viewer.

 
Thank you,
--Brad Hallisey


Here is the minimum set of data that shows a graph in Chrome.
[

{"pid":12444,"tid":11392,"ts":0,"ph":"M","cat":"__metadata","name":"thread_name","args":{"name":"CrRendererMain"}},

{"pid":12444,"tid":4016,"ts":425679545954,"ph":"B","cat":"devtools.timeline","name":"ParseHTML","args":{"beginData": { "url":"Hello Very Long Name"  }}},
{"pid":12444,"tid":4016,"ts":425679546543,"ph":"B","cat":"devtools.timeline","name":"ParseHTML","args":{"beginData": { "url":"Short Name"  }}},
{"pid":12444,"tid":4016,"ts":425679646654,"ph":"E","cat":"devtools.timeline","name":"ParseHTML","args":{"endData":{"endLine":-1}}},
{"pid":12444,"tid":4016,"ts":425689646011,"ph":"E","cat":"devtools.timeline","name":"ParseHTML","args":{"endData":{"endLine":-1}}},


{"pid":12444,"tid":4076,"ts":0,"ph":"M","cat":"__metadata","name":"thread_name","args":{"name":"CrBrowserMain"}},


]




Nat Duca

unread,
Apr 3, 2017, 10:45:02 PM4/3/17
to Brad Hallisey, tracing
Ah, thats quite a complement to have traceviewer compared in the same sentence to rad's stuff. Their stuff is epic.

Anyway, the format doc is actually up to date, but as you note the date on it was never modified. I fixed the error. :)

You might consider this file:

This should load just fine in traceviewer and should give you enough to experiment with. Note, you had a trailing comma in your array, and that may throw off chrome. If it doesn't json parse, then it wont load, is a basic rule of thumb (though there are some corner cases that will still work).


Dumb question: are you using chrome://tracing or the devtools timeline to view the traces? They're not actually the same, though they consume the same file format...


--
You received this message because you are subscribed to the Google Groups "tracing" group.
To unsubscribe from this group and stop receiving emails from it, send an email to tracing+unsubscribe@chromium.org.
To post to this group, send email to tra...@chromium.org.
To view this discussion on the web visit https://groups.google.com/a/chromium.org/d/msgid/tracing/CA%2BNQ1SHke3zN4qGftk9ZB3-s3M-dxBtXUvh%3DnrqLntGSn2Dz5w%40mail.gmail.com.

Nina Bobo

unread,
Dec 14, 2023, 5:33:45 AM12/14/23
to tracing, Nat Duca, tracing, Brad Hallisey

Stephen Nusko

unread,
Dec 14, 2023, 6:45:40 AM12/14/23
to Nina Bobo, tracing, Nat Duca, Brad Hallisey
Just FYI, Chrome://tracing is in maintenance mode, and for the most part Chrome engineers have switched to perfetto, in fact internally all traces are perfetto traces and then we support a legacy best effort conversion to json to keep the Chrome://tracing UI working. Perfetto traces have useful features like SQLite database that you can use to access and query slices, and various other things. And a nice new UI as well at ui.perfetto.dev. It is also a pretty well documented format including how to synthesize it, perhaps that is a good place to start?

Reply all
Reply to author
Forward
0 new messages