[go: nahoru, domu]

Orderfile: move instrumentation from tools to base.

As part of crbug.com/843561, some control over instrumentation is being exposed
to telemetry. To facilitate that, this CL moves orderfile instrumentation from
tools/ to base/android. This will make instrumentation control (such as Dump())
accessible from content/ and devtools tracing, allowing telemetry benchmarks
to trigger instrumented profile dumps when memory traces are requested.

All of this is part of the project to improve android orderfile
generation, which reduces the memory footprint of chrome by ~10MB (details
in [1]).

[1] https://docs.google.com/document/d/1dAt_puAX4SyqXDOdglxe6ku9GwnyBiOMjHAsDNwN0HY/edit#


Bug: 843561
Change-Id: I9973857fac36953935906cb908b3ffd6efa8185e
Reviewed-on: https://chromium-review.googlesource.com/1078427
Reviewed-by: Tobias Sargeant <tobiasjs@chromium.org>
Reviewed-by: Daniel Cheng <dcheng@chromium.org>
Reviewed-by: David Turner <digit@chromium.org>
Reviewed-by: Antoine Labour <piman@chromium.org>
Reviewed-by: Dirk Pranke <dpranke@chromium.org>
Reviewed-by: Bernhard Bauer <bauerb@chromium.org>
Reviewed-by: agrieve <agrieve@chromium.org>
Reviewed-by: Benoit L <lizeb@chromium.org>
Commit-Queue: Matthew Cary <mattcary@chromium.org>
Cr-Commit-Position: refs/heads/master@{#565958}
diff --git a/tools/cygprofile/orderfile_generator_backend.py b/tools/cygprofile/orderfile_generator_backend.py
index 7323206..129cc7c 100755
--- a/tools/cygprofile/orderfile_generator_backend.py
+++ b/tools/cygprofile/orderfile_generator_backend.py
@@ -429,7 +429,7 @@
 
     if options.profile:
       output_directory = os.path.join(self._instrumented_out_dir, 'Release')
-      host_cyglog_dir = os.path.join(output_directory, 'cyglog_data')
+      host_profile_dir = os.path.join(output_directory, 'profile_data')
       urls = [profile_android_startup.AndroidProfileTool.TEST_URL]
       use_wpr = True
       simulate_user = False
@@ -437,7 +437,7 @@
       use_wpr = not options.no_wpr
       simulate_user = options.simulate_user
       self._profiler = profile_android_startup.AndroidProfileTool(
-          output_directory, host_cyglog_dir, use_wpr, urls, simulate_user)
+          output_directory, host_profile_dir, use_wpr, urls, simulate_user)
 
     self._output_data = {}
     self._step_recorder = StepRecorder(options.buildbot)
@@ -479,7 +479,7 @@
       files = self._profiler.CollectProfile(
           self._compiler.chrome_apk,
           constants.PACKAGE_INFO['chrome'])
-      self._step_recorder.BeginStep('Process cyglog')
+      self._step_recorder.BeginStep('Process profile')
       assert os.path.exists(self._compiler.lib_chrome_so)
       offsets = process_profiles.GetReachedOffsetsFromDumpFiles(
           files, self._compiler.lib_chrome_so)