Closed
Bug 1464522
Opened 6 years ago
Closed 6 years ago
Track number of static constructors on Windows, OSX and Android builds
Categories
(Firefox Build System :: General, enhancement)
Tracking
(firefox62 fixed)
RESOLVED
FIXED
mozilla62
Tracking | Status | |
---|---|---|
firefox62 | --- | fixed |
People
(Reporter: glandium, Assigned: glandium)
References
Details
(Keywords: in-triage)
Attachments
(1 file)
We're currently tracking the number of static constructors on Linux builds, but it turns out that MSVC has a wildly different behavior wrt static initializers, and we should track that too. Which turns out to be relatively straightforward: $ grep -c '^FUNC.*`dynamic initializer for ' xul.pdb/B9F407BEBA0B470E8C3900E8228AF26D1/xul.sym 1258 In fact, we could also use the same technique on Linux too (grepping the symbols file, the keyword is just different), instead of looking at the output of objdump or readelf. That might even also work for OSX builds.
Assignee | ||
Comment 1•6 years ago
|
||
So, for some reason, OSX builds have the same symbols as Linux for static initializers, but they don't appear in the breakpad symbols file. "<name omitted>" appears instead, but there are 20k symbols that end up that way, instead of the 96 static initializers I can find with nm. toolkit/crashreporter/google-breakpad/src/common/dwarf_cu_to_module.cc puts the "<name omitted>" string when the dwarf info doesn't have a function name. Now the question is why does those functions have no name in the dwarf info, when they clearly have an associated symbol in the symbol table.
Assignee | ||
Updated•6 years ago
|
Assignee: nobody → mh+mozilla
Assignee | ||
Updated•6 years ago
|
Summary: Track number of static constructors on Windows builds → Track number of static constructors on Windows, OSX and Android builds
Comment hidden (mozreview-request) |
Comment 4•6 years ago
|
||
Awesome. I've had to track down static initializers a few times and this method should make it much easier to get the list of initializers.
![]() |
||
Comment 5•6 years ago
|
||
mozreview-review |
Comment on attachment 8981281 [details] Bug 1464522 - Count static initializers from the crash reporter symbol files. https://reviewboard.mozilla.org/r/247384/#review253592 Yay. ::: python/mozbuild/mozbuild/action/dumpsymbols.py:63 (Diff revision 1) > + if count_ctors: > + args.append('--count-ctors') > print('Running: %s' % ' '.join(args)) > out_files = subprocess.check_output(args) So we are running a Python action to run another Python process? Oof. ::: taskcluster/ci/build/linux.yml (Diff revision 1) > using: mozharness > actions: [get-secrets build check-test update] > config: > - builds/releng_base_firefox.py > - builds/releng_base_linux_64_builds.py > - - builds/releng_sub_linux_configs/enable_count_ctors.py \o/ ::: toolkit/crashreporter/tools/symbolstore.py:589 (Diff revision 1) > + if '_GLOBAL__sub_' in line: > + ctors += 1 > + elif "`dynamic initializer for '" in line: Perhaps comment here that the first style is Unix-ish, and the second one is Windows? ::: toolkit/library/Makefile.in:15 (Diff revision 1) > > .PHONY: gtestxul > gtestxul: > $(MAKE) -C $(DEPTH) toolkit/library/gtest/target LINK_GTEST_DURING_COMPILE=1 > + > +DUMP_SYMBOLS_FLAGS = --count-ctors WDYT about making this `ifdef MOZ_AUTOMATION`, since only automation cares about static constructors? Or do we think that exposing this to users will make it easier for them to count static constructors locally without pushing to try?
Attachment #8981281 -
Flags: review+
![]() |
||
Comment 6•6 years ago
|
||
Comment on attachment 8981281 [details] Bug 1464522 - Count static initializers from the crash reporter symbol files. r=me
Attachment #8981281 -
Flags: review?(core-build-config-reviews) → review+
Assignee | ||
Comment 7•6 years ago
|
||
(In reply to Nathan Froyd [:froydnj] from comment #5) > WDYT about making this `ifdef MOZ_AUTOMATION`, since only automation cares > about static constructors? Or do we think that exposing this to users will > make it easier for them to count static constructors locally without pushing > to try? The part that runs the command is in a ifdef MOZ_AUTOMATION block.
Assignee | ||
Updated•6 years ago
|
Attachment #8981281 -
Flags: review+
Comment hidden (mozreview-request) |
Pushed by mh@glandium.org: https://hg.mozilla.org/integration/autoland/rev/19a088d99507 Count static initializers from the crash reporter symbol files. r=froydnj
Comment 10•6 years ago
|
||
bugherder |
https://hg.mozilla.org/mozilla-central/rev/19a088d99507
Status: NEW → RESOLVED
Closed: 6 years ago
status-firefox62:
--- → fixed
Resolution: --- → FIXED
Target Milestone: --- → mozilla62
![]() |
||
Updated•6 years ago
|
You need to log in
before you can comment on or make changes to this bug.
Description
•