Open Bug 1849974 Opened 1 year ago Updated 1 year ago

Export tracing session into a JSON file that the Profiler UI can consume

Categories

(DevTools :: Debugger, enhancement)

enhancement

Tracking

(Not tracked)

People

(Reporter: nchevobbe, Unassigned)

References

Details

Attachments

(1 file)

This would help developer share the tracer and investigate issues, similarly to performance profiles.

The WebCompat team would find this quite helpful, and the Profiler team told us it would be quite simple to consume such file.

I've been suggested by Julien to look at:
https://github.com/firefox-devtools/profiler/blob/17c4918daba1c2c4ed5f973b748009302e04fc5a/src/profile-logic/import/chrome.js#L487
and:
https://github.com/firefox-devtools/profiler/blob/main/src/profile-logic/data-structures.js
to learn how to craft a profiler's profile.

Otherwise, on the tracer side, we can see the type of data we get to qualify a frame:
https://searchfox.org/mozilla-central/rev/4e22b886bbd4c274f268c4a285ab7da00e95c99b/devtools/server/tracer/tracer.jsm#236-253
script.source.url will be the url of the js file running
and lineNumber / columnNumber the location of the frame that just ran.
I imagine it should be already enough to compute a profile?
The tracer is per thread, so we wouldn't be able to easily compute a multi-thread record.
At least, we should try to generated a mono-thread record as a first step.

I tweaked the pref so that tracing is enabled by default and automatically set to record to the profiler.
The tracer can be toggled on/off via Ctrl+Shift+5 or via the bold round icon on top right of the debugger.

You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: