tree: d148acf9619d198c4979cd6a311753a8b8040082 [path history] [tgz]
  1. app_api/
  2. demo/
  3. doc/
  4. include/
  5. nonlinux_support/
  6. runtest/
  7. rust/
  8. scripts/
  9. simpleperf_app_runner/
  10. testdata/
  11. .gitignore
  12. Android.bp
  13. Android.mk
  14. build_id.h
  15. callchain.h
  16. CallChainJoiner.cpp
  17. CallChainJoiner.h
  18. CallChainJoiner_test.cpp
  19. cmd_api.cpp
  20. cmd_api_impl.h
  21. cmd_api_test.cpp
  22. cmd_debug_unwind.cpp
  23. cmd_debug_unwind_test.cpp
  24. cmd_dumprecord.cpp
  25. cmd_dumprecord_test.cpp
  26. cmd_help.cpp
  27. cmd_inject.cpp
  28. cmd_inject_impl.h
  29. cmd_inject_test.cpp
  30. cmd_kmem.cpp
  31. cmd_kmem_test.cpp
  32. cmd_list.cpp
  33. cmd_list_test.cpp
  34. cmd_merge.cpp
  35. cmd_merge_test.cpp
  36. cmd_monitor.cpp
  37. cmd_monitor_test.cpp
  38. cmd_record.cpp
  39. cmd_record_impl.h
  40. cmd_record_test.cpp
  41. cmd_report.cpp
  42. cmd_report_sample.cpp
  43. cmd_report_sample.proto
  44. cmd_report_sample_test.cpp
  45. cmd_report_test.cpp
  46. cmd_stat.cpp
  47. cmd_stat_impl.h
  48. cmd_stat_test.cpp
  49. cmd_trace_sched.cpp
  50. cmd_trace_sched_test.cpp
  51. command.cpp
  52. command.h
  53. command_test.cpp
  54. cpu_hotplug_test.cpp
  55. dso.cpp
  56. dso.h
  57. dso_test.cpp
  58. environment.cpp
  59. environment.h
  60. environment_test.cpp
  61. etm_branch_list.proto
  62. ETMConstants.h
  63. ETMDecoder.cpp
  64. ETMDecoder.h
  65. ETMRecorder.cpp
  66. ETMRecorder.h
  67. event_attr.cpp
  68. event_attr.h
  69. event_fd.cpp
  70. event_fd.h
  71. event_selection_set.cpp
  72. event_selection_set.h
  73. event_type.cpp
  74. event_type.h
  75. event_type_table.h
  76. generate_event_type_table.py
  77. get_test_data.h
  78. gtest_main.cpp
  79. IOEventLoop.cpp
  80. IOEventLoop.h
  81. IOEventLoop_test.cpp
  82. JITDebugReader.cpp
  83. JITDebugReader.h
  84. kallsyms.cpp
  85. kallsyms.h
  86. kallsyms_test.cpp
  87. libsimpleperf_report_fuzzer.cpp
  88. main.cpp
  89. MapRecordReader.cpp
  90. MapRecordReader.h
  91. MapRecordReader_test.cpp
  92. NOTICE
  93. OfflineUnwinder.cpp
  94. OfflineUnwinder.h
  95. OfflineUnwinder_impl.h
  96. OfflineUnwinder_test.cpp
  97. OWNERS
  98. perf_event.h
  99. perf_regs.cpp
  100. perf_regs.h
  101. perf_regs_test.cpp
  102. ProbeEvents.cpp
  103. ProbeEvents.h
  104. ProbeEvents_test.cpp
  105. profcollect.cpp
  106. read_apk.cpp
  107. read_apk.h
  108. read_apk_test.cpp
  109. read_dex_file.cpp
  110. read_dex_file.h
  111. read_dex_file_test.cpp
  112. read_elf.cpp
  113. read_elf.h
  114. read_elf_test.cpp
  115. read_symbol_map.cpp
  116. read_symbol_map.h
  117. read_symbol_map_test.cpp
  118. README.md
  119. record.cpp
  120. record.h
  121. record_equal_test.h
  122. record_file.h
  123. record_file.proto
  124. record_file_format.h
  125. record_file_reader.cpp
  126. record_file_test.cpp
  127. record_file_writer.cpp
  128. record_lib_interface.cpp
  129. record_lib_test.cpp
  130. record_test.cpp
  131. RecordFilter.cpp
  132. RecordFilter.h
  133. RecordFilter_test.cpp
  134. RecordReadThread.cpp
  135. RecordReadThread.h
  136. RecordReadThread_test.cpp
  137. report_lib_interface.cpp
  138. report_utils.cpp
  139. report_utils.h
  140. report_utils_test.cpp
  141. sample_tree.h
  142. sample_tree_test.cpp
  143. SampleComparator.h
  144. SampleDisplayer.h
  145. TEST_MAPPING
  146. test_util.cpp
  147. test_util.h
  148. thread_tree.cpp
  149. thread_tree.h
  150. thread_tree_test.cpp
  151. tracing.cpp
  152. tracing.h
  153. tracing_test.cpp
  154. utils.cpp
  155. utils.h
  156. utils_test.cpp
  157. workload.cpp
  158. workload.h
  159. workload_test.cpp
simpleperf/README.md

Simpleperf

This file is documentation for simpleperf maintainers. There is also user documentation.

Building new prebuilts

To snap the aosp-simpleperf-release branch to ToT AOSP main and kick off a build, use this coastguard page and choose “aosp-simpleperf-release” from the “Branch” dropdown. Then click “Submit build requests”. You'll get emails keeping you up to date with the progress of the snap and the build.

Updating the prebuilts

Once you have the build id (a 7-digit number) and the build is complete, run the update script from within the system/extras/simpleperf directory:

$ ./scripts/update.py --build 1234567

This will create a new change that you can repo upload, then approve and submit as normal.

For testing, I usually only run python host tests as below:

$ ./scripts/test/test.py --only-host-test

To test all scripts, please use python 3.8+ and install below packages:

$ pip install bokeh jinja2 pandas protobuf textable

Updating the prebuilts in prebuilts/simpleperf

Download ndk branch.

$ repo init -u persistent-https://android.git.corp.google.com/platform/manifest -b master-ndk
$ repo sync

In prebuilts/simpleperf, run update.py:

$ ./update.py --build <bid>

Then manually edit ChangeLog. This will create a new change that you can repo upload, then approve and submit as normal.

For testing, we need to test if the scripts run on darwin/linux/windows for different android versions. I usually split it to four parts:

  1. Test on android emulators running on linux x86_64 host, for android version N/O/P/Q/R/S/current.
$ ./test/test.py -d <devices> -r 3

The scripts support android >= N. But it's easier to test old versions on emulators. So I only test android N on emulators.

Currently, the tests have problems in clean up. So tests on emulator may fail and take too long to run. And there are a few known failed cases. Hopefully they will be fixed soon.

  1. Test on android devices connected to linux x86_64 host, for android version O/P/Q/R/S/current.
$ ./test/test.py -d <devices> -r 3
  1. Test on an android device connected to darwin x86_64 host, for one of android version O/P/Q/R/S/current.
$ ./test/test.py -d <devices> -r 1
  1. Test on an android device connected to darwin x86_64 host, for one of android version O/P/Q/R/S/current.
$ ./test/test.py -d <devices> -r 1

To check simpleperf contents released in ndk, we can build ndk package.

$ <top_dir>/ndk/checkbuild.py --package --system linux --module simpleperf

The ndk package is generated in out/ directory.