Allow reading symbols from the objdir when symbolicating a stripped packaged local build
Categories
(DevTools :: Performance Tools (Profiler/Timeline), enhancement, P3)
Tracking
(firefox78 fixed)
Tracking | Status | |
---|---|---|
firefox78 | --- | fixed |
People
(Reporter: mstange, Assigned: mstange)
References
Details
Attachments
(1 file)
Steps to reproduce:
- Create a local build on macOS using
./mach build
. - Create a packaged build from this using
./mach package
. - Run the packaged build, for example as follows:
obj-x86_64-apple-darwin18.6.0/dist/firefox/Nightly.app/Contents/MacOS/firefox -P debug -foreground --no-remote
- Enable the profiler toolbar icon.
- In the "Local build" section in the profiler toolbar icon's dropdown arrow panel, add your objdir.
- Grab a profile.
Expected results:
The resulting profile should have full symbol information for the XUL library.
Actual results:
The resulting profile has bad symbols. Example: https://perfht.ml/38N6BG9
The incomplete symbols happen because mach package
strips out symbols from our binaries, unless ac_add_options --disable-install-strip
is present in the mozconfig. So dist/firefox/Nightly.app/Contents/MacOS/XUL
now has an incomplete symbol table, and we use that incomplete symbol table to symbolicate the profile.
However, the symbols are still present in the original binary at dist/bin/XUL
, so we should be able to use this original file to symbolicate the profile. The code for this exists, I think it's just not hooked up in the right place.
(More precisely: dist/bin/XUL
is a symlink to the original at toolkit/library/build/XUL
.)
Assignee | ||
Updated•5 years ago
|
Assignee | ||
Comment 1•5 years ago
|
||
There's an easy workaround for this: you can just copy the unstripped libxul over the stripped one. This won't do anything to the .dmg bundle but that doesn't matter if you're not executing from the dmg bundle anyway.
E.g. execute this from the objdir:
cp toolkit/library/build/XUL dist/firefox/Nightly.app/Contents/MacOS/XUL
Assignee | ||
Comment 2•5 years ago
|
||
This duplicates the functions getSymbolTableFromLocalBinary and doesFileExistAtPath between browser.js and background.jsm.js.
I haven't looked into how best to share this code.
The other thing I'm not sure about is the call to getRecordingPreferencesFromBrowser() in getSymbolsFromThisBrowser.
That's how it gets the list of configured objdirs: const objdirs = getRecordingPreferencesFromBrowser().objdirs;
I don't know if this is the right thing to do or if the information should be propagated in some other way.
Assignee | ||
Comment 3•5 years ago
|
||
Unassigning for now. The workaround is simple enough that this is not an immediately pressing issue. The patch does seem to work though.
Assignee | ||
Comment 4•5 years ago
|
||
This patch also helps with other cases in which the original pdb file is at an unexpected path, for example when launching a build from a network share (bug 1585461). I'll try to finish it up.
Updated•5 years ago
|
Comment 6•5 years ago
|
||
bugherder |
Description
•