summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorYabin Cui <yabinc@google.com>2022-01-26 13:48:29 -0800
committerYabin Cui <yabinc@google.com>2022-01-27 12:55:07 -0800
commitcd91e46c3f07a7739623bf3d967ae57540b2a43b (patch)
treeb419cdfb0c5d95896e1185c359cd6e57aa58d272
parent8f71c9629dd12044a147eb76ff12fe3be5819376 (diff)
downloadextras-cd91e46c3f07a7739623bf3d967ae57540b2a43b.tar.gz
simpleperf: add doc for getting boot-time profile.
Bug: 214731005 Test: none Change-Id: If446962e3b32e14be96dd41ea9a926b0634c2fde
-rw-r--r--simpleperf/doc/android_platform_profiling.md32
-rw-r--r--simpleperf/doc/pictures/boot_time_profile.pngbin0 -> 90649 bytes
2 files changed, 32 insertions, 0 deletions
diff --git a/simpleperf/doc/android_platform_profiling.md b/simpleperf/doc/android_platform_profiling.md
index f4899e45..f2a31cf0 100644
--- a/simpleperf/doc/android_platform_profiling.md
+++ b/simpleperf/doc/android_platform_profiling.md
@@ -75,3 +75,35 @@ On Pixel devices, the number of PMU counters on each core is usually 7, of which
by the kernel to monitor memory latency. So only 3 counters are available. It's fine to monitor up
to 3 PMU events at the same time. To monitor more than 3 events, the `--use-devfreq-counters` option
can be used to borrow from the counters used by the kernel.
+
+## Get boot-time profile
+
+On userdebug/eng devices, we can get boot-time profile via simpleperf.
+
+Step 1. In adb root, set options used to record boot-time profile. Simpleperf stores the options in
+a persist property `persist.simpleperf.boot_record`.
+
+```
+# simpleperf boot-record --enable "-a -g --duration 10 --exclude-perf"
+```
+
+Step 2. Reboot the device. When booting, init finds that the persist property is set, so it forks
+a background process to run simpleperf to record boot-time profile. init starts simpleperf at
+zygote-start stage, right after zygote is started.
+
+```
+$ adb reboot
+```
+
+Step 3. After boot, the boot-time profile is stored in /data/simpleperf_boot_data. Then we can pull
+the profile to host to report.
+
+```
+$ adb shell ls /data/simpleperf_boot_data
+perf-20220126-11-47-51.data
+```
+
+Following is a boot-time profile example. From timestamp, the first sample is generated at about
+4.5s after booting.
+
+![boot_time_profile](pictures/boot_time_profile.png)
diff --git a/simpleperf/doc/pictures/boot_time_profile.png b/simpleperf/doc/pictures/boot_time_profile.png
new file mode 100644
index 00000000..3e061557
--- /dev/null
+++ b/simpleperf/doc/pictures/boot_time_profile.png
Binary files differ