InputTracer: Add timestamp to perfetto trace packets
Use the event processing time as the packet timestamp for input events,
and use the delivery time as the packet timestamp for dispatch events.
Bug: 332714237
Bug: 210460522
Test: atest inputflinger_tests
Test: manual with perfetto
Change-Id: I30f4c21dfee68603d0dad01d205f8a5581e6db31
diff --git a/services/inputflinger/dispatcher/trace/InputTracerInterface.h b/services/inputflinger/dispatcher/trace/InputTracerInterface.h
index af6eefb..f5e4e59 100644
--- a/services/inputflinger/dispatcher/trace/InputTracerInterface.h
+++ b/services/inputflinger/dispatcher/trace/InputTracerInterface.h
@@ -81,7 +81,8 @@
* outside of our control, such as how long apps take to respond, so we don't want to depend on
* that.
*/
- virtual void eventProcessingComplete(const EventTrackerInterface&) = 0;
+ virtual void eventProcessingComplete(const EventTrackerInterface&,
+ nsecs_t processingTimestamp) = 0;
/**
* Trace an input event that is derived from another event. This is used in cases where an event