tools/mac/power/driver.py
def Record(self, scenario_config):
    """Cover the running of the scenario with powermetrics and save
    the results

    Args:
      scenario_config: A dictionary describing the scenario.
    """

    output_file = \
        f'./{self.__output_dir}/{scenario_config["name"]}_powermetrics.plist'

    with open(output_file, "w") as powermetrics_output:

      # TODO(crbug.com/1224994): Narrow down samplers to only those of interest.
      powermetrics_args = [
          "sudo", "powermetrics", "-f", "plist", "--samplers", "all",
          "--show-responsible-pid", "--show-process-gpu",
          "--show-process-energy", "-i", "60000"
      ]

      powermetrics_process = subprocess.Popen(powermetrics_args,
                                              stdout=powermetrics_output,
                                              stdin=subprocess.PIPE)

      self._started_processeds.append(psutil.Process(powermetrics_process.pid))


    # No need to add |scenario_process| to |self._started_processeds| as it's
    # explicitly waited on.
    scenario_process = self.RunScenario(scenario_config)
    scenario_process.wait()

    self.Teardown()
Cover the running of the scenario with powermetrics and save
    the results

    Args:
      scenario_config: A dictionary describing the scenario.
    
Cover the running of the scenario with powermetrics and save
the results
Cover the running of the scenario with powermetrics and save the results
def Record(self, scenario_config):
    output_file = \
        f'./{self.__output_dir}/{scenario_config["name"]}_powermetrics.plist'
    with open(output_file, "w") as powermetrics_output:
      powermetrics_args = [
          "sudo", "powermetrics", "-f", "plist", "--samplers", "all",
          "--show-responsible-pid", "--show-process-gpu",
          "--show-process-energy", "-i", "60000"
      ]
      powermetrics_process = subprocess.Popen(powermetrics_args,
                                              stdout=powermetrics_output,
                                              stdin=subprocess.PIPE)
      self._started_processeds.append(psutil.Process(powermetrics_process.pid))
    scenario_process = self.RunScenario(scenario_config)
    scenario_process.wait()
    self.Teardown()
def Record ( self , scenario_config ) : output_file = f'./{self.__output_dir}/{scenario_config["name"]}_powermetrics.plist' with open ( output_file , "w" ) as powermetrics_output : powermetrics_args = [ "sudo" , "powermetrics" , "-f" , "plist" , "--samplers" , "all" , "--show-responsible-pid" , "--show-process-gpu" , "--show-process-energy" , "-i" , "60000" ] powermetrics_process = subprocess . Popen ( powermetrics_args , stdout = powermetrics_output , stdin = subprocess . PIPE ) self . _started_processeds . append ( psutil . Process ( powermetrics_process . pid ) ) scenario_process = self . RunScenario ( scenario_config ) scenario_process . wait ( ) self . Teardown ( )
Cover the running of the scenario with powermetrics and save
the results
Cover the running of the scenario with powermetrics and save the results
"""Cover the running of the scenario with powermetrics and save
    the results

    Args:
      scenario_config: A dictionary describing the scenario.
    """ # TODO(crbug.com/1224994): Narrow down samplers to only those of interest. # No need to add |scenario_process| to |self._started_processeds| as it's # explicitly waited on.
self
scenario_config
A dictionary describing the scenario.
A dictionary describing the scenario .