OSDN Git Service

simpleperf: Use simpleperf_app_runner to profile profileable apps.
authorYabin Cui <yabinc@google.com>
Thu, 10 Jan 2019 23:35:39 +0000 (15:35 -0800)
committerYabin Cui <yabinc@google.com>
Thu, 24 Jan 2019 00:27:00 +0000 (16:27 -0800)
commit1a30a5878984bee10aee06e674a7f5cc0269d9ef
tree73488effe90c67f4902ad462f2bca4eec8d986a2
parent918f046c3972527f5e8ac606bd11d1ab180f9524
simpleperf: Use simpleperf_app_runner to profile profileable apps.

Simpleperf uses run-as to run in apps' context to profile debuggable
apps. In Android Q, we want to profile <profileable shell="true"> apps.
To support that, do below changes:
1. Add simpleperf_app_runner, which is similar to run-as, but is limited
to only run simpleperf commands in profileable apps.
2. Add code using simpleperf_app_runner inside simpleperf, so it doesn't
change current interface of using simpleperf.

Bug: 118835348
Test: run simpleperf manually.
Test: run simpleperf_unit_test.

Change-Id: I85a8e3c80fe0e3ccdee97de38be968cbccd1d263
simpleperf/cmd_record.cpp
simpleperf/cmd_stat.cpp
simpleperf/environment.cpp
simpleperf/simpleperf_app_runner/Android.bp [new file with mode: 0644]
simpleperf/simpleperf_app_runner/simpleperf_app_runner.cpp [new file with mode: 0644]