Add support for startup profiling
Categories
(DevTools :: Performance Tools (Profiler/Timeline), enhancement, P3)
Tracking
(Not tracked)
People
(Reporter: gregtatum, Unassigned)
References
Details
(Whiteboard: [fxp-profiler])
We should automate the process of doing startup profiling by providing a button in about:profiling.
This was brought up in the add-on as well: https://github.com/firefox-devtools/Gecko-Profiler-Addon/issues/31
Markus wrote
The old add-on's code to handle this is inside main.js, search for profileRestart. Basically, if the environment variable MOZ_PROFILER_STARTUP is set to a non-empty string, the profiler automatically starts itself on initialization, and if the env var MOZ_PROFILER_SHUTDOWN is set to a filename, then the profiler dumps out a profile to that file during shutdown. Restarting Firefox using appStartup.quit(appStartup.eForceQuit | appStartup.eRestart); preserves environment variables.
Comment 1•3 years ago
•
|
||
Let's scope this bug just to startup profiling. We can have a new bug for shutdown profiling.
This should be all we need for startup profiling:
let env = Cc["@mozilla.org/process/environment;1"].getService(Ci.nsIEnvironment);
env.set("MOZ_PROFILER_STARTUP", "1");
Services.startup.quit(Ci.nsIAppStartup.eRestart | Ci.nsIAppStartup.eAttemptQuit);
Comment 2•3 years ago
|
||
Now we just need to find a good spot for the button.
Oh, and for extra credit, we should read the profiler settings and set the other environment variables so that the settings get applied during startup profiling: MOZ_PROFILER_STARTUP_ENTRIES
, MOZ_PROFILER_STARTUP_INTERVAL
, MOZ_PROFILER_STARTUP_FEATURES
, MOZ_PROFILER_STARTUP_FILTERS
Updated•3 years ago
|
Updated•2 years ago
|
Updated•2 years ago
|
Description
•