android13/system/extras/simpleperf
liiir1985 7f62dcda9f initial 2024-06-22 20:45:49 +08:00
..
app_api initial 2024-06-22 20:45:49 +08:00
demo initial 2024-06-22 20:45:49 +08:00
doc initial 2024-06-22 20:45:49 +08:00
include initial 2024-06-22 20:45:49 +08:00
nonlinux_support initial 2024-06-22 20:45:49 +08:00
runtest initial 2024-06-22 20:45:49 +08:00
rust initial 2024-06-22 20:45:49 +08:00
scripts initial 2024-06-22 20:45:49 +08:00
simpleperf_app_runner initial 2024-06-22 20:45:49 +08:00
testdata initial 2024-06-22 20:45:49 +08:00
.clang-format initial 2024-06-22 20:45:49 +08:00
.gitignore initial 2024-06-22 20:45:49 +08:00
Android.bp initial 2024-06-22 20:45:49 +08:00
Android.mk initial 2024-06-22 20:45:49 +08:00
CallChainJoiner.cpp initial 2024-06-22 20:45:49 +08:00
CallChainJoiner.h initial 2024-06-22 20:45:49 +08:00
CallChainJoiner_test.cpp initial 2024-06-22 20:45:49 +08:00
CtsSimpleperfTestCases_testdata initial 2024-06-22 20:45:49 +08:00
ETMConstants.h initial 2024-06-22 20:45:49 +08:00
ETMDecoder.cpp initial 2024-06-22 20:45:49 +08:00
ETMDecoder.h initial 2024-06-22 20:45:49 +08:00
ETMRecorder.cpp initial 2024-06-22 20:45:49 +08:00
ETMRecorder.h initial 2024-06-22 20:45:49 +08:00
IOEventLoop.cpp initial 2024-06-22 20:45:49 +08:00
IOEventLoop.h initial 2024-06-22 20:45:49 +08:00
IOEventLoop_test.cpp initial 2024-06-22 20:45:49 +08:00
JITDebugReader.cpp initial 2024-06-22 20:45:49 +08:00
JITDebugReader.h initial 2024-06-22 20:45:49 +08:00
JITDebugReader_impl.h initial 2024-06-22 20:45:49 +08:00
JITDebugReader_test.cpp initial 2024-06-22 20:45:49 +08:00
MapRecordReader.cpp initial 2024-06-22 20:45:49 +08:00
MapRecordReader.h initial 2024-06-22 20:45:49 +08:00
MapRecordReader_test.cpp initial 2024-06-22 20:45:49 +08:00
NOTICE initial 2024-06-22 20:45:49 +08:00
OWNERS initial 2024-06-22 20:45:49 +08:00
OfflineUnwinder.cpp initial 2024-06-22 20:45:49 +08:00
OfflineUnwinder.h initial 2024-06-22 20:45:49 +08:00
OfflineUnwinder_impl.h initial 2024-06-22 20:45:49 +08:00
OfflineUnwinder_test.cpp initial 2024-06-22 20:45:49 +08:00
ProbeEvents.cpp initial 2024-06-22 20:45:49 +08:00
ProbeEvents.h initial 2024-06-22 20:45:49 +08:00
ProbeEvents_test.cpp initial 2024-06-22 20:45:49 +08:00
README.md initial 2024-06-22 20:45:49 +08:00
RecordFilter.cpp initial 2024-06-22 20:45:49 +08:00
RecordFilter.h initial 2024-06-22 20:45:49 +08:00
RecordFilter_test.cpp initial 2024-06-22 20:45:49 +08:00
RecordReadThread.cpp initial 2024-06-22 20:45:49 +08:00
RecordReadThread.h initial 2024-06-22 20:45:49 +08:00
RecordReadThread_test.cpp initial 2024-06-22 20:45:49 +08:00
SampleComparator.h initial 2024-06-22 20:45:49 +08:00
SampleDisplayer.h initial 2024-06-22 20:45:49 +08:00
TEST_MAPPING initial 2024-06-22 20:45:49 +08:00
build_id.h initial 2024-06-22 20:45:49 +08:00
callchain.h initial 2024-06-22 20:45:49 +08:00
cmd_api.cpp initial 2024-06-22 20:45:49 +08:00
cmd_api_impl.h initial 2024-06-22 20:45:49 +08:00
cmd_api_test.cpp initial 2024-06-22 20:45:49 +08:00
cmd_boot_record.cpp initial 2024-06-22 20:45:49 +08:00
cmd_boot_record_test.cpp initial 2024-06-22 20:45:49 +08:00
cmd_debug_unwind.cpp initial 2024-06-22 20:45:49 +08:00
cmd_debug_unwind_test.cpp initial 2024-06-22 20:45:49 +08:00
cmd_dumprecord.cpp initial 2024-06-22 20:45:49 +08:00
cmd_dumprecord_test.cpp initial 2024-06-22 20:45:49 +08:00
cmd_help.cpp initial 2024-06-22 20:45:49 +08:00
cmd_inject.cpp initial 2024-06-22 20:45:49 +08:00
cmd_inject_impl.h initial 2024-06-22 20:45:49 +08:00
cmd_inject_test.cpp initial 2024-06-22 20:45:49 +08:00
cmd_kmem.cpp initial 2024-06-22 20:45:49 +08:00
cmd_kmem_test.cpp initial 2024-06-22 20:45:49 +08:00
cmd_list.cpp initial 2024-06-22 20:45:49 +08:00
cmd_list_test.cpp initial 2024-06-22 20:45:49 +08:00
cmd_merge.cpp initial 2024-06-22 20:45:49 +08:00
cmd_merge_test.cpp initial 2024-06-22 20:45:49 +08:00
cmd_monitor.cpp initial 2024-06-22 20:45:49 +08:00
cmd_monitor_test.cpp initial 2024-06-22 20:45:49 +08:00
cmd_record.cpp initial 2024-06-22 20:45:49 +08:00
cmd_record_impl.h initial 2024-06-22 20:45:49 +08:00
cmd_record_test.cpp initial 2024-06-22 20:45:49 +08:00
cmd_report.cpp initial 2024-06-22 20:45:49 +08:00
cmd_report_sample.cpp initial 2024-06-22 20:45:49 +08:00
cmd_report_sample.proto initial 2024-06-22 20:45:49 +08:00
cmd_report_sample_test.cpp initial 2024-06-22 20:45:49 +08:00
cmd_report_test.cpp initial 2024-06-22 20:45:49 +08:00
cmd_stat.cpp initial 2024-06-22 20:45:49 +08:00
cmd_stat_impl.h initial 2024-06-22 20:45:49 +08:00
cmd_stat_test.cpp initial 2024-06-22 20:45:49 +08:00
cmd_trace_sched.cpp initial 2024-06-22 20:45:49 +08:00
cmd_trace_sched_test.cpp initial 2024-06-22 20:45:49 +08:00
command.cpp initial 2024-06-22 20:45:49 +08:00
command.h initial 2024-06-22 20:45:49 +08:00
command_test.cpp initial 2024-06-22 20:45:49 +08:00
cpu_hotplug_test.cpp initial 2024-06-22 20:45:49 +08:00
dso.cpp initial 2024-06-22 20:45:49 +08:00
dso.h initial 2024-06-22 20:45:49 +08:00
dso_test.cpp initial 2024-06-22 20:45:49 +08:00
environment.cpp initial 2024-06-22 20:45:49 +08:00
environment.h initial 2024-06-22 20:45:49 +08:00
environment_test.cpp initial 2024-06-22 20:45:49 +08:00
etm_branch_list.proto initial 2024-06-22 20:45:49 +08:00
event_attr.cpp initial 2024-06-22 20:45:49 +08:00
event_attr.h initial 2024-06-22 20:45:49 +08:00
event_fd.cpp initial 2024-06-22 20:45:49 +08:00
event_fd.h initial 2024-06-22 20:45:49 +08:00
event_selection_set.cpp initial 2024-06-22 20:45:49 +08:00
event_selection_set.h initial 2024-06-22 20:45:49 +08:00
event_type.cpp initial 2024-06-22 20:45:49 +08:00
event_type.h initial 2024-06-22 20:45:49 +08:00
event_type_table.h initial 2024-06-22 20:45:49 +08:00
generate_event_type_table.py initial 2024-06-22 20:45:49 +08:00
get_test_data.h initial 2024-06-22 20:45:49 +08:00
gtest_main.cpp initial 2024-06-22 20:45:49 +08:00
kallsyms.cpp initial 2024-06-22 20:45:49 +08:00
kallsyms.h initial 2024-06-22 20:45:49 +08:00
kallsyms_test.cpp initial 2024-06-22 20:45:49 +08:00
libsimpleperf_report_fuzzer.cpp initial 2024-06-22 20:45:49 +08:00
main.cpp initial 2024-06-22 20:45:49 +08:00
perf_event.h initial 2024-06-22 20:45:49 +08:00
perf_regs.cpp initial 2024-06-22 20:45:49 +08:00
perf_regs.h initial 2024-06-22 20:45:49 +08:00
perf_regs_test.cpp initial 2024-06-22 20:45:49 +08:00
profcollect.cpp initial 2024-06-22 20:45:49 +08:00
read_apk.cpp initial 2024-06-22 20:45:49 +08:00
read_apk.h initial 2024-06-22 20:45:49 +08:00
read_apk_test.cpp initial 2024-06-22 20:45:49 +08:00
read_dex_file.cpp initial 2024-06-22 20:45:49 +08:00
read_dex_file.h initial 2024-06-22 20:45:49 +08:00
read_dex_file_test.cpp initial 2024-06-22 20:45:49 +08:00
read_elf.cpp initial 2024-06-22 20:45:49 +08:00
read_elf.h initial 2024-06-22 20:45:49 +08:00
read_elf_test.cpp initial 2024-06-22 20:45:49 +08:00
read_symbol_map.cpp initial 2024-06-22 20:45:49 +08:00
read_symbol_map.h initial 2024-06-22 20:45:49 +08:00
read_symbol_map_test.cpp initial 2024-06-22 20:45:49 +08:00
record.cpp initial 2024-06-22 20:45:49 +08:00
record.h initial 2024-06-22 20:45:49 +08:00
record_equal_test.h initial 2024-06-22 20:45:49 +08:00
record_file.h initial 2024-06-22 20:45:49 +08:00
record_file.proto initial 2024-06-22 20:45:49 +08:00
record_file_format.h initial 2024-06-22 20:45:49 +08:00
record_file_reader.cpp initial 2024-06-22 20:45:49 +08:00
record_file_test.cpp initial 2024-06-22 20:45:49 +08:00
record_file_writer.cpp initial 2024-06-22 20:45:49 +08:00
record_lib_interface.cpp initial 2024-06-22 20:45:49 +08:00
record_lib_test.cpp initial 2024-06-22 20:45:49 +08:00
record_test.cpp initial 2024-06-22 20:45:49 +08:00
report_lib_interface.cpp initial 2024-06-22 20:45:49 +08:00
report_utils.cpp initial 2024-06-22 20:45:49 +08:00
report_utils.h initial 2024-06-22 20:45:49 +08:00
report_utils_test.cpp initial 2024-06-22 20:45:49 +08:00
sample_tree.h initial 2024-06-22 20:45:49 +08:00
sample_tree_test.cpp initial 2024-06-22 20:45:49 +08:00
simpleperf.rc initial 2024-06-22 20:45:49 +08:00
test_util.cpp initial 2024-06-22 20:45:49 +08:00
test_util.h initial 2024-06-22 20:45:49 +08:00
thread_tree.cpp initial 2024-06-22 20:45:49 +08:00
thread_tree.h initial 2024-06-22 20:45:49 +08:00
thread_tree_test.cpp initial 2024-06-22 20:45:49 +08:00
tracing.cpp initial 2024-06-22 20:45:49 +08:00
tracing.h initial 2024-06-22 20:45:49 +08:00
tracing_test.cpp initial 2024-06-22 20:45:49 +08:00
utils.cpp initial 2024-06-22 20:45:49 +08:00
utils.h initial 2024-06-22 20:45:49 +08:00
utils_test.cpp initial 2024-06-22 20:45:49 +08:00
workload.cpp initial 2024-06-22 20:45:49 +08:00
workload.h initial 2024-06-22 20:45:49 +08:00
workload_test.cpp initial 2024-06-22 20:45:49 +08:00

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.