Closed Bug 1702310 Opened 4 years ago Closed 3 years ago

Add an easy way to generate a marker-only profile from a try task

Categories

(Core :: Gecko Profiler, enhancement, P3)

enhancement

Tracking

()

RESOLVED FIXED
90 Branch
Tracking Status
firefox90 --- fixed

People

(Reporter: sfink, Assigned: sfink)

References

(Blocks 1 open bug)

Details

Attachments

(1 file)

(Perhaps the wrong component?)

I would like to try to start using the profiler for (1) tracking down performance regressions in {talos,raptor,browsertime} that are hard to see with full profiler overhead, and (2) one-off measurements that can be easily embedded in code and sent off to the try server.

For both, it would be very helpful to be able to run the profiler in marker-only mode without having to do things like hack raptor/browsertime/base.py.

Assignee: nobody → sphink
Status: NEW → ASSIGNED

Thanks :sfink this is awesome! I think these bugs may be potential duplicates, or at least related: bug 1465922, bug 1584982, bug 1545386, bug 1640905. Feel free to update those as appropriate.

(In reply to Dave Hunt [:davehunt] [he/him] ⌚GMT from comment #2)

Thanks :sfink this is awesome! I think these bugs may be potential duplicates, or at least related: bug 1465922, bug 1584982, bug 1545386, bug 1640905. Feel free to update those as appropriate.

My ever-expanding patch definitely covers some of that, but perhaps not all. Once I get it working with gecko-profile-features, I'll test to see what else I might have enabled along the way and mark the duplicates accordingly. (At one or two places in my patch, I brought along some of the other settings as well, but so far I've only been testing to ensure I didn't break anything.) I'm doing this in a pretty cargo-cult manner; I don't really understand most of the code I'm modifying, just mindlessly searching for keywords and then debugging when things still don't work.

Attachment #9212889 - Attachment description: Bug 1702310 - Add --gecko-profile-features option to `mach try fuzzy` to make it easier to generate marker-only profiles → Bug 1702310 - Add --gecko-profile-features and similar options to `mach try fuzzy` to make it easier to generate marker-only profiles, configure threads and sampling interval, etc.

Ok, it looks like :sparky is going to accept it in close to its current form, and I expanded it to cover some of those other bugs, so I'll start marking duplicates.

Attachment #9212889 - Attachment description: Bug 1702310 - Add --gecko-profile-features and similar options to `mach try fuzzy` to make it easier to generate marker-only profiles, configure threads and sampling interval, etc. → Bug 1702310 - Add --gecko-profile-features and similar options to `mach try fuzzy` and `mach raptor` etc. to make it easier to generate marker-only profiles, configure threads and sampling interval, etc.
Pushed by sfink@mozilla.com: https://hg.mozilla.org/integration/autoland/rev/aab899c222a0 Add --gecko-profile-features and similar options to `mach try fuzzy` and `mach raptor` etc. to make it easier to generate marker-only profiles, configure threads and sampling interval, etc. r=perftest-reviewers,sparky
Flags: needinfo?(sphink)

I found time to look at this.

An update: the problem in the above push seems to be that --gecko-interval defaults to 0, which is not None, and so the gecko profiler is turned on for jobs that don't pass any of that flags. Oops. I was only testing jobs where I passed a bare --gecko-profile and jobs where I passed both --gecko-profile-threads and --gecko-profile-features, not jobs where I didn't pass anything. Oops again. (Also, I only tested on Linux, and the incorrectly profiled jobs don't crash there to make it obvious. On Windows, everything falls apart for some reason.)

I've fixed that, but I'm noticing a second issue: on Windows at least, passing --gecko-profile-threads=MainThread,Compositor,DOM Worker,Renderer is resulting in the threads ["MainThread", "Compositor", "DOM"]. It must be splitting a command line on the space character. So I still need to fix that before trying to re-land. It is possible that it is a pre-existing bug, but at the very least this patch would expose it much more easily.

Oh, the incorrectly split string seems to be happening in run-task or perhaps even what calls it?

Executing command 0: C:/mozilla-build/python3/python3.exe run-task -- c:\mozilla-build\python3\python3.exe -u mozharness\scripts\talos_script.py --cfg mozharness\configs\talos\windows_config.py --suite=damp --use-talos-json --setpref=media.peerconnection.mtransport_process=false --setpref=network.process.enabled=false --gecko-profile --gecko-profile-threads=GeckoMain,Compositor,DOM Worker,Renderer --gecko-profile-features=nostacksampling,threads,leaf,cpu --download-symbols ondemand
...
executing ['c:\\mozilla-build\\python3\\python3.exe', '-u', 'mozharness\\scripts\\talos_script.py', '--cfg', 'mozharness\\configs\\talos\\windows_config.py', '--suite=damp', '--use-talos-json', '--setpref=media.peerconnection.mtransport_process=false', '--setpref=network.process.enabled=false', '--gecko-profile', '--gecko-profile-threads=GeckoMain,Compositor,DOM', 'Worker,Renderer', '--gecko-profile-features=nostacksampling,threads,leaf,cpu', '--download-symbols', 'ondemand']

Filed bug 1707625 for the unfortunate Windows splitting issue. (There's a workaround in the current patch here.)

Flags: needinfo?(sphink)
Pushed by sfink@mozilla.com: https://hg.mozilla.org/integration/autoland/rev/0281c1289545 Add --gecko-profile-features and similar options to `mach try fuzzy` and `mach raptor` etc. to make it easier to generate marker-only profiles, configure threads and sampling interval, etc. r=perftest-reviewers,sparky
Status: ASSIGNED → RESOLVED
Closed: 3 years ago
Resolution: --- → FIXED
Target Milestone: --- → 90 Branch
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: