diff options
author | Denis Brockus <dbrockus@google.com> | 2023-08-11 10:38:50 -0600 |
---|---|---|
committer | Chromeos LUCI <chromeos-scoped@luci-project-accounts.iam.gserviceaccount.com> | 2023-09-20 15:58:28 +0000 |
commit | 80fad27324241218007f67e427a71c9c69d8e6a6 (patch) | |
tree | 5cd19b2b50ca6a82e3c943d75a4d9a4e9ee7e805 | |
parent | 5a32438e65712e026ad2b5925766bafc12f6edee (diff) | |
download | libchrome-gestures-80fad27324241218007f67e427a71c9c69d8e6a6.tar.gz |
StuckButtonInhibitorFilterInterpreter instrument event debug
BUG=b:286851905
TEST=USE="coverage" FEATURES="test noclean" emerge-brya chromeos-base/gesture
Change-Id: I943689d387bf4f7fae086e47555583d1828171f2
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/gestures/+/4775272
Commit-Queue: Denis Brockus <dbrockus@chromium.org>
Reviewed-by: Harry Cutts <hcutts@chromium.org>
Code-Coverage: Zoss <zoss-cl-coverage@prod.google.com>
Tested-by: Denis Brockus <dbrockus@chromium.org>
-rw-r--r-- | src/stuck_button_inhibitor_filter_interpreter.cc | 23 |
1 files changed, 20 insertions, 3 deletions
diff --git a/src/stuck_button_inhibitor_filter_interpreter.cc b/src/stuck_button_inhibitor_filter_interpreter.cc index 4566ab2..d5b0999 100644 --- a/src/stuck_button_inhibitor_filter_interpreter.cc +++ b/src/stuck_button_inhibitor_filter_interpreter.cc @@ -20,14 +20,23 @@ StuckButtonInhibitorFilterInterpreter::StuckButtonInhibitorFilterInterpreter( void StuckButtonInhibitorFilterInterpreter::SyncInterpretImpl( HardwareState& hwstate, stime_t* timeout) { + const char name[] = + "StuckButtonInhibitorFilterInterpreter::SyncInterpretImpl"; + LogHardwareStatePre(name, hwstate); + HandleHardwareState(hwstate); + stime_t next_timeout = NO_DEADLINE; + LogHardwareStatePost(name, hwstate); next_->SyncInterpret(hwstate, &next_timeout); HandleTimeouts(next_timeout, timeout); } void StuckButtonInhibitorFilterInterpreter::HandleTimerImpl( stime_t now, stime_t* timeout) { + const char name[] = "StuckButtonInhibitorFilterInterpreter::HandleTimerImpl"; + LogHandleTimerPre(name, now, timeout); + stime_t next_timeout = NO_DEADLINE; if (next_expects_timer_) { next_->HandleTimer(now, &next_timeout); @@ -37,13 +46,16 @@ void StuckButtonInhibitorFilterInterpreter::HandleTimerImpl( return; } else { Err("Mouse button seems stuck down. Sending button-up."); - ProduceGesture(Gesture(kGestureButtonsChange, - now, now, 0, sent_buttons_down_, - false)); // is_tap + auto button_change = Gesture(kGestureButtonsChange, + now, now, 0, sent_buttons_down_, + false); // is_tap + LogGestureProduce(name, button_change); + ProduceGesture(button_change); sent_buttons_down_ = 0; } } HandleTimeouts(next_timeout, timeout); + LogHandleTimerPost(name, now, timeout); } void StuckButtonInhibitorFilterInterpreter::HandleHardwareState( @@ -54,6 +66,9 @@ void StuckButtonInhibitorFilterInterpreter::HandleHardwareState( void StuckButtonInhibitorFilterInterpreter::ConsumeGesture( const Gesture& gesture) { + const char name[] = "StuckButtonInhibitorFilterInterpreter::ConsumeGesture"; + LogGestureConsume(name, gesture); + if (gesture.type == kGestureTypeButtonsChange) { Gesture result = gesture; // process buttons going down @@ -73,8 +88,10 @@ void StuckButtonInhibitorFilterInterpreter::ConsumeGesture( sent_buttons_down_ &= ~result.details.buttons.up; if (!result.details.buttons.up && !result.details.buttons.down) return; // skip gesture + LogGestureProduce(name, result); ProduceGesture(result); } else { + LogGestureProduce(name, gesture); ProduceGesture(gesture); } } |