From 59f1ff99786e9d4a94270d6752aa3ca61e10f0a6 Mon Sep 17 00:00:00 2001 From: Jeff Brown Date: Mon, 6 Feb 2012 16:23:50 -0800 Subject: [PATCH] Delete latency tracking information in the Connection. The information gathered here will no longer be valid once we start dispatching multiple events at a time to the same connection. Moreover, we are more concerned with end-to-end latency, which we can measure with sufficiently high accuracy in other ways. This is part of a series of changes to improve input system pipelining. Bug: 5963420 Change-Id: I49a0c9876b64af56b40e96e0d98c45f325da2a73 --- services/input/InputDispatcher.cpp | 15 +++------------ services/input/InputDispatcher.h | 13 ------------- 2 files changed, 3 insertions(+), 25 deletions(-) diff --git a/services/input/InputDispatcher.cpp b/services/input/InputDispatcher.cpp index 85bfac4669577..d923ec1c20711 100644 --- a/services/input/InputDispatcher.cpp +++ b/services/input/InputDispatcher.cpp @@ -1926,10 +1926,6 @@ void InputDispatcher::startDispatchCycleLocked(nsecs_t currentTime, } } - // Record information about the newly started dispatch cycle. - connection->lastEventTime = eventEntry->eventTime; - connection->lastDispatchTime = currentTime; - // Notify other system components. onDispatchCycleStartedLocked(currentTime, connection); } @@ -1937,12 +1933,8 @@ void InputDispatcher::startDispatchCycleLocked(nsecs_t currentTime, void InputDispatcher::finishDispatchCycleLocked(nsecs_t currentTime, const sp& connection, bool handled) { #if DEBUG_DISPATCH_CYCLE - ALOGD("channel '%s' ~ finishDispatchCycle - %01.1fms since event, " - "%01.1fms since dispatch, handled=%s", - connection->getInputChannelName(), - connection->getEventLatencyMillis(currentTime), - connection->getDispatchLatencyMillis(currentTime), - toString(handled)); + ALOGD("channel '%s' ~ finishDispatchCycle - handled=%s", + connection->getInputChannelName(), toString(handled)); #endif if (connection->status == Connection::STATUS_BROKEN @@ -3951,8 +3943,7 @@ InputDispatcher::Connection::Connection(const sp& inputChannel, const sp& inputWindowHandle, bool monitor) : status(STATUS_NORMAL), inputChannel(inputChannel), inputWindowHandle(inputWindowHandle), monitor(monitor), - inputPublisher(inputChannel), - lastEventTime(LONG_LONG_MAX), lastDispatchTime(LONG_LONG_MAX) { + inputPublisher(inputChannel) { } InputDispatcher::Connection::~Connection() { diff --git a/services/input/InputDispatcher.h b/services/input/InputDispatcher.h index 5b7f95e71d438..ec7e04e2864a6 100644 --- a/services/input/InputDispatcher.h +++ b/services/input/InputDispatcher.h @@ -784,9 +784,6 @@ private: InputState inputState; Queue outboundQueue; - nsecs_t lastEventTime; // the time when the event was originally captured - nsecs_t lastDispatchTime; // the time when the last event was dispatched - explicit Connection(const sp& inputChannel, const sp& inputWindowHandle, bool monitor); @@ -797,16 +794,6 @@ private: // Finds a DispatchEntry in the outbound queue associated with the specified event. // Returns NULL if not found. DispatchEntry* findQueuedDispatchEntryForEvent(const EventEntry* eventEntry) const; - - // Gets the time since the current event was originally obtained from the input driver. - inline double getEventLatencyMillis(nsecs_t currentTime) const { - return (currentTime - lastEventTime) / 1000000.0; - } - - // Gets the time since the current event entered the outbound dispatch queue. - inline double getDispatchLatencyMillis(nsecs_t currentTime) const { - return (currentTime - lastDispatchTime) / 1000000.0; - } }; enum DropReason {