Loading services/inputflinger/dispatcher/InputEventTimeline.cpp +5 −6 Original line number Diff line number Diff line Loading @@ -66,12 +66,11 @@ bool ConnectionTimeline::operator!=(const ConnectionTimeline& rhs) const { return !operator==(rhs); } InputEventTimeline::InputEventTimeline(bool isDown, nsecs_t eventTime, nsecs_t readTime, uint16_t vendorId, uint16_t productId, InputEventTimeline::InputEventTimeline(nsecs_t eventTime, nsecs_t readTime, uint16_t vendorId, uint16_t productId, const std::set<InputDeviceUsageSource>& sources, InputEventActionType inputEventActionType) : isDown(isDown), eventTime(eventTime), : eventTime(eventTime), readTime(readTime), vendorId(vendorId), productId(productId), Loading @@ -91,8 +90,8 @@ bool InputEventTimeline::operator==(const InputEventTimeline& rhs) const { return false; } } return isDown == rhs.isDown && eventTime == rhs.eventTime && readTime == rhs.readTime && vendorId == rhs.vendorId && productId == rhs.productId && sources == rhs.sources && return eventTime == rhs.eventTime && readTime == rhs.readTime && vendorId == rhs.vendorId && productId == rhs.productId && sources == rhs.sources && inputEventActionType == rhs.inputEventActionType; } Loading services/inputflinger/dispatcher/InputEventTimeline.h +2 −3 Original line number Diff line number Diff line Loading @@ -97,10 +97,9 @@ enum class InputEventActionType : int32_t { }; struct InputEventTimeline { InputEventTimeline(bool isDown, nsecs_t eventTime, nsecs_t readTime, uint16_t vendorId, uint16_t productId, const std::set<InputDeviceUsageSource>& sources, InputEventTimeline(nsecs_t eventTime, nsecs_t readTime, uint16_t vendorId, uint16_t productId, const std::set<InputDeviceUsageSource>& sources, InputEventActionType inputEventActionType); const bool isDown; // True if this is an ACTION_DOWN event const nsecs_t eventTime; const nsecs_t readTime; const uint16_t vendorId; Loading services/inputflinger/dispatcher/LatencyAggregator.cpp +6 −2 Original line number Diff line number Diff line Loading @@ -134,7 +134,9 @@ void LatencyAggregator::processStatistics(const InputEventTimeline& timeline) { mNumSketchEventsProcessed++; std::array<std::unique_ptr<KllQuantile>, SketchIndex::SIZE>& sketches = timeline.isDown ? mDownSketches : mMoveSketches; timeline.inputEventActionType == InputEventActionType::MOTION_ACTION_DOWN ? mDownSketches : mMoveSketches; // Process common ones first const nsecs_t eventToRead = timeline.readTime - timeline.eventTime; Loading Loading @@ -242,7 +244,9 @@ void LatencyAggregator::processSlowEvent(const InputEventTimeline& timeline) { const nsecs_t consumeToGpuComplete = gpuCompletedTime - connectionTimeline.consumeTime; const nsecs_t gpuCompleteToPresent = presentTime - gpuCompletedTime; android::util::stats_write(android::util::SLOW_INPUT_EVENT_REPORTED, timeline.isDown, android::util::stats_write(android::util::SLOW_INPUT_EVENT_REPORTED, timeline.inputEventActionType == InputEventActionType::MOTION_ACTION_DOWN, static_cast<int32_t>(ns2us(eventToRead)), static_cast<int32_t>(ns2us(readToDeliver)), static_cast<int32_t>(ns2us(deliverToConsume)), Loading services/inputflinger/dispatcher/LatencyTracker.cpp +3 −5 Original line number Diff line number Diff line Loading @@ -70,7 +70,7 @@ LatencyTracker::LatencyTracker(InputEventTimelineProcessor* processor) void LatencyTracker::trackListener(int32_t inputEventId, nsecs_t eventTime, nsecs_t readTime, DeviceId deviceId, const std::set<InputDeviceUsageSource>& sources, int inputEventAction, InputEventType inputEventType) { int32_t inputEventAction, InputEventType inputEventType) { reportAndPruneMatureRecords(eventTime); const auto it = mTimelines.find(inputEventId); if (it != mTimelines.end()) { Loading Loading @@ -105,7 +105,7 @@ void LatencyTracker::trackListener(int32_t inputEventId, nsecs_t eventTime, nsec const InputEventActionType inputEventActionType = [&]() { switch (inputEventType) { case InputEventType::MOTION: { switch (inputEventAction) { switch (MotionEvent::getActionMasked(inputEventAction)) { case AMOTION_EVENT_ACTION_DOWN: return InputEventActionType::MOTION_ACTION_DOWN; case AMOTION_EVENT_ACTION_MOVE: Loading Loading @@ -134,10 +134,8 @@ void LatencyTracker::trackListener(int32_t inputEventId, nsecs_t eventTime, nsec } }(); bool isDown = inputEventType == InputEventType::MOTION && inputEventAction == AMOTION_EVENT_ACTION_DOWN; mTimelines.emplace(inputEventId, InputEventTimeline(isDown, eventTime, readTime, identifier->vendor, InputEventTimeline(eventTime, readTime, identifier->vendor, identifier->product, sources, inputEventActionType)); mEventTimes.emplace(eventTime, inputEventId); } Loading services/inputflinger/dispatcher/LatencyTracker.h +1 −1 Original line number Diff line number Diff line Loading @@ -53,7 +53,7 @@ public: * must drop all duplicate data. */ void trackListener(int32_t inputEventId, nsecs_t eventTime, nsecs_t readTime, DeviceId deviceId, const std::set<InputDeviceUsageSource>& sources, int inputEventActionType, const std::set<InputDeviceUsageSource>& sources, int32_t inputEventAction, InputEventType inputEventType); void trackFinishedEvent(int32_t inputEventId, const sp<IBinder>& connectionToken, nsecs_t deliveryTime, nsecs_t consumeTime, nsecs_t finishTime); Loading Loading
services/inputflinger/dispatcher/InputEventTimeline.cpp +5 −6 Original line number Diff line number Diff line Loading @@ -66,12 +66,11 @@ bool ConnectionTimeline::operator!=(const ConnectionTimeline& rhs) const { return !operator==(rhs); } InputEventTimeline::InputEventTimeline(bool isDown, nsecs_t eventTime, nsecs_t readTime, uint16_t vendorId, uint16_t productId, InputEventTimeline::InputEventTimeline(nsecs_t eventTime, nsecs_t readTime, uint16_t vendorId, uint16_t productId, const std::set<InputDeviceUsageSource>& sources, InputEventActionType inputEventActionType) : isDown(isDown), eventTime(eventTime), : eventTime(eventTime), readTime(readTime), vendorId(vendorId), productId(productId), Loading @@ -91,8 +90,8 @@ bool InputEventTimeline::operator==(const InputEventTimeline& rhs) const { return false; } } return isDown == rhs.isDown && eventTime == rhs.eventTime && readTime == rhs.readTime && vendorId == rhs.vendorId && productId == rhs.productId && sources == rhs.sources && return eventTime == rhs.eventTime && readTime == rhs.readTime && vendorId == rhs.vendorId && productId == rhs.productId && sources == rhs.sources && inputEventActionType == rhs.inputEventActionType; } Loading
services/inputflinger/dispatcher/InputEventTimeline.h +2 −3 Original line number Diff line number Diff line Loading @@ -97,10 +97,9 @@ enum class InputEventActionType : int32_t { }; struct InputEventTimeline { InputEventTimeline(bool isDown, nsecs_t eventTime, nsecs_t readTime, uint16_t vendorId, uint16_t productId, const std::set<InputDeviceUsageSource>& sources, InputEventTimeline(nsecs_t eventTime, nsecs_t readTime, uint16_t vendorId, uint16_t productId, const std::set<InputDeviceUsageSource>& sources, InputEventActionType inputEventActionType); const bool isDown; // True if this is an ACTION_DOWN event const nsecs_t eventTime; const nsecs_t readTime; const uint16_t vendorId; Loading
services/inputflinger/dispatcher/LatencyAggregator.cpp +6 −2 Original line number Diff line number Diff line Loading @@ -134,7 +134,9 @@ void LatencyAggregator::processStatistics(const InputEventTimeline& timeline) { mNumSketchEventsProcessed++; std::array<std::unique_ptr<KllQuantile>, SketchIndex::SIZE>& sketches = timeline.isDown ? mDownSketches : mMoveSketches; timeline.inputEventActionType == InputEventActionType::MOTION_ACTION_DOWN ? mDownSketches : mMoveSketches; // Process common ones first const nsecs_t eventToRead = timeline.readTime - timeline.eventTime; Loading Loading @@ -242,7 +244,9 @@ void LatencyAggregator::processSlowEvent(const InputEventTimeline& timeline) { const nsecs_t consumeToGpuComplete = gpuCompletedTime - connectionTimeline.consumeTime; const nsecs_t gpuCompleteToPresent = presentTime - gpuCompletedTime; android::util::stats_write(android::util::SLOW_INPUT_EVENT_REPORTED, timeline.isDown, android::util::stats_write(android::util::SLOW_INPUT_EVENT_REPORTED, timeline.inputEventActionType == InputEventActionType::MOTION_ACTION_DOWN, static_cast<int32_t>(ns2us(eventToRead)), static_cast<int32_t>(ns2us(readToDeliver)), static_cast<int32_t>(ns2us(deliverToConsume)), Loading
services/inputflinger/dispatcher/LatencyTracker.cpp +3 −5 Original line number Diff line number Diff line Loading @@ -70,7 +70,7 @@ LatencyTracker::LatencyTracker(InputEventTimelineProcessor* processor) void LatencyTracker::trackListener(int32_t inputEventId, nsecs_t eventTime, nsecs_t readTime, DeviceId deviceId, const std::set<InputDeviceUsageSource>& sources, int inputEventAction, InputEventType inputEventType) { int32_t inputEventAction, InputEventType inputEventType) { reportAndPruneMatureRecords(eventTime); const auto it = mTimelines.find(inputEventId); if (it != mTimelines.end()) { Loading Loading @@ -105,7 +105,7 @@ void LatencyTracker::trackListener(int32_t inputEventId, nsecs_t eventTime, nsec const InputEventActionType inputEventActionType = [&]() { switch (inputEventType) { case InputEventType::MOTION: { switch (inputEventAction) { switch (MotionEvent::getActionMasked(inputEventAction)) { case AMOTION_EVENT_ACTION_DOWN: return InputEventActionType::MOTION_ACTION_DOWN; case AMOTION_EVENT_ACTION_MOVE: Loading Loading @@ -134,10 +134,8 @@ void LatencyTracker::trackListener(int32_t inputEventId, nsecs_t eventTime, nsec } }(); bool isDown = inputEventType == InputEventType::MOTION && inputEventAction == AMOTION_EVENT_ACTION_DOWN; mTimelines.emplace(inputEventId, InputEventTimeline(isDown, eventTime, readTime, identifier->vendor, InputEventTimeline(eventTime, readTime, identifier->vendor, identifier->product, sources, inputEventActionType)); mEventTimes.emplace(eventTime, inputEventId); } Loading
services/inputflinger/dispatcher/LatencyTracker.h +1 −1 Original line number Diff line number Diff line Loading @@ -53,7 +53,7 @@ public: * must drop all duplicate data. */ void trackListener(int32_t inputEventId, nsecs_t eventTime, nsecs_t readTime, DeviceId deviceId, const std::set<InputDeviceUsageSource>& sources, int inputEventActionType, const std::set<InputDeviceUsageSource>& sources, int32_t inputEventAction, InputEventType inputEventType); void trackFinishedEvent(int32_t inputEventId, const sp<IBinder>& connectionToken, nsecs_t deliveryTime, nsecs_t consumeTime, nsecs_t finishTime); Loading