• Home
Name Date Size #Lines LOC

..--

CtsSimpleperfTestCases_testdata/03-May-2024-

app_api/03-May-2024-1,274871

demo/03-May-2024-4,8713,983

doc/03-May-2024-33,21132,147

include/03-May-2024-12446

nonlinux_support/03-May-2024-14662

runtest/03-May-2024-1,2081,010

rust/03-May-2024-10058

scripts/03-May-2024-86,81983,728

simpleperf_app_runner/03-May-2024-312248

testdata/03-May-2024-50,75049,244

.clang-formatD03-May-2024239

.gitignoreD03-May-20245 11

Android.bpD03-May-202418 KiB764733

Android.mkD03-May-20241.5 KiB4419

CallChainJoiner.cppD03-May-202413.8 KiB428358

CallChainJoiner.hD03-May-20245.9 KiB182117

CallChainJoiner_test.cppD03-May-20249.9 KiB263213

ETMBranchListFile.cppD03-May-202412.6 KiB386326

ETMBranchListFile.hD03-May-20244.8 KiB153105

ETMBranchListFile_test.cppD03-May-20241.1 KiB3616

ETMConstants.hD03-May-20241.1 KiB3110

ETMDecoder.cppD03-May-202435.2 KiB983789

ETMDecoder.hD03-May-20243.2 KiB9851

ETMRecorder.cppD03-May-20247.9 KiB267217

ETMRecorder.hD03-May-20242.4 KiB8445

IOEventLoop.cppD03-May-20246.9 KiB238188

IOEventLoop.hD03-May-20243.5 KiB10950

IOEventLoop_test.cppD03-May-20247.1 KiB295253

JITDebugReader.cppD03-May-202427.3 KiB755625

JITDebugReader.hD03-May-20249 KiB239157

JITDebugReader_impl.hD03-May-20242.4 KiB9363

JITDebugReader_test.cppD03-May-20241.5 KiB4418

MapRecordReader.cppD03-May-20245.5 KiB191152

MapRecordReader.hD03-May-20242.3 KiB7844

MapRecordReader_test.cppD03-May-20242.4 KiB8558

NOTICED03-May-202410.4 KiB191158

OWNERSD03-May-202489 43

OfflineUnwinder.cppD03-May-202415.8 KiB369302

OfflineUnwinder.hD03-May-20243.1 KiB8953

OfflineUnwinder_impl.hD03-May-20241.6 KiB5528

OfflineUnwinder_test.cppD03-May-20243.7 KiB11881

ProbeEvents.cppD03-May-20245 KiB164123

ProbeEvents.hD03-May-20241.6 KiB5525

ProbeEvents_test.cppD03-May-20241.8 KiB5226

README.mdD03-May-20243.1 KiB9970

RecordFilter.cppD03-May-202412.5 KiB417352

RecordFilter.hD03-May-20247 KiB146108

RecordFilter_test.cppD03-May-20249.6 KiB302236

RecordReadThread.cppD03-May-202423.9 KiB674581

RecordReadThread.hD03-May-20247.7 KiB221138

RecordReadThread_test.cppD03-May-202421.8 KiB572496

RegEx.cppD03-May-20242.4 KiB8150

RegEx.hD03-May-20241.7 KiB5528

RegEx_test.cppD03-May-20241.4 KiB4825

SampleComparator.hD03-May-20244.2 KiB12986

SampleDisplayer.hD03-May-202410 KiB303245

TEST_MAPPINGD03-May-202475 77

build_id.hD03-May-20243 KiB10866

callchain.hD03-May-20245.1 KiB158123

cmd_api.cppD03-May-20249.5 KiB299246

cmd_api_impl.hD03-May-20241.3 KiB3514

cmd_api_test.cppD03-May-20243 KiB10770

cmd_boot_record.cppD03-May-20246 KiB193152

cmd_boot_record_test.cppD03-May-20241.5 KiB4218

cmd_debug_unwind.cppD03-May-202427.2 KiB738641

cmd_debug_unwind_test.cppD03-May-20247.4 KiB181137

cmd_dumprecord.cppD03-May-202419.5 KiB585513

cmd_dumprecord_test.cppD03-May-20242.9 KiB8453

cmd_help.cppD03-May-20242.9 KiB9764

cmd_inject.cppD03-May-202427.3 KiB787658

cmd_inject_test.cppD03-May-20248.7 KiB227166

cmd_kmem.cppD03-May-202425.8 KiB695611

cmd_kmem_test.cppD03-May-20244.5 KiB145110

