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

Simpleperf

Android Studio includes a graphical front end to Simpleperf, documented in Inspect CPU activity with CPU Profiler. Most users will prefer to use that instead of using Simpleperf directly.

If you prefer to use the command line, Simpleperf is a versatile command-line CPU profiling tool included in the NDK for Mac, Linux, and Windows.

This file contains 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.