From 0dce3064a39541bd1cca928f876a930a453f6e31 Mon Sep 17 00:00:00 2001 From: Mathieu Maret Date: Fri, 10 Mar 2023 14:05:05 +0100 Subject: [PATCH] wiki/perf add perfetto and call-graph info --- .vim/vimwiki/run_perf.wiki | 79 +++++++++++++++++++++++++++++++++++++- 1 file changed, 78 insertions(+), 1 deletion(-) diff --git a/.vim/vimwiki/run_perf.wiki b/.vim/vimwiki/run_perf.wiki index e1416bc..4ebb74d 100644 --- a/.vim/vimwiki/run_perf.wiki +++ b/.vim/vimwiki/run_perf.wiki @@ -6,6 +6,83 @@ ./report_html.py -i perf.data === Perf camera server === - ./run_simpleperf_on_device.py record -g -p $( adb shell ps | grep camera.provider | awk '{print $2}') --duration 5 -o perf_test.data + +./run_simpleperf_on_device.py record -g -p $( adb shell ps | grep camera.provider | awk '{print $2}') --duration 5 -o perf_test.data adb pull /data/local/tmp/perf_test.data . ./report_html.py -i perf_test.data + + +=== Call Graph === +# https://android.googlesource.com/platform/prebuilts/simpleperf/+/refs/heads/ndk-r13-release/README.md +./run_simpleperf_on_device.py record -g -p $( adb shell ps | grep camera.provider | awk '{print $2}') --duration 5 -o perf_test.data -g --symfs . +# Or, but do not seems better +./run_simpleperf_on_device.py record -g -p $( adb shell ps | grep camera.provider | awk '{print $2}') --duration 5 -o perf_test.data -g --symfs . --call-graph fp +adb shell /data/local/tmp/simpleperf report -n -g --symfs . -i /data/local/tmp/perf_test.data +adb shell /data/local/tmp/simpleperf report -n -g --symfs . -i /data/local/tmp/perf_test.data >perf.report && python3 report.py perf.report + + +== With perfecto == +https://devblogs.microsoft.com/performance-diagnostics/perfetto-tooling-for-analyzing-android-linux-and-chromium-browser-performance-microsoft-performance-tools-linux-android/ +https://perfetto.dev/docs/reference/trace-config-proto#PerfEventConfig + + + +#!/usr/bin/env bash +# see https://devblogs.microsoft.com/performance-diagnostics/perfetto-tooling-for-analyzing-android-linux-and-chromium-browser-performance-microsoft-performance-tools-linux-android/ +adb shell perfetto \ + -c - --txt \ + -o /data/misc/perfetto-traces/trace \ +<