cmd_list.cppD03-May-20247.4 KiB221177

cmd_list_test.cppD03-May-20241.3 KiB5327

cmd_merge.cppD03-May-202414.6 KiB430364

cmd_merge_test.cppD03-May-20243.1 KiB9358

cmd_monitor.cppD03-May-202422.4 KiB626511

cmd_monitor_test.cppD03-May-20243.8 KiB139102

cmd_record.cppD03-May-202487.6 KiB2,3251,984

cmd_record_impl.hD03-May-20246.1 KiB10480

cmd_record_test.cppD03-May-202446.8 KiB1,3071,092

cmd_report.cppD03-May-202440.9 KiB1,062929

cmd_report_sample.cppD03-May-202435.1 KiB906809

cmd_report_sample.protoD03-May-20246.1 KiB165141

cmd_report_sample_test.cppD03-May-202412.1 KiB278214

cmd_report_test.cppD03-May-202424.2 KiB685587

cmd_stat.cppD03-May-202435.1 KiB979855

cmd_stat_impl.hD03-May-202412.9 KiB359289

cmd_stat_test.cppD03-May-202421.5 KiB620519

cmd_trace_sched.cppD03-May-202414.8 KiB423370

cmd_trace_sched_test.cppD03-May-20242 KiB6439

command.cppD03-May-20249.9 KiB306257

command.hD03-May-20247.4 KiB225171

command_test.cppD03-May-20247.6 KiB181136

cpu_hotplug_test.cppD03-May-202415.7 KiB504422

dso.cppD03-May-202434.3 KiB1,055876

dso.hD03-May-20248 KiB236157

dso_test.cppD03-May-202415.1 KiB381302

environment.cppD03-May-202432.1 KiB1,028857

environment.hD03-May-20244.7 KiB162109

environment_test.cppD03-May-20244.8 KiB145110

etm_branch_list.protoD03-May-20241.8 KiB6753

event_attr.cppD03-May-202410.2 KiB265202

event_attr.hD03-May-20242.1 KiB6432

event_fd.cppD03-May-202411.3 KiB334268

event_fd.hD03-May-20245.5 KiB16186

event_selection_set.cppD03-May-202429.3 KiB905768

event_selection_set.hD03-May-20247.9 KiB234154

event_type.cppD03-May-202417.5 KiB594497

event_type.hD03-May-20244.1 KiB13789

event_type_table.hD03-May-202433.1 KiB497491

generate_event_type_table.pyD03-May-202419.3 KiB306256

get_test_data.hD03-May-20246.9 KiB14854

gtest_main.cppD03-May-20243.4 KiB12885

kallsyms.cppD03-May-20248.4 KiB289222

kallsyms.hD03-May-20241.8 KiB6021

kallsyms_test.cppD03-May-20244.4 KiB141105

libsimpleperf_report_fuzzer.cppD03-May-2024918 4031

main.cppD03-May-20243.2 KiB8144

perf_event.hD03-May-2024950 3111

perf_regs.cppD03-May-20248 KiB281240

perf_regs.hD03-May-20242.9 KiB11380

perf_regs_test.cppD03-May-20241.2 KiB3919

profcollect.cppD03-May-20244.5 KiB12796

read_apk.cppD03-May-20246 KiB172129

read_apk.hD03-May-20243.4 KiB9550

read_apk_test.cppD03-May-20243.4 KiB8357

read_dex_file.cppD03-May-20243.4 KiB9367

read_dex_file.hD03-May-20241.5 KiB4722

read_dex_file_test.cppD03-May-20241.4 KiB4422

read_elf.cppD03-May-202419.4 KiB572488

read_elf.hD03-May-20243.6 KiB11875

read_elf_test.cppD03-May-20248.8 KiB260206

read_symbol_map.cppD03-May-20242.5 KiB10971

read_symbol_map.hD03-May-20241.1 KiB3915

read_symbol_map_test.cppD03-May-20241.6 KiB5730

record.cppD03-May-202457.7 KiB1,7131,576

record.hD03-May-202419.9 KiB702512

record_equal_test.hD03-May-20244.5 KiB11693

record_file.hD03-May-20249 KiB258165

record_file.protoD03-May-20241.4 KiB6150

record_file_format.hD03-May-20243.6 KiB15560

record_file_reader.cppD03-May-202427.1 KiB867785

record_file_test.cppD03-May-20249.2 KiB257189

record_file_writer.cppD03-May-202415.9 KiB527445

record_lib_interface.cppD03-May-20247.7 KiB298242

record_lib_test.cppD03-May-20245.3 KiB144118

