Beispiel #1
0
  def install(self):
    # Set up the device
    self.m.run(self.m.step, 'setup_device', cmd=['ios.py'], infra_step=True)

    # Install the app.
    for app_name in ['dm', 'nanobench']:
      app_package = self.m.vars.skia_out.join(self.m.vars.configuration,
                                              '%s.app' % app_name)

      # If app ID changes, upgrade will fail, so uninstall first.
      self.m.run(self.m.step,
                 'uninstall_' + app_name,
                 cmd=['ideviceinstaller', '-U', 'com.google.%s' % app_name],
                 infra_step=True,
                 # App may not be installed.
                 abort_on_failure=False, fail_build_on_failure=False)
      self.m.run(self.m.step,
                 'install_' + app_name,
                 cmd=['ideviceinstaller', '-i', app_package],
                 infra_step=True)

    self.device_dirs = default_flavor.DeviceDirs(
        dm_dir='dm',
        perf_data_dir='perf',
        resource_dir='resources',
        images_dir='images',
        skp_dir='skps',
        svg_dir='svgs',
        tmp_dir='tmp')
Beispiel #2
0
 def install(self):
     self.device_dirs = default_flavor.DeviceDirs(dm_dir='dm',
                                                  perf_data_dir='perf',
                                                  resource_dir='resources',
                                                  images_dir='images',
                                                  skp_dir='skps',
                                                  svg_dir='svgs',
                                                  tmp_dir='tmp')
    def __init__(self, m):
        super(GNAndroidFlavorUtils, self).__init__(m)
        self._ever_ran_adb = False
        self.ADB_BINARY = '/usr/bin/adb.1.0.35'
        self._golo_devices = ['Nexus5x']
        if self.m.vars.builder_cfg.get('model') in self._golo_devices:
            self.ADB_BINARY = '/opt/infra-android/tools/adb'

        self.device_dirs = default_flavor.DeviceDirs(
            dm_dir=self.m.vars.android_data_dir + 'dm_out',
            perf_data_dir=self.m.vars.android_data_dir + 'perf',
            resource_dir=self.m.vars.android_data_dir + 'resources',
            images_dir=self.m.vars.android_data_dir + 'images',
            skp_dir=self.m.vars.android_data_dir + 'skps',
            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,
        }
Beispiel #4
0
    def install(self):
        """Run device-specific installation steps."""
        device_scratch_dir = self._adb(
            name='get EXTERNAL_STORAGE dir',
            serial=self.serial,
            cmd=['shell', 'echo', '$EXTERNAL_STORAGE'],
            stdout=self.m.raw_io.output(),
            infra_step=True,
        ).stdout.rstrip()
        prefix = self.device_path_join(device_scratch_dir, 'skiabot', 'skia_')
        self.device_dirs = default_flavor.DeviceDirs(
            dm_dir=prefix + 'dm',
            perf_data_dir=prefix + 'perf',
            resource_dir=prefix + 'resources',
            images_dir=prefix + 'images',
            skp_dir=prefix + 'skp/skps',
            svg_dir=prefix + 'svg/svgs',
            tmp_dir=prefix + 'tmp_dir')

        self._has_root = self.has_root()
        self.m.run(self.m.step,
                   name='kill skia',
                   cmd=[
                       self.android_bin.join('android_kill_skia'),
                       '--verbose',
                   ] + self.serial_args,
                   env=self._default_env,
                   infra_step=True)
        if self._has_root:
            self._adb(name='stop shell',
                      serial=self.serial,
                      cmd=['shell', 'stop'],
                      infra_step=True)

        # Print out battery stats.
        self._adb(name='starting battery stats',
                  serial=self.serial,
                  cmd=['shell', 'dumpsys', 'batteryproperties'],
                  infra_step=True)

        # Print out CPU scale info.
        if self._has_root:
            self._adb(
                name='cat scaling_governor',
                serial=self.serial,
                cmd=[
                    'shell', 'cat',
                    '/sys/devices/system/cpu/cpu0/cpufreq/scaling_governor'
                ],
                infra_step=True)
            self._adb(
                name='cat cpu_freq',
                serial=self.serial,
                cmd=[
                    'shell', 'cat',
                    '/sys/devices/system/cpu/cpu0/cpufreq/scaling_cur_freq'
                ],
                infra_step=True)
Beispiel #5
0
 def get_device_dirs(self):
     """ Set the directories which will be used by the build steps."""
     prefix = self.device_path_join('skiabot', 'skia_')
     return default_flavor.DeviceDirs(dm_dir=prefix + 'dm',
                                      perf_data_dir=prefix + 'perf',
                                      resource_dir=prefix + 'resources',
                                      images_dir=prefix + 'images',
                                      skp_dir=prefix + 'skp/skps',
                                      tmp_dir=prefix + 'tmp_dir')
