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