evdev: warn if our event processing lags by 10ms or more
authorPeter Hutterer <peter.hutterer@who-t.net>
Mon, 13 Apr 2020 05:12:43 +0000 (15:12 +1000)
committerPeter Hutterer <peter.hutterer@who-t.net>
Wed, 13 May 2020 06:21:27 +0000 (06:21 +0000)
commitbd7b91065b138760201e8454c4559f2023f3cde1
tree217ab1a22f3330c9f1c06b6ded0594d6af617ad2
parent2ff0c3427d470b9f29f891306c6084089eeebc18
evdev: warn if our event processing lags by 10ms or more

Take a snapshot of the time every 10 libinput_dispatch() calls. During event
processing, check if the event timestamp is more than 10ms in the past and
warn if it is. This should provide a warning to users when the compositor is
too slow to processes events but events aren't coming in fast enough to
trigger SYN_DROPPED.

Because we check the device event time against the dispatch time we may get
warnings for multiple devices on delayed processing. This is intended, it's
good to know which devices were affected.

In the test suite we need to ignore the warning though, since we compose the
events in very specific ways it's common to exceed that threshold
(particularly when calling litest_touch_move_to).

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
src/evdev.c
src/evdev.h
src/libinput-private.h
src/libinput.c
test/litest.c
test/test-misc.c