summaryrefslogtreecommitdiff
AgeCommit message (Collapse)Author
2021-10-02Merge "Replace GTest options by proper preparers" am: 324e661a81temp_sam_202323961Julien Desprez
Original change: https://android-review.googlesource.com/c/platform/system/extras/+/1843598 Change-Id: Ifb1931ed2b9c9188278c679ecce7b7930c4d5971
2021-10-02Merge "Replace GTest options by proper preparers"Julien Desprez
2021-10-02Merge "simpleperf: Add an introduction slide deck." am: 620df15de7Yabin Cui
Original change: https://android-review.googlesource.com/c/platform/system/extras/+/1843674 Change-Id: I5ad7ac6a6c1151330d76b60a4ad9448a26ed3d79
2021-10-02Merge "simpleperf: Add an introduction slide deck."Yabin Cui
2021-10-01Replace GTest options by proper preparersJulien Desprez
This allows sharding to occur and optimize preparation better. Test: presubmit Bug: 201822981 Change-Id: I1755de3741e1fdd8ffb33e0178612a7581870e8c
2021-10-01simpleperf: Add an introduction slide deck.Yabin Cui
Bug: none Test: none Change-Id: If7c62e9826ddb3b4e9ef8787d0da9c6fac17eaa8
2021-09-29Merge "pprof_proto_generator: friendlier sample_types" am: 149e735479Treehugger Robot
Original change: https://android-review.googlesource.com/c/platform/system/extras/+/1838426 Change-Id: I4d20960058d962d159edf4f87129336d420f127d
2021-09-29Merge "pprof_proto_generator: friendlier sample_types"Treehugger Robot
2021-09-29Merge "scripts_reference.md: Add an information hierarchy: recorders and ↵Treehugger Robot
viewers" am: 9a043cf0e1 Original change: https://android-review.googlesource.com/c/platform/system/extras/+/1839553 Change-Id: I14effb6a3bb400d1625ec2304576edfbac82b5d8
2021-09-29Merge "scripts_reference.md: Add an information hierarchy: recorders and ↵Treehugger Robot
viewers"
2021-09-29Merge "pprof_proto_generator: Set units for common events" am: 3f58f74f03Mark Hansen
Original change: https://android-review.googlesource.com/c/platform/system/extras/+/1838419 Change-Id: I8d495671269aea54eccd1d5745676eac6b49489d
2021-09-29Merge "pprof_proto_generator: Set units for common events"Mark Hansen
2021-09-28Merge "simpleperf_report_lib.py: expose in_kernel as bool" am: a8ac5899b8Treehugger Robot
Original change: https://android-review.googlesource.com/c/platform/system/extras/+/1838423 Change-Id: Iac51dbcbe5dac1ccd001562452e0505e29103200
2021-09-28Merge "Add pid & tid labels to pprof_proto_generator.py" am: 64fcbf7c09Treehugger Robot
Original change: https://android-review.googlesource.com/c/platform/system/extras/+/1838418 Change-Id: If2b1fc5c4983e19b9eaaac284d84d03bf73f331d
2021-09-28scripts_reference.md: Add an information hierarchy: recorders and viewersMark Hansen
Also add a bunch of code formatting. Change-Id: I9e5ce547bc4bfa9b2a4f33967da8b16e896de324
2021-09-28Merge "simpleperf_report_lib.py: expose in_kernel as bool"Treehugger Robot
2021-09-28Merge "Add pid & tid labels to pprof_proto_generator.py"Treehugger Robot
2021-09-28pprof_proto_generator: friendlier sample_typesMark Hansen
Drop `event_` from the front of all samples, it wasn't adding signal. Drop `_count` suffix, the units field covers this. BUG=201369296 Change-Id: I83514ff904aab3bb835a223a877ad7348a44419b Test: Ran test/test.py -p TestPprofProtoGenerator.\*
2021-09-28pprof_proto_generator: Set units for common eventsMark Hansen
This will help people read the graph, particularly with the nanoseconds view, which confused people often when I showed them. BUG=201361738 Test: Ran test/test.py -p TestPprofProtoGenerator.\* Change-Id: I67448febbf5427de31155575826cee3029251a08
2021-09-28simpleperf_report_lib.py: expose in_kernel as boolMark Hansen
This is a slightly nicer interface for Python. This is a small change split off from a previous investigation on the bug, which went nowhere, but perhaps this change is useful in isolation. BUG=200992595 Test: This is dead code so far Change-Id: Ic4652e27af1c4c3bcc355212be6c11ca1d0498ed
2021-09-28Add pid & tid labels to pprof_proto_generator.pyMark Hansen
Uses precedent set by perf_data_converter: https://github.com/google/perf_data_converter/blob/e8a65906a406fedcc0e78b75f95de16f2d99eecc/src/perf_data_converter.h#L57 Example on a Google Maps profile: ``` (pprof) tags pid: Total 103383248686.0 103383248686.0 ( 100%): 14330 tid: Total 103383248686.0 22119496619.0 (21.40%): 14364 13358985234.0 (12.92%): 14351 7386956769.0 ( 7.15%): 14352 5422475643.0 ( 5.25%): 14362 5307503967.0 ( 5.13%): 14346 5100700923.0 ( 4.93%): 14330 4790949129.0 ( 4.63%): 14370 3146972395.0 ( 3.04%): 14367 2886594038.0 ( 2.79%): 14384 2629996668.0 ( 2.54%): 14398 2614501772.0 ( 2.53%): 14401 2317441688.0 ( 2.24%): 14460 2268259602.0 ( 2.19%): 14408 2129146149.0 ( 2.06%): 14372 1862608311.0 ( 1.80%): 14459 [...] ``` BUG=200992206 Test: Ran test/test.py -p TestPprofProtoGenerator.\* Change-Id: Icbc1503ca05c46387eff3f6799f0c16df4b78001 Change-Id: I7aecbb9a520aa5f6b06f96a844050a2189d14a52
2021-09-28Merge "Group pprof samples by threadpool comm" am: 7065552bf0Treehugger Robot
Original change: https://android-review.googlesource.com/c/platform/system/extras/+/1838415 Change-Id: Ibc87b28122e7db7bf47e08baf5239cdd28916304
2021-09-28Merge "Group pprof samples by threadpool comm"Treehugger Robot
2021-09-28Group pprof samples by threadpool commMark Hansen
This is a heuristic, that many threads often live in threadpools labelled with numbers and a common string. By grouping these threadpools, we're able to see common work. Often these threadpools are created with a format string like "DefaultPool%d", and my heuristic "unmaps" that, kind-of. Hopefully it's clear to the reader of these labels what is meant. Here's an example of running it on a Google Maps build, which nicely shows the difference between the `thread` and new `threadpool` tags: ``` $ pprof pprof.profile Entering interactive mode (type "help" for commands, "o" for options) (pprof) tags thread: Total 103383248686.0 22118435629.0 (21.39%): DefaultPool8 13358985234.0 (12.92%): DefaultPool1 7386956769.0 ( 7.15%): GoogleApiHandle 5410867464.0 ( 5.23%): Primes-1 5307503967.0 ( 5.13%): Binder:14330_3 5151798743.0 ( 4.98%): com.google.android.apps.maps 4790949129.0 ( 4.63%): queued-work-loo 3147004739.0 ( 3.04%): RenderThread 2885251486.0 ( 2.79%): ChromiumNet 2629960939.0 ( 2.54%): GLViewThreadImp 2614501772.0 ( 2.53%): Labeling 2317391011.0 ( 2.24%): LocFreshPool1 2268259602.0 ( 2.19%): MemoryMon 2129146149.0 ( 2.06%): weak-identity-m 1870032894.0 ( 1.81%): Binder:14330_1 1814053100.0 ( 1.75%): Primes-2 1804141068.0 ( 1.75%): DefaultPool6 1724206320.0 ( 1.67%): TilePrepPool2 1611002144.0 ( 1.56%): DefaultPool7 1579754376.0 ( 1.53%): Jit thread pool 1518972491.0 ( 1.47%): TilePrepPool3 1356331492.0 ( 1.31%): DefaultPool3 1210458509.0 ( 1.17%): DefaultPool5 1198135693.0 ( 1.16%): NavState 1126259329.0 ( 1.09%): Location 1008315579.0 ( 0.98%): DefaultPool4 983120929.0 ( 0.95%): TilePrepPool1 814214874.0 ( 0.79%): Timer-0 793766954.0 ( 0.77%): ThreadPoolForeg 344686545.0 ( 0.33%): HeapTaskDaemon 244979090.0 ( 0.24%): DefaultPool2 146047936.0 ( 0.14%): NetworkPool1 126920534.0 ( 0.12%): NetworkPool2 82417870.0 ( 0.08%): OfflineManage 70649177.0 (0.068%): Sensors 68850631.0 (0.067%): NavInternal 66499899.0 (0.064%): NetworkPool4 59950214.0 (0.058%): Primes-nativecr 51125581.0 (0.049%): NetworkPool3 39731570.0 (0.038%): NetworkPool5 29167450.0 (0.028%): ReferenceQueueD 27231566.0 (0.026%): pool-6-thread-1 23984844.0 (0.023%): CronetInit 18201927.0 (0.018%): Binder:14330_4 12020989.0 (0.012%): ClassLoader 11934322.0 (0.012%): SharedPreferenc 8960622.0 (0.0087%): Primes-Jank 5272917.0 (0.0051%): FinalizerDaemon 5145625.0 (0.005%): GAC_Executor[1] 3079896.0 (0.003%): NativeLibLoader 1476511.0 (0.0014%): pool-6-thread-2 1342552.0 (0.0013%): network 1224843.0 (0.0012%): OfflineDynamic 1112971.0 (0.0011%): Binder:14330_2 568698.0 (0.00055%): ThreadPoolServi 264167.0 (0.00026%): pool-6-thread-3 199062.0 (0.00019%): LocFreshPool2 183646.0 (0.00018%): Network File Th 144583.0 (0.00014%): OneGoogle #0 59323.0 (5.7e-05%): glide-active-re 34740.0 (3.4e-05%): Traffic auto-re threadpool: Total 103383248686.0 42712648745.0 (41.31%): DefaultPool%d 7386956769.0 ( 7.15%): GoogleApiHandle 7224920564.0 ( 6.99%): Primes-%d 7196851759.0 ( 6.96%): Binder:%d_%d 5151798743.0 ( 4.98%): com.google.android.apps.maps 4790949129.0 ( 4.63%): queued-work-loo 4226299740.0 ( 4.09%): TilePrepPool%d 3147004739.0 ( 3.04%): RenderThread 2885251486.0 ( 2.79%): ChromiumNet 2629960939.0 ( 2.54%): GLViewThreadImp 2614501772.0 ( 2.53%): Labeling 2317590073.0 ( 2.24%): LocFreshPool%d 2268259602.0 ( 2.19%): MemoryMon 2129146149.0 ( 2.06%): weak-identity-m 1579754376.0 ( 1.53%): Jit thread pool 1198135693.0 ( 1.16%): NavState 1126259329.0 ( 1.09%): Location 814214874.0 ( 0.79%): Timer-%d 793766954.0 ( 0.77%): ThreadPoolForeg 430325520.0 ( 0.42%): NetworkPool%d 344686545.0 ( 0.33%): HeapTaskDaemon 82417870.0 ( 0.08%): OfflineManage 70649177.0 (0.068%): Sensors 68850631.0 (0.067%): NavInternal 59950214.0 (0.058%): Primes-nativecr 29167450.0 (0.028%): ReferenceQueueD 28972244.0 (0.028%): pool-%d-thread-%d 23984844.0 (0.023%): CronetInit 12020989.0 (0.012%): ClassLoader 11934322.0 (0.012%): SharedPreferenc 8960622.0 (0.0087%): Primes-Jank 5272917.0 (0.0051%): FinalizerDaemon 5145625.0 (0.005%): GAC_Executor[%d] 3079896.0 (0.003%): NativeLibLoader 1342552.0 (0.0013%): network 1224843.0 (0.0012%): OfflineDynamic 568698.0 (0.00055%): ThreadPoolServi 183646.0 (0.00018%): Network File Th 144583.0 (0.00014%): OneGoogle #%d 59323.0 (5.7e-05%): glide-active-re 34740.0 (3.4e-05%): Traffic auto-re ``` BUG=200992206 Test: ran test/test.py -p TestPprofProtoGenerator.\* Change-Id: I249aed58f753f58215c9bd0e7e2e5b9253baf610
2021-09-23Merge "Add a simpleperf to Gecko profile format converter" am: a17ac5b7f6Treehugger Robot
Original change: https://android-review.googlesource.com/c/platform/system/extras/+/1831375 Change-Id: Ic6be9d4913f0bb623c849d699131cb503421efab
2021-09-22Merge "Add a simpleperf to Gecko profile format converter"Treehugger Robot
2021-09-23Add a simpleperf to Gecko profile format converterMark Hansen
Gecko Profile Format can be used in https://profiler.firefox.com/, which is a very powerful multi-thread profiler UI. The format is documented here: https://github.com/firefox-devtools/profiler/blob/main/docs-developer/gecko-profile-format.md I have commandeered some metadata fields to show Android-specific data in the Firefox Profiler UI: - Timestamp - Build ID - Simpleperf command line The golden test data was generated with pretty-printing with `jq`: $ ./gecko_profile_generator.py test/testdata/perf_with_interpreter_frames.data | jq > test/testdata/perf_with_interpreter_frames.firefox.json BUG=200472654 Test: Ran test/test.py -p TestGeckoProfileGenerator.\* and opened in Firefox Profiler. Change-Id: I53c5dd5415a0d34dbbdd45fa3031d5b66edc072d
2021-09-22Merge "Autogenerate tables of contents" am: 846e9c7f11Treehugger Robot
Original change: https://android-review.googlesource.com/c/platform/system/extras/+/1833173 Change-Id: Ia58ab8c412ee64a89638363c24f8431476cb9a83
2021-09-22Merge "Autogenerate tables of contents"Treehugger Robot
2021-09-22Autogenerate tables of contentsMark Hansen
This fixes some broken links that were assuming the previous markdown formatter's style of generating hash-anchors. Also changed Inferno's headings to start from H1 so the TOC works. BUG=200740465 Change-Id: I9ad8b3694e8792d26153be2abcadbeda976fb920 Test: Haven't, docs-only changes, but I see other [TOC]s working fine.
2021-09-21Merge "Add --comm filter to report_sample.py" am: a1c7e6b374Mark Hansen
Original change: https://android-review.googlesource.com/c/platform/system/extras/+/1831376 Change-Id: Iab91f246bae45d5b71424da23b8a211dff3a4c76
2021-09-21Merge "Add --comm filter to report_sample.py"Mark Hansen
2021-09-21Add --comm filter to report_sample.pyMark Hansen
This is modelled off the --comm flag in pprof_proto_generator.py. It's also similar to `perf script --comms`. Perhaps I should add an alias I had to also move the filename from being a positional argument to a -i/--record_file argument, because otherwise if I ran $ report_sample.py --comm DefaultPool1 my_perf.data Then my_perf.data was interpreted as an additional comm argument. The -i brings this tool into line with the other tools too. No docs needed to be updated -- they all use the implicit perf.data default. Also add a few tests. This is particularly useful for filtering to the UI thread for visualising in Flamescope. BUG=200118152 Change-Id: Idd6dc5a85fa60156bab30aca672c3cd69c402119 Test: Ran test/test.py -p TestReportSample.\*
2021-09-20Merge "Remove code block for bullet points that aren't code." am: fd8d5fdeb8Treehugger Robot
Original change: https://android-review.googlesource.com/c/platform/system/extras/+/1831392 Change-Id: I87ea40c74892e1eba9e622760f0c052b56a3db8e
2021-09-20Merge "Remove code block for bullet points that aren't code."Treehugger Robot
2021-09-20Merge "Drop some python2 support in simpleperf_utils.py" am: be271379f6Treehugger Robot
Original change: https://android-review.googlesource.com/c/platform/system/extras/+/1831333 Change-Id: I020c83cfbe66f44181a9e4d3019c5fbbc5e7df6b
2021-09-20Merge "Drop some python2 support in simpleperf_utils.py"Treehugger Robot
2021-09-20Merge "Import Tuple in simpleperf_utils.py" am: f0702023cdTreehugger Robot
Original change: https://android-review.googlesource.com/c/platform/system/extras/+/1831372 Change-Id: Ia452cb400679824d93ec314ca8ada5f9880d4cd3
2021-09-20Merge "Add a tab in front of stack samples in report_sample.py" am: 643beabd46Treehugger Robot
Original change: https://android-review.googlesource.com/c/platform/system/extras/+/1831332 Change-Id: Id109f07b6ae52e8e985fb2f04a5b6e15a33d0a0b
2021-09-20Merge "Import Tuple in simpleperf_utils.py"Treehugger Robot
2021-09-20Merge "Add a tab in front of stack samples in report_sample.py"Treehugger Robot
2021-09-20Remove code block for bullet points that aren't code.Mark Hansen
It looked a bit funny when rendered to markdown before. Change-Id: Iacbc310812c0304c6355c0fe751a56049593cf25
2021-09-19Drop some python2 support in simpleperf_utils.pyMark Hansen
From the changelog, looks like python2 support has been dropped in simpleperf. Change-Id: I3094015f76f5d2031cb5a1f868579145a11ce7f6
2021-09-19Import Tuple in simpleperf_utils.pyMark Hansen
Fixes a few typechecking errors with mypy. Change-Id: Id29857084ddb8a75f488a08c6fc067b364120613
2021-09-19Add a tab in front of stack samples in report_sample.pyMark Hansen
This brings the output closer to the output of linux-perf-tool script. Some tools (e.g. FlameScope) optimise skipping lines starting with tabs, this should help those tools go faster. BUG=200473657 Change-Id: I2144e4dbe83f82d14844082d5dedec14dc7f30fb
2021-09-17Merge "Add report_sample.py --header option, like perf script --header" am: ↵Treehugger Robot
c57a063a79 Original change: https://android-review.googlesource.com/c/platform/system/extras/+/1828112 Change-Id: Iefa1d56a0d69ae6f33cf32674c1be2e58c4321cf
2021-09-17Merge "Add report_sample.py --header option, like perf script --header"Treehugger Robot
2021-09-15Add report_sample.py --header option, like perf script --headerMark Hansen
The event_type_info is newline-delimited so I had to replace the newlines in it to ensure that all lines start with a '#'. This argument list is growing a bit so use kwargs to make sure I don't mix up the ordering. As an example, this outputs a header like this: ``` # ======== # cmdline : /data/local/tmp/simpleperf record -o /data/local/tmp/perf.data -f 4000 -g -e cpu-clock --trace-offcpu --duration 60 --symfs /data/local/tmp/native_libs/ --app com.google.android.apps.maps # arch : aarch64 # timestamp : 1630999288 # kernel_symbols_available : true # clockid : monotonic # app_type : profileable # app_package_name : com.google.android.apps.maps # kernel_version : 4.19.189-g17d2916c51d1-ab7463133 # android_build_fingerprint : google/bramble/bramble:12/SP1A.210618.002.A2/7480263:userdebug/dev-keys # android_build_type : userdebug # android_sdk_version : 31 # event_type_info : cpu-clock,1,0 sched:sched_switch,2,91 # trace_offcpu : true # simpleperf_version : 1.build.7649958 # system_wide_collection : false # android_version : 12 # product_props : Google:Pixel 4a (5G):bramble # ======== # com.google.android.apps.maps 23281/23309 [006] 520295.964233: 250313 cpu-clock: [...] ``` BUG=199978997 Change-Id: Idd1f4ab643080a207639068b1a3e6d14fcf97337
2021-09-08Merge "Add niwa@ to squashfs_utils/OWNERS" am: 535a08fe01Treehugger Robot
Original change: https://android-review.googlesource.com/c/platform/system/extras/+/1818173 Change-Id: Ic752d4b5be8ac45bbf30595d34854be9b2ee20b5
2021-09-08Merge "Add niwa@ to squashfs_utils/OWNERS"android-s-beta-5android-s-beta-5Treehugger Robot