Beispiel #6
0
 def get_device_dirs(self):
     """Set the directories which will be used by the build steps."""
     sdcard = '/sdcard'
     results_dir = sdcard + '/skia_results'
     return default_flavor.DeviceDirs(dm_dir=results_dir,
                                      perf_data_dir=results_dir,
                                      resource_dir=sdcard + '/resources',
                                      images_dir=sdcard + '/images',
                                      skp_dir=sdcard + '/skps',
                                      tmp_dir=sdcard + '/tmp')
Beispiel #7
0
 def __init__(self, m):
     super(iOSFlavorUtils, self).__init__(m)
     self.device_dirs = default_flavor.DeviceDirs(bin_dir='[unused]',
                                                  dm_dir='dm',
                                                  perf_data_dir='perf',
                                                  resource_dir='resources',
                                                  images_dir='images',
                                                  skp_dir='skps',
                                                  svg_dir='svgs',
                                                  tmp_dir='tmp')
  def __init__(self, m):
    super(GNAndroidFlavorUtils, self).__init__(m)
    self._ever_ran_adb = False

    self.device_dirs = default_flavor.DeviceDirs(
        dm_dir        = self.m.vars.android_data_dir + 'dm_out',
        perf_data_dir = self.m.vars.android_data_dir + 'perf',
        resource_dir  = self.m.vars.android_data_dir + 'resources',
        images_dir    = self.m.vars.android_data_dir + 'images',
        skp_dir       = self.m.vars.android_data_dir + 'skps',
        svg_dir       = self.m.vars.android_data_dir + 'svgs',
        tmp_dir       = self.m.vars.android_data_dir)
Beispiel #9
0
    def get_device_dirs(self):
        """ Set the directories which will be used by the build steps."""
        prefix = self.device_path_join(self.device_root_dir, 'skia_')

        def join(suffix):
            return ''.join((prefix, suffix))

        return default_flavor.DeviceDirs(
            dm_dir=join('dm_out'),  # 'dm' conflicts with the binary
            perf_data_dir=join('perf'),
            resource_dir=join('resources'),
            images_dir=join('images'),
            skp_dir=self.device_path_join(join('skp'), 'skps'),
            tmp_dir=join('tmp_dir'))
 def get_device_dirs(self):
     """ Set the directories which will be used by the build steps."""
     device_scratch_dir = self._adb(
         name='get EXTERNAL_STORAGE dir',
         serial=self.serial,
         cmd=['shell', 'echo', '$EXTERNAL_STORAGE'],
     )
     prefix = self.device_path_join(device_scratch_dir, 'skiabot', 'skia_')
     return default_flavor.DeviceDirs(dm_dir=prefix + 'dm',
                                      perf_data_dir=prefix + 'perf',
                                      resource_dir=prefix + 'resources',
                                      images_dir=prefix + 'images',
                                      skp_dir=prefix + 'skp/skps',
                                      tmp_dir=prefix + 'tmp_dir')
Beispiel #11
0
    def __init__(self, m):
        super(GNChromebookFlavorUtils, self).__init__(m)
        self._user_ip = ''

        self.device_dirs = default_flavor.DeviceDirs(
            dm_dir=self.m.vars.chromeos_homedir + 'dm_out',
            perf_data_dir=self.m.vars.chromeos_homedir + 'perf',
            resource_dir=self.m.vars.chromeos_homedir + 'resources',
            images_dir=self.m.vars.chromeos_homedir + 'images',
            skp_dir=self.m.vars.chromeos_homedir + 'skps',
            svg_dir=self.m.vars.chromeos_homedir + 'svgs',
            tmp_dir=self.m.vars.chromeos_homedir)

        self._bin_dir = self.m.vars.chromeos_homedir + 'bin'
Beispiel #12
0
    def install(self):
        """Run device-specific installation steps."""
        prefix = self.device_path_join('skiabot', 'skia_')
        self.device_dirs = default_flavor.DeviceDirs(
            dm_dir=prefix + 'dm',
            perf_data_dir=prefix + 'perf',
            resource_dir=prefix + 'resources',
            images_dir=prefix + 'images',
            skp_dir=prefix + 'skp/skps',
            tmp_dir=prefix + 'tmp_dir')

        self.m.run(self.m.step,
                   name='install iOSShell',
                   cmd=[self.ios_bin.join('ios_install')],
                   env=self.default_env,
                   infra_step=True)
