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