tools/cygprofile/profile_android_startup.py
def CollectProfile(self, apk, package_info):
    """Run a profile and collect the log files.

    Args:
      apk: The location of the chrome apk to profile.
      package_info: A PackageInfo structure describing the chrome apk,
                    as from pylib/constants.

    Returns:
      A list of cygprofile data files.

    Raises:
      NoProfileDataError: No data was found on the device.
    """
    if self._pregenerated_profiles:
      logging.info('Using pregenerated profiles instead of running profile')
      logging.info('Profile files:\n%s', '\n'.join(self._pregenerated_profiles))
      return self._pregenerated_profiles
    self._device.adb.Logcat(clear=True)
    self._Install(apk)
    try:
      changer = self._SetChromeFlags(package_info)
      self._SetUpDeviceFolders()
      if self._use_wpr:
        with WprManager(self._WPR_ARCHIVE, self._device,
                        package_info.cmdline_file, package_info.package):
          self._RunProfileCollection(package_info, self._simulate_user)
      else:
        self._RunProfileCollection(package_info, self._simulate_user)
    except device_errors.CommandFailedError as exc:
      logging.error('Exception %s; dumping logcat', exc)
      for logcat_line in self._device.adb.Logcat(dump=True):
        logging.error(logcat_line)
      raise
    finally:
      self._RestoreChromeFlags(changer)

    data = self._PullProfileData()
    self._DeleteDeviceData()
    return data
Run a profile and collect the log files.

    Args:
      apk: The location of the chrome apk to profile.
      package_info: A PackageInfo structure describing the chrome apk,
                    as from pylib/constants.

    Returns:
      A list of cygprofile data files.

    Raises:
      NoProfileDataError: No data was found on the device.
    
Run a profile and collect the log files.
Run a profile and collect the log files .
def CollectProfile(self, apk, package_info):
    if self._pregenerated_profiles:
      logging.info('Using pregenerated profiles instead of running profile')
      logging.info('Profile files:\n%s', '\n'.join(self._pregenerated_profiles))
      return self._pregenerated_profiles
    self._device.adb.Logcat(clear=True)
    self._Install(apk)
    try:
      changer = self._SetChromeFlags(package_info)
      self._SetUpDeviceFolders()
      if self._use_wpr:
        with WprManager(self._WPR_ARCHIVE, self._device,
                        package_info.cmdline_file, package_info.package):
          self._RunProfileCollection(package_info, self._simulate_user)
      else:
        self._RunProfileCollection(package_info, self._simulate_user)
    except device_errors.CommandFailedError as exc:
      logging.error('Exception %s; dumping logcat', exc)
      for logcat_line in self._device.adb.Logcat(dump=True):
        logging.error(logcat_line)
      raise
    finally:
      self._RestoreChromeFlags(changer)
    data = self._PullProfileData()
    self._DeleteDeviceData()
    return data
def CollectProfile ( self , apk , package_info ) : if self . _pregenerated_profiles : logging . info ( 'Using pregenerated profiles instead of running profile' ) logging . info ( 'Profile files:\n%s' , '\n' . join ( self . _pregenerated_profiles ) ) return self . _pregenerated_profiles self . _device . adb . Logcat ( clear = True ) self . _Install ( apk ) try : changer = self . _SetChromeFlags ( package_info ) self . _SetUpDeviceFolders ( ) if self . _use_wpr : with WprManager ( self . _WPR_ARCHIVE , self . _device , package_info . cmdline_file , package_info . package ) : self . _RunProfileCollection ( package_info , self . _simulate_user ) else : self . _RunProfileCollection ( package_info , self . _simulate_user ) except device_errors . CommandFailedError as exc : logging . error ( 'Exception %s; dumping logcat' , exc ) for logcat_line in self . _device . adb . Logcat ( dump = True ) : logging . error ( logcat_line ) raise finally : self . _RestoreChromeFlags ( changer ) data = self . _PullProfileData ( ) self . _DeleteDeviceData ( ) return data
Run a profile and collect the log files.
Run a profile and collect the log files .
"""Run a profile and collect the log files.

    Args:
      apk: The location of the chrome apk to profile.
      package_info: A PackageInfo structure describing the chrome apk,
                    as from pylib/constants.

    Returns:
      A list of cygprofile data files.

    Raises:
      NoProfileDataError: No data was found on the device.
    """
A list of cygprofile data files.
A list of cygprofile data files .
No data was found on the device.
No data was found on the device .
NoProfileDataError
self
apk
The location of the chrome apk to profile.
The location of the chrome apk to profile .
package_info
A PackageInfo structure describing the chrome apk,
as from pylib/constants.
A PackageInfo structure describing the chrome apk as from pylib / constants .