Bug 1457481 - Add a MOZ_GECKO_PROFILER_PARSE_ELF define that's only true on Android. r=ted
☠☠ backed out by 00eb79fc9f8a ☠ ☠
authorMarkus Stange <mstange@themasta.com>
Mon, 01 Oct 2018 20:15:08 +0000
changeset 494792 1c8460b1d6daca03719193526c4f88531fa37153
parent 494791 88315c6735dec7bbb70c5933e2b11e7343114f73
child 494793 4478820fbcaadbbcca55e5a487b55efd2f0ed4cf
push id9984
push userffxbld-merge
push dateMon, 15 Oct 2018 21:07:35 +0000
treeherdermozilla-beta@183d27ea8570 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersted
bugs1457481
milestone64.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 1457481 - Add a MOZ_GECKO_PROFILER_PARSE_ELF define that's only true on Android. r=ted This will be used to conditionally compile the rust code for ELF binary parsing, which will be used by the profiler to dump symbols from system libraries on Android. Ideally I'd like to make this only apply to Nightly + Beta configurations, and not to Release, but there doesn't seem to be an easy way to differentiate between Beta and Release and doing so might be frowned upon. So now it's going to be built on all channels on Android, even Release, even though developers won't be profiling Release channel builds much, and the extra code size isn't all that valuable for our users. We definitely need this code to be included on the Beta channel, though, because Firefox Focus Nightly uses GeckoView from the Beta channel, and we want to get good profiling information from Focus. Differential Revision: https://phabricator.services.mozilla.com/D7020
toolkit/moz.configure
--- a/toolkit/moz.configure
+++ b/toolkit/moz.configure
@@ -34,16 +34,30 @@ def gecko_profiler(target):
 def gecko_profiler_define(value):
     if value:
         return True
 
 set_config('MOZ_GECKO_PROFILER', gecko_profiler_define)
 set_define('MOZ_GECKO_PROFILER', gecko_profiler_define)
 
 
+# Whether code to parse ELF binaries should be compiled for the Gecko profiler
+# (for symbol table dumping).
+@depends(gecko_profiler, target)
+def gecko_profiler_parse_elf(value, target):
+    # Currently we only want to build this code on Android, in order to dump
+    # symbols from Android system libraries on the device. For other platforms
+    # there exist alternatives that don't require bloating up our binary size.
+    if value and target.os == 'Android':
+        return True
+
+set_config('MOZ_GECKO_PROFILER_PARSE_ELF', gecko_profiler_parse_elf)
+set_define('MOZ_GECKO_PROFILER_PARSE_ELF', gecko_profiler_parse_elf)
+
+
 option('--enable-dmd', env='MOZ_DMD',
        help='Enable Dark Matter Detector (heap profiler). '
             'Also enables jemalloc, replace-malloc and profiling')
 
 @depends('--enable-dmd')
 def dmd(value):
     if value:
         return True