android_webview/tools/run_simpleperf.py
def Run(self):
    """Run the simpleperf and do the post processing."""
    package_name = self.GetCurrentWebViewProvider()
    SimplePerfRunner.RunPackageCompile(package_name)
    perf_data_path = os.path.join(self.tmp_dir, 'perf.data')
    SimplePerfRunner.RunSimplePerf(perf_data_path, self.args)
    lines = SimplePerfRunner.GetOriginalReportHtml(
        perf_data_path,
        os.path.join(self.tmp_dir, 'unprocessed_report.html'))
    lib_name, lib_path = self.GetWebViewLibraryNameAndPath(package_name)
    addresses = SimplePerfRunner.CollectAddresses(lines, lib_name)
    logging.info("Extracted %d addresses", len(addresses))
    address_function_pairs = self.address_interpreter.Interpret(
        addresses, lib_path)

    lines = SimplePerfRunner.ReplaceAddressesWithFunctionInfos(
        lines, address_function_pairs, lib_name)

    with open(self.args.report_path, 'w') as f:
      for line in lines:
        f.write(line + '\n')

    logging.info("The final report has been generated at '%s'.",
                 self.args.report_path)
Run the simpleperf and do the post processing.
Run the simpleperf and do the post processing.
Run the simpleperf and do the post processing .
def Run(self):
    package_name = self.GetCurrentWebViewProvider()
    SimplePerfRunner.RunPackageCompile(package_name)
    perf_data_path = os.path.join(self.tmp_dir, 'perf.data')
    SimplePerfRunner.RunSimplePerf(perf_data_path, self.args)
    lines = SimplePerfRunner.GetOriginalReportHtml(
        perf_data_path,
        os.path.join(self.tmp_dir, 'unprocessed_report.html'))
    lib_name, lib_path = self.GetWebViewLibraryNameAndPath(package_name)
    addresses = SimplePerfRunner.CollectAddresses(lines, lib_name)
    logging.info("Extracted %d addresses", len(addresses))
    address_function_pairs = self.address_interpreter.Interpret(
        addresses, lib_path)
    lines = SimplePerfRunner.ReplaceAddressesWithFunctionInfos(
        lines, address_function_pairs, lib_name)
    with open(self.args.report_path, 'w') as f:
      for line in lines:
        f.write(line + '\n')
    logging.info("The final report has been generated at '%s'.",
                 self.args.report_path)
def Run ( self ) : package_name = self . GetCurrentWebViewProvider ( ) SimplePerfRunner . RunPackageCompile ( package_name ) perf_data_path = os . path . join ( self . tmp_dir , 'perf.data' ) SimplePerfRunner . RunSimplePerf ( perf_data_path , self . args ) lines = SimplePerfRunner . GetOriginalReportHtml ( perf_data_path , os . path . join ( self . tmp_dir , 'unprocessed_report.html' ) ) lib_name , lib_path = self . GetWebViewLibraryNameAndPath ( package_name ) addresses = SimplePerfRunner . CollectAddresses ( lines , lib_name ) logging . info ( "Extracted %d addresses" , len ( addresses ) ) address_function_pairs = self . address_interpreter . Interpret ( addresses , lib_path ) lines = SimplePerfRunner . ReplaceAddressesWithFunctionInfos ( lines , address_function_pairs , lib_name ) with open ( self . args . report_path , 'w' ) as f : for line in lines : f . write ( line + '\n' ) logging . info ( "The final report has been generated at '%s'." , self . args . report_path )
Run the simpleperf and do the post processing.
Run the simpleperf and do the post processing .
"""Run the simpleperf and do the post processing."""
self