SF: Introduce LayerTraceGenerator
Generates layer traces from transaction traces. The tool is a custom
surface flinger build that mocks out most everything else apart from
the front end logic. Transaction traces are written when the
transaction is applied, along with a timestamp and vsync id. The
transactions are parsed from proto, and applied to recreate the
layer state and output the result into a layer trace.
Test: presubmit
Bug: 200284593
Change-Id: If90a23b9310dbafbdca597b7f5178e40c8b86022
diff --git a/services/surfaceflinger/Tracing/tools/run.sh b/services/surfaceflinger/Tracing/tools/run.sh
new file mode 100644
index 0000000..baa93f1
--- /dev/null
+++ b/services/surfaceflinger/Tracing/tools/run.sh
@@ -0,0 +1,11 @@
+#!/usr/bin/env bash
+
+set -ex
+
+# Build, push and run layertracegenerator
+$ANDROID_BUILD_TOP/build/soong/soong_ui.bash --make-mode layertracegenerator
+adb wait-for-device && adb push $OUT/system/bin/layertracegenerator /data/layertracegenerator
+echo "Writing transaction trace to file"
+adb shell service call SurfaceFlinger 1041 i32 0
+adb shell /data/layertracegenerator
+adb pull /data/misc/wmtrace/layers_trace.winscope
\ No newline at end of file