CI profile symbolication does not support inlines or the source view - we should use symbolicator-cli for symbolication of Gecko profiles
Categories
(Testing :: Mozbase, defect, P2)
Tracking
(firefox147 fixed)
| Tracking | Status | |
|---|---|---|
| firefox147 | --- | fixed |
People
(Reporter: mstange, Assigned: animalan)
References
(Blocks 4 open bugs)
Details
(Whiteboard: [fxp])
Attachments
(3 files, 1 obsolete file)
This bug is about what to do in CI; see bug 1720356 for what should happen when running tests locally.
Edit 2025-07-25: This bug is now "Use symblicator-cli (being added in bug 1969490) for symbolicating Gecko profiles, too, not just for simpleperf profiles".
Original discussion below.
We have a ProfilerSymbolicator in testing/mozbase/mozgeckoprofiler/ which we use to symbolicate profiles captured with the Gecko profiler, for example the profiles captured during browsertime pageload tests.
This symbolication code is quite old and hasn't kept pace with recent improvements:
- No inline callstacks
- No source view
- No assembly view
Example: https://share.firefox.dev/4kBmPay
The improvements listed above are available when symbolication is performed on profiler.firefox.com by some JS code in symbolication.js. The implementation is quite a bit more complicated than what we have today in the Python code mentioned earlier.
Here's what happens when you capture a profile with the Firefox UI the normal way:
- Firefox produces an unsymbolicated JSON file, in the "gecko profile" format.
- The JSON file is loaded into profiler.firefox.com.
- profiler.firefox.com converts the JSON into the "processed profile" format.
- profiler.firefox.com symbolicates the converted profile, with the help of the symbol server.
To fix this bug, we need to find a way for our in-CI symbolication to share code with profiler.firefox.com. It's not practical to create a second implementation in Python of both profile format conversion and symbolication.
In the profiler repo, there is a symbolicator-cli script which is well-suited for our purposes. It needs to be run with node, and it requires a URL to a symbol server, such as the one that samply runs locally when you do samply load profile.json. If we can find a way to integrate this script into testing CI, it would solve this bug.
| Comment hidden (obsolete) |
| Comment hidden (obsolete) |
| Comment hidden (obsolete) |
| Comment hidden (obsolete) |
| Comment hidden (obsolete) |
| Comment hidden (obsolete) |
Comment 7•6 months ago
|
||
Or we could have a toolchain job in Firefox CI which pulls the profiler repo, does the build, and outputs the compiled symbolicator-cli as an artifact.
this might be easiest (and was the first approach that came to my mind) but I am interested in a case against doing this approach
When deploying the front-end change, we also need to publish a new "compiled" version of symbolicator-cli.
Unless i've misunderstood it sounds like we'd always want the latest revision available at time the symbolicator-cli toolchain is (re)built. So this would be opposite of the browsertime approach where we pin a revision.
I might be oversimplifying in my head, but with this approach we probably don't even need to touch or moidfy testing/mozbase/mozgeckoprofiler/mozgeckoprofiler/ at all as we can just directly invoke the new symbolicator-cli (fetched from the hypothetical toolchain) with a python subprocess command
Also, here I'm assuming that we've already solved the problem of having samply available, but I guess that's a separate challenge still. I think we'd need to download samply with ./mach bootstrap.
We have a samply toolchain now (bug 1967836) just in case you were not aware yet (unless you meant something else by this statement). What/why would we need mach bootstrap?
Comment 8•6 months ago
|
||
but pinning version makes most sense... easier to debug in future
Comment 9•6 months ago
|
||
I am a bit unclear on the N, N+1 thing though
and after talking to sparky, i misspoke, we should update mozgeckoprofiler as many things would be using it (i mistakenly assumed prioritizing simpleperf tasks)
Comment 10•6 months ago
•
|
||
(In reply to Markus Stange [:mstange] from comment #4)
We could store the output on npm, either by manually doing a new release of symbolicator-cli every time we do a deploy, or by adding a github CI job which does a release whenever we merge into the deploy branch.
Or we could have a toolchain job in Firefox CI which pulls the profiler repo, does the build, and outputs the compiled symbolicator-cli as an artifact.
Having a pre-built release that we could pull would make its usage mostly trivial, and it could become a fetch task instead of a toolchain. Although a toolchain might be preferred if we ever need anything special for Mozilla-related tasks.
Where should the build step be performed, and where should the output ("compiled symbolicator-cli") be stored?
We can do the same thing as browsertime where we install directly to the same folder that the mach_commands.py (or install scripts exist in) and add them to the .gitignore/.hgignore files. Alternatively, you can always install to a ~/.mozbuild subfolder.
(In reply to Markus Stange [:mstange] from comment #5)
./mach browsertimeseems usesetup_helperfrom tools/lint/eslint to perform the actualnpm installof the package.json dependencies .So maybe that's all we need?
- Have a new directory to host the
package.jsonwith the dependency on the built symbolicator-cli script, for example attesting/mozbase/mozgeckoprofiler/mozgeckoprofiler/symbolicator-cli/package.json- In mozbase ProfilerSymbolicator, call setup_helper's
package_setupfunction if needed- In mozbase ProfilerSymbolicator, invoke the installed symbolicator-cli script
Does that sound reasonable?
Yup, that sounds reasonable to me. It's unclear to me though why we can't call setup_helper.package_setup in a toolchain and then pull in the artifact of that setup to our CI tasks? That would save a lot of CI time even if it's platform specific. Maybe I'm misunderstanding what you're considering here. I think for local runs, it makes sense to have something in (or near) mozgeckoprofiler to handle the installs.
The "if needed" above does some heavy lifting - how should we detect whether we need to re-run npm install? Ah,
setup_helperseems to usenpm ciif no force update is requested, but I think it'll still emit a bunch of logging every time.
That shouldn't be difficult. We do this for detecting when to update the browsertime package, and it's been working without issue for a while now: https://searchfox.org/mozilla-central/source/testing/raptor/mach_commands.py#194-201
Updated•6 months ago
|
| Reporter | ||
Comment 11•5 months ago
|
||
In bug 1969490, Abhishek is doing a lot of the work that's needed here. He's adding a task which outputs the built symbolicator-cli as an artifact.
Updated•5 months ago
|
| Reporter | ||
Updated•5 months ago
|
| Assignee | ||
Updated•4 months ago
|
| Assignee | ||
Comment 12•3 months ago
|
||
Updated•3 months ago
|
| Assignee | ||
Comment 13•2 months ago
|
||
| Assignee | ||
Comment 14•2 months ago
|
||
| Assignee | ||
Comment 15•2 months ago
|
||
Updated•2 months ago
|
Updated•2 months ago
|
Updated•2 months ago
|
Updated•2 months ago
|
Updated•2 months ago
|
Updated•2 months ago
|
Updated•2 months ago
|
Updated•2 months ago
|
Updated•1 month ago
|
Updated•1 month ago
|
Updated•1 month ago
|
Updated•1 month ago
|
Updated•1 month ago
|
Updated•1 month ago
|
Updated•1 month ago
|
Updated•1 month ago
|
| Assignee | ||
Updated•1 month ago
|
| Assignee | ||
Updated•1 month ago
|
Updated•1 month ago
|
Comment 16•1 month ago
|
||
Comment 17•1 month ago
|
||
| bugherder | ||
https://hg.mozilla.org/mozilla-central/rev/7639ae467b5f
https://hg.mozilla.org/mozilla-central/rev/18165e60746c
https://hg.mozilla.org/mozilla-central/rev/94b59f1df154
Description
•