Bug 1457481 - Add a MOZ_GECKO_PROFILER_PARSE_ELF define that's only true on Android. r=ted
authorMarkus Stange <mstange@themasta.com>
Tue, 02 Oct 2018 01:49:13 +0000
changeset 494835 7c0eb6f58c1cf996836905df9696528a63b78d09
parent 494814 08125cd5d357b9da68af7a4b22122f07fc35243c
child 494836 7566a6bac33d41042243ac2cef94f32b7d0c08df
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