summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorYabin Cui <yabinc@google.com>2022-01-27 22:42:54 +0000
committerGerrit Code Review <noreply-gerritcodereview@google.com>2022-01-27 22:42:54 +0000
commit5cf73b1ea29b1f6135f4f43a649084971c31908c (patch)
tree52185260e20196c44d80ac53fea62d6ca592c02b
parent645b5613bdc594fe7451d036d404dd5ab3dd38c8 (diff)
parentcd91e46c3f07a7739623bf3d967ae57540b2a43b (diff)
downloadextras-5cf73b1ea29b1f6135f4f43a649084971c31908c.tar.gz
Merge "simpleperf: add doc for getting boot-time profile."
-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