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/InputTracingBackendInterface.h b/services/inputflinger/dispatcher/trace/InputTracingBackendInterface.h
index 25099c3..761d619 100644
--- a/services/inputflinger/dispatcher/trace/InputTracingBackendInterface.h
+++ b/services/inputflinger/dispatcher/trace/InputTracingBackendInterface.h
@@ -99,6 +99,8 @@
     std::set<gui::Uid> targets;
     // True if the there was an active input method connection while this event was processed.
     bool isImeConnectionActive;
+    // The timestamp for when the dispatching decisions were made for the event by the system.
+    nsecs_t processingTimestamp;
 };
 
 /** Additional information about an input event being dispatched to a window. */