Beispiel #13
0
    def __init__(self, m):
        super(GNAndroidFlavorUtils, self).__init__(m)
        self._ever_ran_adb = False
        self.ADB_BINARY = '/usr/bin/adb.1.0.35'
        self._golo_devices = ['Nexus5x']
        if self.m.vars.builder_cfg.get('model') in self._golo_devices:
            self.ADB_BINARY = '/opt/infra-android/tools/adb'

        self.device_dirs = default_flavor.DeviceDirs(
            dm_dir=self.m.vars.android_data_dir + 'dm_out',
            perf_data_dir=self.m.vars.android_data_dir + 'perf',
            resource_dir=self.m.vars.android_data_dir + 'resources',
            images_dir=self.m.vars.android_data_dir + 'images',
            skp_dir=self.m.vars.android_data_dir + 'skps',
            svg_dir=self.m.vars.android_data_dir + 'svgs',
            tmp_dir=self.m.vars.android_data_dir)
 def get_device_dirs(self):
   """ Set the directories which will be used by the build steps."""
   device_scratch_dir = self._adb(
       name='get EXTERNAL_STORAGE dir',
       serial=self.serial,
       cmd=['shell', 'echo', '$EXTERNAL_STORAGE'],
       stdout=self._skia_api.m.raw_io.output(),
       infra_step=True,
   ).stdout.rstrip()
   prefix = self.device_path_join(device_scratch_dir, 'skiabot', 'skia_')
   return default_flavor.DeviceDirs(
       dm_dir=prefix + 'dm',
       perf_data_dir=prefix + 'perf',
       resource_dir=prefix + 'resources',
       images_dir=prefix + 'images',
       skp_dirs=default_flavor.SKPDirs(
           prefix + 'skp', self._skia_api.builder_name, '/'),
       tmp_dir=prefix + 'tmp_dir')
Beispiel #15
0
  def __init__(self, m):
    super(GNChromecastFlavorUtils, self).__init__(m)
    self._ever_ran_adb = False
    self._user_ip = ''

    # Disk space is extremely tight on the Chromecasts (~100M) There is not
    # enough space on the android_data_dir (/cache/skia) to fit the images,
    # resources, executable and output the dm images.  So, we have dm_out be
    # on the tempfs (i.e. RAM) /dev/shm. (which is about 140M)
    data_dir = '/cache/skia/'
    self.device_dirs = default_flavor.DeviceDirs(
        bin_dir       = '/cache/skia/bin',
        dm_dir        = '/dev/shm/skia/dm_out',
        perf_data_dir = data_dir + 'perf',
        resource_dir  = data_dir + 'resources',
        images_dir    = data_dir + 'images',
        skp_dir       = data_dir + 'skps',
        svg_dir       = data_dir + 'svgs',
        tmp_dir       = data_dir)
    def get_device_dirs(self):
        """ Set the directories which will be used by the build steps."""
        prefix = self.device_path_join(self.device_root_dir, 'skia_')

        def join(suffix):
            return ''.join((prefix, suffix))

        return default_flavor.DeviceDirs(
            gm_actual_dir=join('gm_actual'),
            gm_expected_dir=join('gm_expected'),
            dm_dir=join('dm_out'),  # 'dm' conflicts with the binary
            perf_data_dir=join('perf'),
            resource_dir=join('resources'),
            skimage_expected_dir=join('skimage_expected'),
            skimage_in_dir=join('skimage_in'),
            skimage_out_dir=join('skimage_out'),
            skp_dirs=default_flavor.SKPDirs(join('skp'),
                                            self._skia_api.c.BUILDER_NAME,
                                            '/'),
            skp_perf_dir=join('skp_perf'),
            tmp_dir=join('tmp_dir'))
    def install(self):
        # Set up the device
        self.m.run(self.m.step,
                   'setup_device',
                   cmd=['ios.py'],
                   infra_step=True)

        # Install the app.
        for app_name in ['dm', 'nanobench']:
            app_package = self.m.vars.skia_out.join(self.m.vars.configuration,
                                                    '%s.app' % app_name)
            self.m.run(self.m.step,
                       'install_' + app_name,
                       cmd=['ideviceinstaller', '-i', app_package],
                       infra_step=True)

        self.device_dirs = default_flavor.DeviceDirs(dm_dir='dm',
                                                     perf_data_dir='perf',
                                                     resource_dir='resources',
                                                     images_dir='images',
                                                     skp_dir='skps',
                                                     svg_dir='svgs',
                                                     tmp_dir='tmp')
 def get_device_dirs(self):
     """ Set the directories which will be used by the build steps."""
     device_scratch_dir = self._skia_api.m.adb(
         name='get EXTERNAL_STORAGE dir',
         serial=self.serial,
         cmd=['shell', 'echo', '$EXTERNAL_STORAGE'],
         stdout=self._skia_api.m.raw_io.output(),
     ).stdout.rstrip()
     prefix = self.device_path_join(device_scratch_dir, 'skiabot', 'skia_')
     return default_flavor.DeviceDirs(
         gm_actual_dir=prefix + 'gm_actual',
         gm_expected_dir=prefix + 'gm_expected',
         dm_dir=prefix + 'dm',
         perf_data_dir=prefix + 'perf',
         resource_dir=prefix + 'resources',
         skimage_expected_dir=prefix + 'skimage_expected',
         skimage_in_dir=prefix + 'skimage_in',
         skimage_out_dir=prefix + 'skimage_out',
         skp_dirs=default_flavor.SKPDirs(prefix + 'skp',
                                         self._skia_api.c.BUILDER_NAME,
                                         '/'),
         skp_perf_dir=prefix + 'skp_perf',
         tmp_dir=prefix + 'tmp_dir')