aboutsummaryrefslogtreecommitdiffhomepage
path: root/infra
diff options
context:
space:
mode:
authorGravatar Eric Boren <borenet@google.com>2018-01-12 10:26:52 -0500
committerGravatar Skia Commit-Bot <skia-commit-bot@chromium.org>2018-01-12 19:15:49 +0000
commit620c0b63784133c7f853f2c69b66f3dd36936574 (patch)
tree0f40f73bb8eefeee77b448936beb14f4579737b7 /infra
parent24be3166c439ce33f6cdf58bcf5b12353801d245 (diff)
[recipes] Define variables in __init__
This may fix weird races in tests. Bug: skia: Change-Id: I41c36424c7b559301e915a0892590c74931ae463 Reviewed-on: https://skia-review.googlesource.com/93942 Reviewed-by: Kevin Lubick <kjlubick@google.com> Commit-Queue: Eric Boren <borenet@google.com>
Diffstat (limited to 'infra')
-rw-r--r--infra/bots/recipe_modules/flavor/gn_android_flavor.py78
1 files changed, 39 insertions, 39 deletions
diff --git a/infra/bots/recipe_modules/flavor/gn_android_flavor.py b/infra/bots/recipe_modules/flavor/gn_android_flavor.py
index 7636a01490..afbdc14ae3 100644
--- a/infra/bots/recipe_modules/flavor/gn_android_flavor.py
+++ b/infra/bots/recipe_modules/flavor/gn_android_flavor.py
@@ -28,6 +28,45 @@ class GNAndroidFlavorUtils(default_flavor.DefaultFlavorUtils):
svg_dir = self.m.vars.android_data_dir + 'svgs',
tmp_dir = self.m.vars.android_data_dir)
+ # A list of devices we can't root. If rooting fails and a device is not
+ # on the list, we fail the task to avoid perf inconsistencies.
+ self.rootable_blacklist = ['GalaxyS6', 'GalaxyS7_G930A', 'GalaxyS7_G930FD',
+ 'MotoG4', 'NVIDIA_Shield']
+
+ # Maps device type -> CPU ids that should be scaled for nanobench.
+ # Many devices have two (or more) different CPUs (e.g. big.LITTLE
+ # on Nexus5x). The CPUs listed are the biggest cpus on the device.
+ # The CPUs are grouped together, so we only need to scale one of them
+ # (the one listed) in order to scale them all.
+ # E.g. Nexus5x has cpu0-3 as one chip and cpu4-5 as the other. Thus,
+ # if one wants to run a single-threaded application (e.g. nanobench), one
+ # can disable cpu0-3 and scale cpu 4 to have only cpu4 and 5 at the same
+ # frequency. See also disable_for_nanobench.
+ self.cpus_to_scale = {
+ 'Nexus5x': [4],
+ 'NexusPlayer': [0, 2], # has 2 identical chips, so scale them both.
+ 'Pixel': [2],
+ 'Pixel2XL': [4]
+ }
+
+ # Maps device type -> CPU ids that should be turned off when running
+ # single-threaded applications like nanobench. The devices listed have
+ # multiple, differnt CPUs. We notice a lot of noise that seems to be
+ # caused by nanobench running on the slow CPU, then the big CPU. By
+ # disabling this, we see less of that noise by forcing the same CPU
+ # to be used for the performance testing every time.
+ self.disable_for_nanobench = {
+ 'Nexus5x': range(0, 4),
+ 'Pixel': range(0, 2),
+ 'Pixel2XL': range(0, 4),
+ 'PixelC': range(0, 2)
+ }
+
+ self.gpu_scaling = {
+ "Nexus5": 450000000,
+ "Nexus5x": 600000000,
+ }
+
def _run(self, title, *cmd, **kwargs):
with self.m.context(cwd=self.m.vars.skia_dir):
return self.m.run(self.m.step, title, cmd=list(cmd), **kwargs)
@@ -68,45 +107,6 @@ class GNAndroidFlavorUtils(default_flavor.DefaultFlavorUtils):
between_attempts_fn=wait_for_device,
**kwargs)
- # A list of devices we can't root. If rooting fails and a device is not
- # on the list, we fail the task to avoid perf inconsistencies.
- rootable_blacklist = ['GalaxyS6', 'GalaxyS7_G930A', 'GalaxyS7_G930FD',
- 'MotoG4', 'NVIDIA_Shield']
-
- # Maps device type -> CPU ids that should be scaled for nanobench.
- # Many devices have two (or more) different CPUs (e.g. big.LITTLE
- # on Nexus5x). The CPUs listed are the biggest cpus on the device.
- # The CPUs are grouped together, so we only need to scale one of them
- # (the one listed) in order to scale them all.
- # E.g. Nexus5x has cpu0-3 as one chip and cpu4-5 as the other. Thus,
- # if one wants to run a single-threaded application (e.g. nanobench), one
- # can disable cpu0-3 and scale cpu 4 to have only cpu4 and 5 at the same
- # frequency. See also disable_for_nanobench.
- cpus_to_scale = {
- 'Nexus5x': [4],
- 'NexusPlayer': [0, 2], # has 2 identical chips, so scale them both.
- 'Pixel': [2],
- 'Pixel2XL': [4]
- }
-
- # Maps device type -> CPU ids that should be turned off when running
- # single-threaded applications like nanobench. The devices listed have
- # multiple, differnt CPUs. We notice a lot of noise that seems to be
- # caused by nanobench running on the slow CPU, then the big CPU. By
- # disabling this, we see less of that noise by forcing the same CPU
- # to be used for the performance testing every time.
- disable_for_nanobench = {
- 'Nexus5x': range(0, 4),
- 'Pixel': range(0, 2),
- 'Pixel2XL': range(0, 4),
- 'PixelC': range(0, 2)
- }
-
- gpu_scaling = {
- "Nexus5": 450000000,
- "Nexus5x": 600000000,
- }
-
def _scale_for_dm(self):
device = self.m.vars.builder_cfg.get('model')
if (device in self.rootable_blacklist or