record_test.cppD03-May-20247.9 KiB196159

report_lib_interface.cppD03-May-202423.4 KiB716602

report_utils.cppD03-May-202415.6 KiB436354

report_utils.hD03-May-20244.7 KiB160105

report_utils_test.cppD03-May-202426.5 KiB584492

sample_tree.hD03-May-202412 KiB351267

sample_tree_test.cppD03-May-20248.3 KiB234190

simpleperf.rcD03-May-2024212 42

test_util.cppD03-May-20245.9 KiB178138

test_util.hD03-May-20247.6 KiB204161

thread_tree.cppD03-May-202414 KiB440363

thread_tree.hD03-May-20246.2 KiB177118

thread_tree_test.cppD03-May-20244.6 KiB153106

tracing.cppD03-May-202419 KiB641543

tracing.hD03-May-20243.6 KiB13088

tracing_test.cppD03-May-20244.3 KiB10373

utils.cppD03-May-202413.4 KiB502435

utils.hD03-May-20248 KiB296221

utils_test.cppD03-May-20243.7 KiB10879

workload.cppD03-May-20246.8 KiB230188

workload.hD03-May-20242.4 KiB8046

workload_test.cppD03-May-20242.4 KiB7951

README.md

1# Simpleperf
2
3Android Studio includes a graphical front end to Simpleperf, documented in
4[Inspect CPU activity with CPU Profiler](https://developer.android.com/studio/profile/cpu-profiler).
5Most users will prefer to use that instead of using Simpleperf directly.
6
7If you prefer to use the command line, Simpleperf is a versatile command-line
8CPU profiling tool included in the NDK for Mac, Linux, and Windows.
9
10This file contains documentation for simpleperf maintainers.
11
12There is also [user documentation](doc/README.md).
13
14## Building new prebuilts
15
16To snap the aosp-simpleperf-release branch to ToT AOSP main and kick off a
17build, use [this coastguard
18page](https://android-build.googleplex.com/coastguard/dashboard/5938649007521792/#/request/create)
19and choose "aosp-simpleperf-release" from the "Branch" dropdown. Then click
20"Submit build requests". You'll get emails keeping you up to date with the
21progress of the snap and the build.
22
23## Updating the prebuilts
24
25Once you have the build id (a 7-digit number) and the build is complete, run the
26update script from within the `system/extras/simpleperf` directory:
27```
28$ ./scripts/update.py --build 1234567
29```
30
31This will create a new change that you can `repo upload`, then approve and
32submit as normal.
33
34For testing, I usually only run python host tests as below:
35```
36$ ./scripts/test/test.py --only-host-test
37```
38
39To test all scripts, please use python 3.8+ and install below packages:
40```
41$ pip install bokeh jinja2 pandas protobuf textable
42```
43
44## Updating the prebuilts in prebuilts/simpleperf
45
46Download ndk branch.
47```
48$ repo init -u persistent-https://android.git.corp.google.com/platform/manifest -b master-ndk
49$ repo sync
50```
51
52In prebuilts/simpleperf, run `update.py`:
53```
54$ ./update.py --build <bid>
55```
56
57Then manually edit `ChangeLog`.
58This will create a new change that you can `repo upload`, then approve and submit as normal.
59
60For testing, we need to test if the scripts run on darwin/linux/windows for different android
61versions. I usually split it to four parts:
62
631. Test on android emulators running on linux x86_64 host, for android version N/O/P/Q/R/S/current.
64
65```
66$ ./test/test.py -d <devices> -r 3
67```
68
69The scripts support android >= N. But it's easier to test old versions on emulators. So I only test
70android N on emulators.
71
72Currently, the tests have problems in clean up. So tests on emulator may fail and take too long to
73run. And there are a few known failed cases. Hopefully they will be fixed soon.
74
751. Test on android devices connected to linux x86_64 host, for android version O/P/Q/R/S/current.
76
77```
78$ ./test/test.py -d <devices> -r 3
79```
80
813. Test on an android device connected to darwin x86_64 host, for one of android version O/P/Q/R/S/current.
82
83```
84$ ./test/test.py -d <devices> -r 1
85```
86
874. Test on an android device connected to darwin x86_64 host, for one of android version O/P/Q/R/S/current.
88
89```
90$ ./test/test.py -d <devices> -r 1
91```
92
93To check simpleperf contents released in ndk, we can build ndk package.
94```
95$ <top_dir>/ndk/checkbuild.py --package --system linux --module simpleperf
96```
97
98The ndk package is generated in `out/` directory.
99