Add a trace to link inputEventId and vsyncId
We should have an easy way to query in a perfetto trace
for the frame associated with an input event.
This change adds a trace event to do that.
Bug: 363076084
Test:
https://ui.perfetto.dev/#!/?s=039fa15daa0e4cd005587a64962b5a48f7910cec
Verified the new slice has the correct vsyncId and inputEventId.
Flag: EXEMPT log only update
Change-Id: I2d4e5e439076c94b195cbe328b66d0c988e10661
diff --git a/libs/hwui/renderthread/CanvasContext.cpp b/libs/hwui/renderthread/CanvasContext.cpp
index dfda25d..8ec0430 100644
--- a/libs/hwui/renderthread/CanvasContext.cpp
+++ b/libs/hwui/renderthread/CanvasContext.cpp
@@ -654,6 +654,9 @@
if (vsyncId != UiFrameInfoBuilder::INVALID_VSYNC_ID) {
const auto inputEventId =
static_cast<int32_t>(mCurrentFrameInfo->get(FrameInfoIndex::InputEventId));
+ ATRACE_FORMAT(
+ "frameTimelineInfo(frameNumber=%llu, vsyncId=%lld, inputEventId=0x%" PRIx32 ")",
+ frameCompleteNr, vsyncId, inputEventId);
const ANativeWindowFrameTimelineInfo ftl = {
.frameNumber = frameCompleteNr,
.frameTimelineVsyncId = vsyncId,