SF: Add trace section flags and InputWindowInfo to sf trace
Trace section flags allow users to specify sections of the trace to be collected. By default, all
sections are collected. Options are:
TRACE_CRITICAL - adds data critical for debugging
TRACE_INPUT - adds InputWindowInfo
TRACE_EXTRA - adds non essential data (metadata, derived data)
TRACE_ALL - includes all sections (default)
To set the trace flags from shell:
$ adb shell su root service call SurfaceFlinger 1033 i32 <trace_flags>
Bug: 123992966
Test: record and view sf trace
Change-Id: Icfd4d2bde08a4b3d04e37eca72ff505c7ea518f7
diff --git a/services/surfaceflinger/LayerProtoHelper.h b/services/surfaceflinger/LayerProtoHelper.h
index dca9a5e..1754a3f 100644
--- a/services/surfaceflinger/LayerProtoHelper.h
+++ b/services/surfaceflinger/LayerProtoHelper.h
@@ -16,6 +16,8 @@
#include <layerproto/LayerProtoHeader.h>
+#include <Layer.h>
+#include <input/InputWindow.h>
#include <math/vec4.h>
#include <ui/GraphicBuffer.h>
#include <ui/Rect.h>
@@ -38,6 +40,9 @@
static void writeToProto(const ui::Transform& transform, TransformProto* transformProto);
static void writeToProto(const sp<GraphicBuffer>& buffer,
std::function<ActiveBufferProto*()> getActiveBufferProto);
+ static void writeToProto(const InputWindowInfo& inputInfo,
+ const wp<Layer>& touchableRegionBounds,
+ std::function<InputWindowInfoProto*()> getInputWindowInfoProto);
};
} // namespace surfaceflinger