touchpad: reduce state debugging output by only logging changed states
authorPeter Hutterer <peter.hutterer@who-t.net>
Tue, 18 Jun 2019 08:24:49 +0000 (18:24 +1000)
committerPeter Hutterer <peter.hutterer@who-t.net>
Mon, 15 Jul 2019 03:08:47 +0000 (13:08 +1000)
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
src/evdev-mt-touchpad-gestures.c
src/evdev-mt-touchpad-tap.c

index 1a3518e..eeb3b4c 100644 (file)
@@ -642,10 +642,11 @@ tp_gesture_post_gesture(struct tp_dispatch *tp, uint64_t time)
                tp->gesture.state =
                        tp_gesture_handle_state_pinch(tp, time);
 
-       evdev_log_debug(tp->device,
-                       "gesture state: %s → %s\n",
-                       gesture_state_to_str(oldstate),
-                       gesture_state_to_str(tp->gesture.state));
+       if (oldstate != tp->gesture.state)
+               evdev_log_debug(tp->device,
+                               "gesture state: %s → %s\n",
+                               gesture_state_to_str(oldstate),
+                               gesture_state_to_str(tp->gesture.state));
 }
 
 void
index 5255469..37853b3 100644 (file)
@@ -912,12 +912,13 @@ tp_tap_handle_event(struct tp_dispatch *tp,
        if (tp->tap.state == TAP_STATE_IDLE || tp->tap.state == TAP_STATE_DEAD)
                tp_tap_clear_timer(tp);
 
-       evdev_log_debug(tp->device,
-                 "tap: touch %d state %s → %s → %s\n",
-                 t ? (int)t->index : -1,
-                 tap_state_to_str(current),
-                 tap_event_to_str(event),
-                 tap_state_to_str(tp->tap.state));
+       if (current != tp->tap.state)
+               evdev_log_debug(tp->device,
+                         "tap: touch %d state %s → %s → %s\n",
+                         t ? (int)t->index : -1,
+                         tap_state_to_str(current),
+                         tap_event_to_str(event),
+                         tap_state_to_str(tp->tap.state));
 }
 
 static bool