• Home
  • History
  • Annotate
Name Date Size #Lines LOC

..--

CtsSimpleperfTestCases_testdata/15-Dec-2024-

app_api/14-Jan-2024-1,274871

demo/14-Jan-2024-4,8713,983

doc/15-Dec-2024-33,31832,233

include/15-Dec-2024-12547

nonlinux_support/14-Jan-2024-14662

runtest/15-Dec-2024-1,2141,015

rust/15-Dec-2024-8137

scripts/15-Dec-2024-18,25914,948

simpleperf_app_runner/14-Jan-2024-312248

testdata/15-Dec-2024-50,79849,288

.clang-formatD14-Jan-2024239

.gitignoreD14-Jan-20245 11

Android.bpD15-Dec-202418.3 KiB783751

Android.mkD14-Jan-20241.5 KiB4419

BranchListFile.cppD15-Dec-202414.9 KiB441380

BranchListFile.hD15-Dec-20245.5 KiB177122

BranchListFile_test.cppD15-Dec-20241.1 KiB3716

CallChainJoiner.cppD14-Jan-202413.8 KiB428358

CallChainJoiner.hD14-Jan-20245.9 KiB182117

CallChainJoiner_test.cppD15-Dec-202410.1 KiB272213

ETMConstants.hD15-Dec-20241.2 KiB3312

ETMDecoder.cppD15-Dec-202435.4 KiB988791

ETMDecoder.hD15-Dec-20243.3 KiB9851

ETMRecorder.cppD15-Dec-20249 KiB308251

ETMRecorder.hD15-Dec-20242.7 KiB9553

IOEventLoop.cppD15-Dec-20246.9 KiB232182

IOEventLoop.hD15-Dec-20243.7 KiB10950

IOEventLoop_test.cppD15-Dec-20248.1 KiB326271

JITDebugReader.cppD15-Dec-202429 KiB789655

JITDebugReader.hD15-Dec-20249.5 KiB256166

JITDebugReader_impl.hD14-Jan-20242.4 KiB9363

JITDebugReader_test.cppD15-Dec-20243.9 KiB10164

MapRecordReader.cppD14-Jan-20245.5 KiB191152

MapRecordReader.hD14-Jan-20242.3 KiB7844

MapRecordReader_test.cppD15-Dec-20242.5 KiB8958

NOTICED14-Jan-202410.4 KiB191158

OWNERSD14-Jan-202489 43

OfflineUnwinder.cppD14-Jan-202415.8 KiB369302

OfflineUnwinder.hD14-Jan-20243.1 KiB8953

OfflineUnwinder_impl.hD14-Jan-20241.6 KiB5528

OfflineUnwinder_test.cppD15-Dec-20243.8 KiB12181

ProbeEvents.cppD15-Dec-20245.3 KiB174130

ProbeEvents.hD15-Dec-20241.8 KiB5928

ProbeEvents_test.cppD15-Dec-20241.8 KiB5326

README.mdD14-Jan-20243.1 KiB9970

RecordFilter.cppD15-Dec-202416 KiB529446

RecordFilter.hD15-Dec-20247.1 KiB142101

RecordFilter_test.cppD15-Dec-202411.1 KiB361270

RecordReadThread.cppD15-Dec-202424.3 KiB686590

RecordReadThread.hD15-Dec-20247.7 KiB222139

RecordReadThread_test.cppD15-Dec-202422.1 KiB586496

RegEx.cppD15-Dec-20242.6 KiB9058

RegEx.hD15-Dec-20241.8 KiB5830

RegEx_test.cppD15-Dec-20241.4 KiB5025

SampleComparator.hD14-Jan-20244.2 KiB12986

SampleDisplayer.hD14-Jan-202410 KiB303245

TEST_MAPPINGD14-Jan-202475 77

branch_list.protoD15-Dec-20242.6 KiB9780

build_id.hD14-Jan-20243 KiB10866

callchain.hD14-Jan-20245.1 KiB158123

cmd_api.cppD14-Jan-20249.5 KiB299246

cmd_api_impl.hD14-Jan-20241.3 KiB3514

cmd_api_test.cppD15-Dec-20243 KiB11070

cmd_boot_record.cppD14-Jan-20246 KiB193152

cmd_boot_record_test.cppD15-Dec-20241.5 KiB4318

cmd_debug_unwind.cppD14-Jan-202427.2 KiB738641

cmd_debug_unwind_test.cppD15-Dec-20247.7 KiB193137

cmd_dumprecord.cppD15-Dec-202420.5 KiB608536

cmd_dumprecord_test.cppD15-Dec-20243.1 KiB9253

cmd_help.cppD14-Jan-20242.9 KiB9764

cmd_inject.cppD15-Dec-202438.2 KiB1,104943

cmd_inject_test.cppD15-Dec-202411 KiB289199

cmd_kmem.cppD15-Dec-202425.9 KiB699615

cmd_kmem_test.cppD15-Dec-20244.7 KiB152110

cmd_list.cppD15-Dec-202412.2 KiB383322

cmd_list_test.cppD15-Dec-20241.5 KiB5927

cmd_merge.cppD14-Jan-202414.6 KiB430364

cmd_merge_test.cppD15-Dec-20243.2 KiB9558

cmd_monitor.cppD15-Dec-202421.9 KiB615502

cmd_monitor_test.cppD15-Dec-20244.1 KiB150102

cmd_record.cppD15-Dec-202489.6 KiB2,3682,025

cmd_record_impl.hD15-Dec-20246.6 KiB11086

cmd_record_test.cppD15-Dec-202451.3 KiB1,4651,157

cmd_report.cppD15-Dec-202441 KiB1,067934

cmd_report_sample.cppD15-Dec-202438.7 KiB1,014900

