|
Name |
|
Date |
Size |
#Lines |
LOC |
| .. | | - | - |
| CtsSimpleperfTestCases_testdata/ | | 15-Dec-2024 | - | | |
| app_api/ | | 14-Jan-2024 | - | 1,274 | 871 |
| demo/ | | 14-Jan-2024 | - | 4,871 | 3,983 |
| doc/ | | 15-Dec-2024 | - | 33,318 | 32,233 |
| include/ | | 15-Dec-2024 | - | 125 | 47 |
| nonlinux_support/ | | 14-Jan-2024 | - | 146 | 62 |
| runtest/ | | 15-Dec-2024 | - | 1,214 | 1,015 |
| rust/ | | 15-Dec-2024 | - | 81 | 37 |
| scripts/ | | 15-Dec-2024 | - | 18,259 | 14,948 |
| simpleperf_app_runner/ | | 14-Jan-2024 | - | 312 | 248 |
| testdata/ | | 15-Dec-2024 | - | 50,798 | 49,288 |
| .clang-format | D | 14-Jan-2024 | 239 | | |
| .gitignore | D | 14-Jan-2024 | 5 | 1 | 1 |
| Android.bp | D | 15-Dec-2024 | 18.3 KiB | 783 | 751 |
| Android.mk | D | 14-Jan-2024 | 1.5 KiB | 44 | 19 |
| BranchListFile.cpp | D | 15-Dec-2024 | 14.9 KiB | 441 | 380 |
| BranchListFile.h | D | 15-Dec-2024 | 5.5 KiB | 177 | 122 |
| BranchListFile_test.cpp | D | 15-Dec-2024 | 1.1 KiB | 37 | 16 |
| CallChainJoiner.cpp | D | 14-Jan-2024 | 13.8 KiB | 428 | 358 |
| CallChainJoiner.h | D | 14-Jan-2024 | 5.9 KiB | 182 | 117 |
| CallChainJoiner_test.cpp | D | 15-Dec-2024 | 10.1 KiB | 272 | 213 |
| ETMConstants.h | D | 15-Dec-2024 | 1.2 KiB | 33 | 12 |
| ETMDecoder.cpp | D | 15-Dec-2024 | 35.4 KiB | 988 | 791 |
| ETMDecoder.h | D | 15-Dec-2024 | 3.3 KiB | 98 | 51 |
| ETMRecorder.cpp | D | 15-Dec-2024 | 9 KiB | 308 | 251 |
| ETMRecorder.h | D | 15-Dec-2024 | 2.7 KiB | 95 | 53 |
| IOEventLoop.cpp | D | 15-Dec-2024 | 6.9 KiB | 232 | 182 |
| IOEventLoop.h | D | 15-Dec-2024 | 3.7 KiB | 109 | 50 |
| IOEventLoop_test.cpp | D | 15-Dec-2024 | 8.1 KiB | 326 | 271 |
| JITDebugReader.cpp | D | 15-Dec-2024 | 29 KiB | 789 | 655 |
| JITDebugReader.h | D | 15-Dec-2024 | 9.5 KiB | 256 | 166 |
| JITDebugReader_impl.h | D | 14-Jan-2024 | 2.4 KiB | 93 | 63 |
| JITDebugReader_test.cpp | D | 15-Dec-2024 | 3.9 KiB | 101 | 64 |
| MapRecordReader.cpp | D | 14-Jan-2024 | 5.5 KiB | 191 | 152 |
| MapRecordReader.h | D | 14-Jan-2024 | 2.3 KiB | 78 | 44 |
| MapRecordReader_test.cpp | D | 15-Dec-2024 | 2.5 KiB | 89 | 58 |
| NOTICE | D | 14-Jan-2024 | 10.4 KiB | 191 | 158 |
| OWNERS | D | 14-Jan-2024 | 89 | 4 | 3 |
| OfflineUnwinder.cpp | D | 14-Jan-2024 | 15.8 KiB | 369 | 302 |
| OfflineUnwinder.h | D | 14-Jan-2024 | 3.1 KiB | 89 | 53 |
| OfflineUnwinder_impl.h | D | 14-Jan-2024 | 1.6 KiB | 55 | 28 |
| OfflineUnwinder_test.cpp | D | 15-Dec-2024 | 3.8 KiB | 121 | 81 |
| ProbeEvents.cpp | D | 15-Dec-2024 | 5.3 KiB | 174 | 130 |
| ProbeEvents.h | D | 15-Dec-2024 | 1.8 KiB | 59 | 28 |
| ProbeEvents_test.cpp | D | 15-Dec-2024 | 1.8 KiB | 53 | 26 |
| README.md | D | 14-Jan-2024 | 3.1 KiB | 99 | 70 |
| RecordFilter.cpp | D | 15-Dec-2024 | 16 KiB | 529 | 446 |
| RecordFilter.h | D | 15-Dec-2024 | 7.1 KiB | 142 | 101 |
| RecordFilter_test.cpp | D | 15-Dec-2024 | 11.1 KiB | 361 | 270 |
| RecordReadThread.cpp | D | 15-Dec-2024 | 24.3 KiB | 686 | 590 |
| RecordReadThread.h | D | 15-Dec-2024 | 7.7 KiB | 222 | 139 |
| RecordReadThread_test.cpp | D | 15-Dec-2024 | 22.1 KiB | 586 | 496 |
| RegEx.cpp | D | 15-Dec-2024 | 2.6 KiB | 90 | 58 |
| RegEx.h | D | 15-Dec-2024 | 1.8 KiB | 58 | 30 |
| RegEx_test.cpp | D | 15-Dec-2024 | 1.4 KiB | 50 | 25 |
| SampleComparator.h | D | 14-Jan-2024 | 4.2 KiB | 129 | 86 |
| SampleDisplayer.h | D | 14-Jan-2024 | 10 KiB | 303 | 245 |
| TEST_MAPPING | D | 14-Jan-2024 | 75 | 7 | 7 |
| branch_list.proto | D | 15-Dec-2024 | 2.6 KiB | 97 | 80 |
| build_id.h | D | 14-Jan-2024 | 3 KiB | 108 | 66 |
| callchain.h | D | 14-Jan-2024 | 5.1 KiB | 158 | 123 |
| cmd_api.cpp | D | 14-Jan-2024 | 9.5 KiB | 299 | 246 |
| cmd_api_impl.h | D | 14-Jan-2024 | 1.3 KiB | 35 | 14 |
| cmd_api_test.cpp | D | 15-Dec-2024 | 3 KiB | 110 | 70 |
| cmd_boot_record.cpp | D | 14-Jan-2024 | 6 KiB | 193 | 152 |
| cmd_boot_record_test.cpp | D | 15-Dec-2024 | 1.5 KiB | 43 | 18 |
| cmd_debug_unwind.cpp | D | 14-Jan-2024 | 27.2 KiB | 738 | 641 |
| cmd_debug_unwind_test.cpp | D | 15-Dec-2024 | 7.7 KiB | 193 | 137 |
| cmd_dumprecord.cpp | D | 15-Dec-2024 | 20.5 KiB | 608 | 536 |
| cmd_dumprecord_test.cpp | D | 15-Dec-2024 | 3.1 KiB | 92 | 53 |
| cmd_help.cpp | D | 14-Jan-2024 | 2.9 KiB | 97 | 64 |
| cmd_inject.cpp | D | 15-Dec-2024 | 38.2 KiB | 1,104 | 943 |
| cmd_inject_test.cpp | D | 15-Dec-2024 | 11 KiB | 289 | 199 |
| cmd_kmem.cpp | D | 15-Dec-2024 | 25.9 KiB | 699 | 615 |
| cmd_kmem_test.cpp | D | 15-Dec-2024 | 4.7 KiB | 152 | 110 |
| cmd_list.cpp | D | 15-Dec-2024 | 12.2 KiB | 383 | 322 |
| cmd_list_test.cpp | D | 15-Dec-2024 | 1.5 KiB | 59 | 27 |
| cmd_merge.cpp | D | 14-Jan-2024 | 14.6 KiB | 430 | 364 |
| cmd_merge_test.cpp | D | 15-Dec-2024 | 3.2 KiB | 95 | 58 |
| cmd_monitor.cpp | D | 15-Dec-2024 | 21.9 KiB | 615 | 502 |
| cmd_monitor_test.cpp | D | 15-Dec-2024 | 4.1 KiB | 150 | 102 |
| cmd_record.cpp | D | 15-Dec-2024 | 89.6 KiB | 2,368 | 2,025 |
| cmd_record_impl.h | D | 15-Dec-2024 | 6.6 KiB | 110 | 86 |
| cmd_record_test.cpp | D | 15-Dec-2024 | 51.3 KiB | 1,465 | 1,157 |
| cmd_report.cpp | D | 15-Dec-2024 | 41 KiB | 1,067 | 934 |
| cmd_report_sample.cpp | D | 15-Dec-2024 | 38.7 KiB | 1,014 | 900 |
| cmd_report_sample.proto | D | 14-Jan-2024 | 6.1 KiB | 165 | 141 |
| cmd_report_sample_test.cpp | D | 15-Dec-2024 | 13.6 KiB | 326 | 234 |
| cmd_report_test.cpp | D | 15-Dec-2024 | 25.7 KiB | 749 | 597 |
| cmd_stat.cpp | D | 15-Dec-2024 | 36.9 KiB | 1,011 | 885 |
| cmd_stat_impl.h | D | 15-Dec-2024 | 12.4 KiB | 340 | 273 |
| cmd_stat_test.cpp | D | 15-Dec-2024 | 24.7 KiB | 720 | 566 |
| cmd_trace_sched.cpp | D | 15-Dec-2024 | 14.9 KiB | 426 | 373 |
| cmd_trace_sched_test.cpp | D | 15-Dec-2024 | 2.1 KiB | 66 | 39 |
| command.cpp | D | 15-Dec-2024 | 9.3 KiB | 285 | 238 |
| command.h | D | 15-Dec-2024 | 7.9 KiB | 242 | 187 |
| command_test.cpp | D | 15-Dec-2024 | 7.7 KiB | 186 | 136 |
| cpu_hotplug_test.cpp | D | 14-Jan-2024 | 15.7 KiB | 504 | 422 |
| dso.cpp | D | 15-Dec-2024 | 34.4 KiB | 1,061 | 878 |
| dso.h | D | 14-Jan-2024 | 8 KiB | 236 | 157 |
| dso_test.cpp | D | 15-Dec-2024 | 15.7 KiB | 403 | 303 |
| environment.cpp | D | 15-Dec-2024 | 34.1 KiB | 1,090 | 911 |
| environment.h | D | 15-Dec-2024 | 4.9 KiB | 170 | 115 |
| environment_test.cpp | D | 15-Dec-2024 | 5.3 KiB | 165 | 118 |
| event_attr.cpp | D | 14-Jan-2024 | 10.2 KiB | 265 | 202 |
| event_attr.h | D | 14-Jan-2024 | 2.1 KiB | 64 | 32 |
| event_fd.cpp | D | 14-Jan-2024 | 11.3 KiB | 334 | 268 |
| event_fd.h | D | 14-Jan-2024 | 5.5 KiB | 161 | 86 |
| event_selection_set.cpp | D | 15-Dec-2024 | 32.6 KiB | 1,013 | 867 |
| event_selection_set.h | D | 15-Dec-2024 | 8.7 KiB | 255 | 169 |
| event_selection_set_test.cpp | D | 15-Dec-2024 | 4.1 KiB | 98 | 71 |
| event_table.json | D | 15-Dec-2024 | 97.8 KiB | 1,043 | 1,042 |
| event_table_generator.py | D | 15-Dec-2024 | 9 KiB | 254 | 192 |
| event_type.cpp | D | 15-Dec-2024 | 17.4 KiB | 593 | 497 |
| event_type.h | D | 15-Dec-2024 | 4.2 KiB | 138 | 90 |
| get_test_data.h | D | 14-Jan-2024 | 6.9 KiB | 148 | 54 |
| gtest_main.cpp | D | 15-Dec-2024 | 3.4 KiB | 129 | 86 |
| kallsyms.cpp | D | 14-Jan-2024 | 8.4 KiB | 289 | 222 |
| kallsyms.h | D | 14-Jan-2024 | 1.8 KiB | 60 | 21 |
| kallsyms_test.cpp | D | 15-Dec-2024 | 4.5 KiB | 146 | 105 |
| libsimpleperf_report_fuzzer.cpp | D | 15-Dec-2024 | 2.9 KiB | 88 | 61 |
| main.cpp | D | 15-Dec-2024 | 3.2 KiB | 82 | 45 |
| perf_event.h | D | 14-Jan-2024 | 950 | 31 | 11 |
| perf_regs.cpp | D | 14-Jan-2024 | 8 KiB | 281 | 240 |
| perf_regs.h | D | 14-Jan-2024 | 2.9 KiB | 113 | 80 |
| perf_regs_test.cpp | D | 15-Dec-2024 | 1.2 KiB | 40 | 19 |
| profcollect.cpp | D | 15-Dec-2024 | 4.3 KiB | 141 | 104 |
| read_apk.cpp | D | 14-Jan-2024 | 6 KiB | 172 | 129 |
| read_apk.h | D | 14-Jan-2024 | 3.4 KiB | 95 | 50 |
| read_apk_test.cpp | D | 15-Dec-2024 | 3.5 KiB | 86 | 57 |
| read_dex_file.cpp | D | 15-Dec-2024 | 3.4 KiB | 94 | 68 |
| read_dex_file.h | D | 15-Dec-2024 | 1.5 KiB | 48 | 23 |
| read_dex_file_test.cpp | D | 15-Dec-2024 | 1.5 KiB | 45 | 22 |
| read_elf.cpp | D | 15-Dec-2024 | 21.3 KiB | 632 | 535 |
| read_elf.h | D | 14-Jan-2024 | 3.6 KiB | 118 | 75 |
| read_elf_test.cpp | D | 15-Dec-2024 | 9.1 KiB | 276 | 206 |
| read_symbol_map.cpp | D | 15-Dec-2024 | 2.7 KiB | 110 | 70 |
| read_symbol_map.h | D | 14-Jan-2024 | 1.1 KiB | 39 | 15 |
| read_symbol_map_test.cpp | D | 15-Dec-2024 | 4 KiB | 121 | 74 |
| record.cpp | D | 15-Dec-2024 | 58.6 KiB | 1,749 | 1,609 |
| record.h | D | 15-Dec-2024 | 20.3 KiB | 719 | 523 |
| record_equal_test.h | D | 15-Dec-2024 | 4.7 KiB | 121 | 97 |
| record_file.h | D | 15-Dec-2024 | 9.1 KiB | 259 | 166 |
| record_file.proto | D | 14-Jan-2024 | 1.4 KiB | 61 | 50 |
| record_file_format.h | D | 14-Jan-2024 | 3.6 KiB | 155 | 60 |
| record_file_reader.cpp | D | 15-Dec-2024 | 27.1 KiB | 866 | 784 |
| record_file_test.cpp | D | 15-Dec-2024 | 9.4 KiB | 264 | 189 |
| record_file_writer.cpp | D | 14-Jan-2024 | 15.9 KiB | 527 | 445 |
| record_lib_interface.cpp | D | 15-Dec-2024 | 7.7 KiB | 298 | 242 |
| record_lib_test.cpp | D | 15-Dec-2024 | 5.4 KiB | 149 | 118 |
| record_test.cpp | D | 15-Dec-2024 | 8.4 KiB | 215 | 166 |
| report_lib_interface.cpp | D | 15-Dec-2024 | 24.3 KiB | 743 | 624 |
| report_utils.cpp | D | 15-Dec-2024 | 18.7 KiB | 532 | 432 |
| report_utils.h | D | 15-Dec-2024 | 4.7 KiB | 160 | 102 |
| report_utils_test.cpp | D | 15-Dec-2024 | 28.2 KiB | 633 | 520 |
| sample_tree.h | D | 14-Jan-2024 | 12 KiB | 351 | 267 |
| sample_tree_test.cpp | D | 15-Dec-2024 | 8.5 KiB | 243 | 190 |
| simpleperf.rc | D | 15-Dec-2024 | 480 | 10 | 7 |
| simpleperf_dict.dict | D | 15-Dec-2024 | 14 | 1 | 1 |
| simpleperf_writer_fuzzer.cpp | D | 15-Dec-2024 | 6.5 KiB | 176 | 146 |
| test_util.cpp | D | 15-Dec-2024 | 6.1 KiB | 188 | 146 |
| test_util.h | D | 15-Dec-2024 | 7.6 KiB | 206 | 162 |
| thread_tree.cpp | D | 14-Jan-2024 | 14 KiB | 440 | 363 |
| thread_tree.h | D | 14-Jan-2024 | 6.2 KiB | 177 | 118 |
| thread_tree_test.cpp | D | 15-Dec-2024 | 4.7 KiB | 160 | 106 |
| tracing.cpp | D | 15-Dec-2024 | 19.2 KiB | 650 | 551 |
| tracing.h | D | 15-Dec-2024 | 3.6 KiB | 130 | 88 |
| tracing_test.cpp | D | 15-Dec-2024 | 4.4 KiB | 107 | 75 |
| utils.cpp | D | 15-Dec-2024 | 13.8 KiB | 515 | 445 |
| utils.h | D | 15-Dec-2024 | 8.1 KiB | 298 | 222 |
| utils_test.cpp | D | 15-Dec-2024 | 4 KiB | 122 | 85 |
| workload.cpp | D | 14-Jan-2024 | 6.8 KiB | 230 | 188 |
| workload.h | D | 14-Jan-2024 | 2.4 KiB | 80 | 46 |
| workload_test.cpp | D | 15-Dec-2024 | 2.5 KiB | 83 | 51 |
README.md
1# Simpleperf
2
3Android Studio includes a graphical front end to Simpleperf, documented in
4[Inspect CPU activity with CPU Profiler](https://developer.android.com/studio/profile/cpu-profiler).
5Most users will prefer to use that instead of using Simpleperf directly.
6
7If you prefer to use the command line, Simpleperf is a versatile command-line
8CPU profiling tool included in the NDK for Mac, Linux, and Windows.
9
10This file contains documentation for simpleperf maintainers.
11
12There is also [user documentation](doc/README.md).
13
14## Building new prebuilts
15
16To snap the aosp-simpleperf-release branch to ToT AOSP main and kick off a
17build, use [this coastguard
18page](https://android-build.googleplex.com/coastguard/dashboard/5938649007521792/#/request/create)
19and choose "aosp-simpleperf-release" from the "Branch" dropdown. Then click
20"Submit build requests". You'll get emails keeping you up to date with the
21progress of the snap and the build.
22
23## Updating the prebuilts
24
25Once you have the build id (a 7-digit number) and the build is complete, run the
26update script from within the `system/extras/simpleperf` directory:
27```
28$ ./scripts/update.py --build 1234567
29```
30
31This will create a new change that you can `repo upload`, then approve and
32submit as normal.
33
34For testing, I usually only run python host tests as below:
35```
36$ ./scripts/test/test.py --only-host-test
37```
38
39To test all scripts, please use python 3.8+ and install below packages:
40```
41$ pip install bokeh jinja2 pandas protobuf textable
42```
43
44## Updating the prebuilts in prebuilts/simpleperf
45
46Download ndk branch.
47```
48$ repo init -u persistent-https://android.git.corp.google.com/platform/manifest -b master-ndk
49$ repo sync
50```
51
52In prebuilts/simpleperf, run `update.py`:
53```
54$ ./update.py --build <bid>
55```
56
57Then manually edit `ChangeLog`.
58This will create a new change that you can `repo upload`, then approve and submit as normal.
59
60For testing, we need to test if the scripts run on darwin/linux/windows for different android
61versions. I usually split it to four parts:
62
631. Test on android emulators running on linux x86_64 host, for android version N/O/P/Q/R/S/current.
64
65```
66$ ./test/test.py -d <devices> -r 3
67```
68
69The scripts support android >= N. But it's easier to test old versions on emulators. So I only test
70android N on emulators.
71
72Currently, the tests have problems in clean up. So tests on emulator may fail and take too long to
73run. And there are a few known failed cases. Hopefully they will be fixed soon.
74
751. Test on android devices connected to linux x86_64 host, for android version O/P/Q/R/S/current.
76
77```
78$ ./test/test.py -d <devices> -r 3
79```
80
813. Test on an android device connected to darwin x86_64 host, for one of android version O/P/Q/R/S/current.
82
83```
84$ ./test/test.py -d <devices> -r 1
85```
86
874. Test on an android device connected to darwin x86_64 host, for one of android version O/P/Q/R/S/current.
88
89```
90$ ./test/test.py -d <devices> -r 1
91```
92
93To check simpleperf contents released in ndk, we can build ndk package.
94```
95$ <top_dir>/ndk/checkbuild.py --package --system linux --module simpleperf
96```
97
98The ndk package is generated in `out/` directory.
99