timer: print the wrong offset when we have a negative timer offset bug

Makes it easier to determine if this is a libinput bug or something triggered
by the caller waiting too long to call libinput_dispatch().

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
This commit is contained in:
Peter Hutterer 2016-04-04 07:08:30 +10:00
parent c830f51b2e
commit 5152d94cd2

View file

@ -73,7 +73,8 @@ libinput_timer_set(struct libinput_timer *timer, uint64_t expire)
uint64_t now = libinput_now(timer->libinput);
if (expire < now)
log_bug_libinput(timer->libinput,
"timer offset negative\n");
"timer offset negative (-%" PRIu64 ")\n",
now - expire);
else if ((expire - now) > ms2us(5000))
log_bug_libinput(timer->libinput,
"timer offset more than 5s, now %"