tree: c29ee32ca802a8c00f2418654557d3c1c49a7f75 [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_boot_record.cpp
  23. cmd_boot_record_test.cpp
  24. cmd_debug_unwind.cpp
  25. cmd_debug_unwind_test.cpp
  26. cmd_dumprecord.cpp
  27. cmd_dumprecord_test.cpp
  28. cmd_help.cpp
  29. cmd_inject.cpp
  30. cmd_inject_impl.h
  31. cmd_inject_test.cpp
  32. cmd_kmem.cpp
  33. cmd_kmem_test.cpp
  34. cmd_list.cpp
  35. cmd_list_test.cpp
  36. cmd_merge.cpp
  37. cmd_merge_test.cpp
  38. cmd_monitor.cpp
  39. cmd_monitor_test.cpp
  40. cmd_record.cpp
  41. cmd_record_impl.h
  42. cmd_record_test.cpp
  43. cmd_report.cpp
  44. cmd_report_sample.cpp
  45. cmd_report_sample.proto
  46. cmd_report_sample_test.cpp
  47. cmd_report_test.cpp
  48. cmd_stat.cpp
  49. cmd_stat_impl.h
  50. cmd_stat_test.cpp
  51. cmd_trace_sched.cpp
  52. cmd_trace_sched_test.cpp
  53. command.cpp
  54. command.h
  55. command_test.cpp
  56. cpu_hotplug_test.cpp
  57. dso.cpp
  58. dso.h
  59. dso_test.cpp
  60. environment.cpp
  61. environment.h
  62. environment_test.cpp
  63. etm_branch_list.proto
  64. ETMConstants.h
  65. ETMDecoder.cpp
  66. ETMDecoder.h
  67. ETMRecorder.cpp
  68. ETMRecorder.h
  69. event_attr.cpp
  70. event_attr.h
  71. event_fd.cpp
  72. event_fd.h
  73. event_selection_set.cpp
  74. event_selection_set.h
  75. event_type.cpp
  76. event_type.h
  77. event_type_table.h
  78. generate_event_type_table.py
  79. get_test_data.h
  80. gtest_main.cpp
  81. IOEventLoop.cpp
  82. IOEventLoop.h
  83. IOEventLoop_test.cpp
  84. JITDebugReader.cpp
  85. JITDebugReader.h
  86. JITDebugReader_impl.h
  87. JITDebugReader_test.cpp
  88. kallsyms.cpp
  89. kallsyms.h
  90. kallsyms_test.cpp
  91. libsimpleperf_report_fuzzer.cpp
  92. main.cpp
  93. MapRecordReader.cpp
  94. MapRecordReader.h
  95. MapRecordReader_test.cpp
  96. NOTICE
  97. OfflineUnwinder.cpp
  98. OfflineUnwinder.h
  99. OfflineUnwinder_impl.h
  100. OfflineUnwinder_test.cpp
  101. OWNERS
  102. perf_event.h
  103. perf_regs.cpp
  104. perf_regs.h
  105. perf_regs_test.cpp
  106. ProbeEvents.cpp
  107. ProbeEvents.h
  108. ProbeEvents_test.cpp
  109. profcollect.cpp
  110. read_apk.cpp
  111. read_apk.h
  112. read_apk_test.cpp
  113. read_dex_file.cpp
  114. read_dex_file.h
  115. read_dex_file_test.cpp
  116. read_elf.cpp
  117. read_elf.h
  118. read_elf_test.cpp
  119. read_symbol_map.cpp
  120. read_symbol_map.h
  121. read_symbol_map_test.cpp
  122. README.md
  123. record.cpp
  124. record.h
  125. record_equal_test.h
  126. record_file.h
  127. record_file.proto
  128. record_file_format.h
  129. record_file_reader.cpp
  130. record_file_test.cpp
  131. record_file_writer.cpp
  132. record_lib_interface.cpp
  133. record_lib_test.cpp
  134. record_test.cpp
  135. RecordFilter.cpp
  136. RecordFilter.h
  137. RecordFilter_test.cpp
  138. RecordReadThread.cpp
  139. RecordReadThread.h
  140. RecordReadThread_test.cpp
  141. report_lib_interface.cpp
  142. report_utils.cpp
  143. report_utils.h
  144. report_utils_test.cpp
  145. sample_tree.h
  146. sample_tree_test.cpp
  147. SampleComparator.h
  148. SampleDisplayer.h
  149. simpleperf.rc
  150. TEST_MAPPING
  151. test_util.cpp
  152. test_util.h
  153. thread_tree.cpp
  154. thread_tree.h
  155. thread_tree_test.cpp
  156. tracing.cpp
  157. tracing.h
  158. tracing_test.cpp
  159. utils.cpp
  160. utils.h
  161. utils_test.cpp
  162. workload.cpp
  163. workload.h
  164. 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.