cmd_report_sample.protoD14-Jan-20246.1 KiB165141

cmd_report_sample_test.cppD15-Dec-202413.6 KiB326234

cmd_report_test.cppD15-Dec-202425.7 KiB749597

cmd_stat.cppD15-Dec-202436.9 KiB1,011885

cmd_stat_impl.hD15-Dec-202412.4 KiB340273

cmd_stat_test.cppD15-Dec-202424.7 KiB720566

cmd_trace_sched.cppD15-Dec-202414.9 KiB426373

cmd_trace_sched_test.cppD15-Dec-20242.1 KiB6639

command.cppD15-Dec-20249.3 KiB285238

command.hD15-Dec-20247.9 KiB242187

command_test.cppD15-Dec-20247.7 KiB186136

cpu_hotplug_test.cppD14-Jan-202415.7 KiB504422

dso.cppD15-Dec-202434.4 KiB1,061878

dso.hD14-Jan-20248 KiB236157

dso_test.cppD15-Dec-202415.7 KiB403303

environment.cppD15-Dec-202434.1 KiB1,090911

environment.hD15-Dec-20244.9 KiB170115

environment_test.cppD15-Dec-20245.3 KiB165118

event_attr.cppD14-Jan-202410.2 KiB265202

event_attr.hD14-Jan-20242.1 KiB6432

event_fd.cppD14-Jan-202411.3 KiB334268

event_fd.hD14-Jan-20245.5 KiB16186

event_selection_set.cppD15-Dec-202432.6 KiB1,013867

event_selection_set.hD15-Dec-20248.7 KiB255169

event_selection_set_test.cppD15-Dec-20244.1 KiB9871

event_table.jsonD15-Dec-202497.8 KiB1,0431,042

event_table_generator.pyD15-Dec-20249 KiB254192

event_type.cppD15-Dec-202417.4 KiB593497

event_type.hD15-Dec-20244.2 KiB13890

get_test_data.hD14-Jan-20246.9 KiB14854

gtest_main.cppD15-Dec-20243.4 KiB12986

kallsyms.cppD14-Jan-20248.4 KiB289222

kallsyms.hD14-Jan-20241.8 KiB6021

kallsyms_test.cppD15-Dec-20244.5 KiB146105

libsimpleperf_report_fuzzer.cppD15-Dec-20242.9 KiB8861

main.cppD15-Dec-20243.2 KiB8245

perf_event.hD14-Jan-2024950 3111

perf_regs.cppD14-Jan-20248 KiB281240

perf_regs.hD14-Jan-20242.9 KiB11380

perf_regs_test.cppD15-Dec-20241.2 KiB4019

profcollect.cppD15-Dec-20244.3 KiB141104

read_apk.cppD14-Jan-20246 KiB172129

read_apk.hD14-Jan-20243.4 KiB9550

read_apk_test.cppD15-Dec-20243.5 KiB8657

read_dex_file.cppD15-Dec-20243.4 KiB9468

read_dex_file.hD15-Dec-20241.5 KiB4823

read_dex_file_test.cppD15-Dec-20241.5 KiB4522

read_elf.cppD15-Dec-202421.3 KiB632535

read_elf.hD14-Jan-20243.6 KiB11875

read_elf_test.cppD15-Dec-20249.1 KiB276206

read_symbol_map.cppD15-Dec-20242.7 KiB11070

read_symbol_map.hD14-Jan-20241.1 KiB3915

read_symbol_map_test.cppD15-Dec-20244 KiB12174

record.cppD15-Dec-202458.6 KiB1,7491,609

record.hD15-Dec-202420.3 KiB719523

record_equal_test.hD15-Dec-20244.7 KiB12197

record_file.hD15-Dec-20249.1 KiB259166

record_file.protoD14-Jan-20241.4 KiB6150

record_file_format.hD14-Jan-20243.6 KiB15560

record_file_reader.cppD15-Dec-202427.1 KiB866784

record_file_test.cppD15-Dec-20249.4 KiB264189

record_file_writer.cppD14-Jan-202415.9 KiB527445

record_lib_interface.cppD15-Dec-20247.7 KiB298242

record_lib_test.cppD15-Dec-20245.4 KiB149118

record_test.cppD15-Dec-20248.4 KiB215166

report_lib_interface.cppD15-Dec-202424.3 KiB743624

report_utils.cppD15-Dec-202418.7 KiB532432

report_utils.hD15-Dec-20244.7 KiB160102

report_utils_test.cppD15-Dec-202428.2 KiB633520

sample_tree.hD14-Jan-202412 KiB351267

sample_tree_test.cppD15-Dec-20248.5 KiB243190

simpleperf.rcD15-Dec-2024480 107

simpleperf_dict.dictD15-Dec-202414 11

simpleperf_writer_fuzzer.cppD15-Dec-20246.5 KiB176146

test_util.cppD15-Dec-20246.1 KiB188146

test_util.hD15-Dec-20247.6 KiB206162

thread_tree.cppD14-Jan-202414 KiB440363

thread_tree.hD14-Jan-20246.2 KiB177118

thread_tree_test.cppD15-Dec-20244.7 KiB160106

tracing.cppD15-Dec-202419.2 KiB650551

tracing.hD15-Dec-20243.6 KiB13088

tracing_test.cppD15-Dec-20244.4 KiB10775

utils.cppD15-Dec-202413.8 KiB515445

utils.hD15-Dec-20248.1 KiB298222

utils_test.cppD15-Dec-20244 KiB12285

workload.cppD14-Jan-20246.8 KiB230188

workload.hD14-Jan-20242.4 KiB8046

workload_test.cppD15-Dec-20242.5 KiB8351

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