Closed Bug 1848159 Opened 9 months ago Closed 3 months ago

Allow tracing across navigations

Categories

(DevTools :: Debugger, enhancement)

enhancement

Tracking

(firefox124 fixed)

RESOLVED FIXED
124 Branch
Tracking Status
firefox124 --- fixed

People

(Reporter: ochameau, Assigned: ochameau)

References

(Blocks 1 open bug)

Details

Attachments

(4 files)

For now, the javascript tracer automatically shuts down on navigation.
It would be nice for it to persist across navigations so that we can debug code fired during load.
An alternative which could be helpful would be to allow starting the tracer on load.
This would allow to distinguish code running until unload versus code running from load.

Because the JavaScript tracer is currently running in each process/thread/target actor independently,
it is more complex to make it record across navigations as it may be spawn in a distinct process.

While it is fine for stdout and webconsole outputs (we could just spawn many concurrent tracers in each process),
this is more complex for the experimental "profiler" output.
For now, the profiler output automatically stops on target destruction and will open the profiler result.

By having an option to record on next page load, it prevent starting the tracer and prevent logging traces
for the current WindowGlobal. It should help focus on the new document.
For the profiler output, it prevents having the profiler to show up for the previous WindowGlobal.

Ensure updating the tracing state from the TracerCommand,
so that its internal state is correct whenever we start tracing
via the console or debugger.

Assignee: nobody → poirot.alex
Status: NEW → ASSIGNED

This simplifies toggling the Tracer on all active targets.
But this will be especially useful in the next changeset.
This allows to have two distinct level of enabling:

  • the target configuration
  • the actual start of tracing done by the tracer (on user interaction or next page load)

Doing this allows to distinguish tracer simple enabling,
when "trace on next user interaction" is enabled,
where we can display a badge on the tracer icon to significate it isn't tracing just yet.
And actual start of the tracer, when the first user interaction happens,
where we can remove the badge.

Pushed by apoirot@mozilla.com:
https://hg.mozilla.org/integration/autoland/rev/8c6339deb7e7
[devtools] Synchronize tracer state between console and debugger. r=devtools-reviewers,nchevobbe
https://hg.mozilla.org/integration/autoland/rev/afc06f3b3a4e
[devtools] Use a SessionData/Target configuration to control JavaScript tracer. r=devtools-reviewers,nchevobbe
https://hg.mozilla.org/integration/autoland/rev/4a654c2d8847
[devtools] Introduce an option to start tracing on next page load. r=devtools-reviewers,devtools-backward-compat-reviewers,nchevobbe
https://hg.mozilla.org/integration/autoland/rev/e646ae20be18
[devtools] Use tracing icon for all messages related to the tracing. r=devtools-reviewers,nchevobbe
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: