summaryrefslogtreecommitdiff
path: root/simpleperf/main.cpp
AgeCommit message (Collapse)Author
2020-01-14simpleperf: prepare for selinux change.Yabin Cui
To work with controlling perf_events via selinux: 1. Check security.perf_harden property at the entry of simpleperf. 2. Record tracepoint raw data only when running as root. Bug: 139860059 Test: run simpleperf_unit_test. Change-Id: I40082de0010949e54fb707f385220157a71f266b
2017-07-14simpleperf: change the way running cts tests.Yabin Cui
Before this CL, CtsSimpleperfTestCases copies itself to the app's directory, then run it using run-as. With this CL, CtsSimpleperfTestCases keeps itself in /data/local/tmp, but forces stat/record cmd to run with --app option. This gives more freedom to tests: 1. They can stay in shell's context with --in-app option. 2. The stat/record cmds are started in the shell's context, so they can collect information no available in app's context (like data in /sys/kernel/debug/tracing/events). This is a preparation to add tests for recording tracepoint events. It also matches the way we want users to use simpleperf (with --app option). Bug: http://b/29520177 Test: run CtsSimpleperfTestCases. Change-Id: I1709adfb1ff7169df87560226c197e473fdf8516
2017-05-03simpleperf: add META_INFO feature section in perf.data.Yabin Cui
META_INFO section can be used to pass some small information in perf.data. Add simpleperf_version in META_INFO section for debugging. Bug: http://b/37960318 Test: run simpleperf_unit_test. Change-Id: If17a147bbc77b5af063fbf77e02ca81430afb8a5
2017-02-15simpleperf: build cts test running in app context.Yabin Cui
When built for cts test, the test binary uses run-as to move itself to the data directory of debuggable app 'com.android.simpleperf', and run the tests in app context using run-as. Bug: http://b/18790309 Test: run cts-tradefed, 'run everything -m CtsSimpleperfTestCase'. Change-Id: I523470bb8062cb944b44dc6f264a8b1c14221b62
2016-08-01simpleperf: add version.Yabin Cui
Bug: http://b/30416563 Change-Id: I03e5dbae3f0944d7d6b73d4dfa252ad3396b83e6 Test: run `simpleperf --version`.
2016-06-02simpleperf: add report-sample command.Yabin Cui
1. Add report-sample command to report each sample with symbol information. 2. Add --dump-symbols option to record command to collect dso and symbol information in perf.data. Bug: 28114205 Change-Id: I37424ee6abd74a21ad41cd3b6c4249cf0625c201
2016-03-26Simpleperf: add test for reporting callgraph of shared libraries in apk file.Yabin Cui
Also add comment for how to generate each perf.data in testdata/. Add --log <leve> argument in unit test to help debugging. Bug: 26962895 Change-Id: Iaa5a81cd8da5174d5b5b4e7847811e2432bf0db8
2016-02-17simpleperf: report symbols of native libraries in apk file.Yabin Cui
Changes included: 1. provide interface in read_apk.h to read build id and symbols. 2. report symbols of native libraries in apk file. 3. refactor code in read_elf.cpp and read_apk.cpp. 4. add verbose log. 5. add -o report_file_name option for report command. 6. add corresponding unit tests. Bug: 26962895 Change-Id: I0d5398996e0c29dba4a6f5226692b758ca096bbd
2015-12-04Track rename from base/ to android-base/.Elliott Hughes
Change-Id: Ic15d4778c7accd1382de0b440a437aba2cf67016
2015-10-01Simpleperf: warn if it can't read kernel symbols addresses.Yabin Cui
And a little format adjustment. Bug: 24404256 Change-Id: Ie8dcd37138a693df18101d415e6e3243f4963582
2015-07-01Simpleperf: add --log option to ease debugging.Yabin Cui
Bug: 19483574 Change-Id: If45bbefb79b488206ca7542957f4207c3420fce3
2015-06-04Simpleperf: refactor command system.Yabin Cui
Register a callback function to create a new command instance instead of registering a command instance. Then we can release resources in the command destructors, and don't need xxxCommandImpl classes any more. Bug: 19483574 Change-Id: Ibb54892ec0655fd43909347afd72bb08bc8a716c
2015-05-04Implement simpleperf record/dumprecord subcommands.Yabin Cui
Bug: 19483574 Change-Id: Id879713a75c2d3a6289d8847b95ee0bb4a2cc8a0
2015-04-23Implement simpleperf stat subcommand.Yabin Cui
Also add some simple unit-tests. Change-Id: Ic30a2d4a879e028a8c82babbaf82e322fc49a838
2015-04-18Implement simpleperf list subcommand.Yabin Cui
simpleperf is used to replace linux/tools/perf. And This CL implements the list subcommand of it. Change-Id: I3e6fe854e19cc370070d0fd8416d0aa6fa8f8e90