path: android-platform-system-extras_10.0.0+r36+ds-2.1/simpleperf/scripts/inferno/inferno.py log_exit("Unable to collect data.") if process.pid == 0: result, output = AdbHelper().run_and_return_output(['shell', 'pidof', process.name]) if result: try: path: android-platform-system-extras_10.0.0+r36+ds-2.1/simpleperf/scripts/run_simpleperf_without_usb_connection.py def stop_recording(args): adb = AdbHelper() result = adb.run(['shell', 'pidof', 'simpleperf']) if not result: log_warning('No simpleperf process on device. The recording has ended.') path: android-platform-system-extras_10.0.0+r36+ds-2.1/simpleperf/scripts/run_simpleperf_without_usb_connection.py adb.run(['shell', 'pkill', '-l', '2', 'simpleperf']) print('Waiting for simpleperf process to finish...') while adb.run(['shell', 'pidof', 'simpleperf']): time.sleep(1) adb.run(['shell', 'cat', '/data/local/tmp/simpleperf_output']) path: android-platform-system-extras_10.0.0+r36+ds-2.1/simpleperf/scripts/app_profiler.py def find_app_process(self): result, output = self.adb.run_and_return_output(['shell', 'pidof', self.args.app]) return int(output) if result else None path: android-platform-system-extras_10.0.0+r36+ds-2.1/simpleperf/scripts/app_profiler.py has_killed = False while True: (result, _) = self.adb.run_and_return_output(['shell', 'pidof', 'simpleperf']) if not result: break path: android-platform-system-extras_10.0.0+r36+ds-2.1/simpleperf/scripts/app_profiler.py """Profile a native program.""" def start(self): pid = int(self.adb.check_run_and_return_output(['shell', 'pidof', self.args.native_program])) self.start_profiling(['-p', str(pid)]) path: android-platform-system-extras_10.0.0+r36+ds-2.1/tests/workloads/defs.sh if [ -z "$f" ]; then # Hmm. sf symbols may not be there... get the pid pid=$(${ADB}pidof /system/bin/surfaceflinger | tr "[ ]" "[ ]") f=$(grep " <...>-$pid.*tracing_mark_write.*$_app" $traceout 2>/dev/null | grep -v Starting | head -1 | tr [\(\)\[\] :] " ") path: android-platform-system-extras_10.0.0+r36+ds-2.1/simpleperf/scripts/test.py time.sleep(1) pid = self.adb.check_run_and_return_output([ 'shell', 'pidof', 'com.example.simpleperf.simpleperfexamplepurejava']).strip() self.run_app_profiler(start_activity=False, record_arg='-g --duration 10 -p ' + pid) self.run_cmd(["report.py", "-g", "-o", "report.txt"]) path: android-platform-system-extras_10.0.0+r36+ds-2.1/simpleperf/scripts/test.py if not self.is_rooted_device: return pid = int(self.adb.check_run_and_return_output(['shell', 'pidof', 'system_server'])) self.run_cmd(['app_profiler.py', '--pid', str(pid), '-r', '--duration 1']) self.run_cmd(['app_profiler.py', '--pid', str(pid), str(pid), '-r', '--duration 1'])