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