[PATCH libinput v2] evdev: Log evdev event queue overflows
David Herrmann
dh.herrmann at gmail.com
Tue Nov 4 00:43:26 PST 2014
Hi
On Tue, Nov 4, 2014 at 12:17 AM, Peter Hutterer
<peter.hutterer at who-t.net> wrote:
> On Mon, Nov 03, 2014 at 11:49:12AM +0100, David Herrmann wrote:
>> Hi
>>
>> On Wed, Oct 29, 2014 at 3:56 PM, Derek Foreman <derekf at osg.samsung.com> wrote:
>> > Log a message when the kernel event queue overflows and events are dropped.
>> > After 10 messages logging stops to avoid flooding the logs if the condition
>> > is persistent.
>> > ---
>> > src/evdev.c | 11 +++++++++++
>> > src/evdev.h | 4 ++++
>> > 2 files changed, 15 insertions(+)
>> >
>> > diff --git a/src/evdev.c b/src/evdev.c
>> > index 1b4ce10..9026f5c 100644
>> > --- a/src/evdev.c
>> > +++ b/src/evdev.c
>> > @@ -924,6 +924,17 @@ evdev_device_dispatch(void *data)
>> > rc = libevdev_next_event(device->evdev,
>> > LIBEVDEV_READ_FLAG_NORMAL, &ev);
>> > if (rc == LIBEVDEV_READ_STATUS_SYNC) {
>> > + if (device->syn_drops_received < 10) {
>> > + device->syn_drops_received++;
>> > + log_info(libinput, "SYN_DROPPED event from "
>> > + "\"%s\" - some input events have "
>> > + "been lost.\n", device->devname);
>> > + if (device->syn_drops_received == 10)
>> > + log_info(libinput, "No longer logging "
>> > + "SYN_DROPPED events for "
>> > + "\"%s\"\n", device->devname);
>> > + }
>> > +
>>
>> I really appreciate those log-messages, but can we use rate-limiting
>> here, rather than a per-device counter? I mean, my compositor usually
>> runs for multiple days, or even weeks. I really don't want it to stop
>> reporting SYN_DROPPED events just because it got 100 of those during
>> startup (or something similar).
>>
>> Something like this:
>> http://git.kernel.org/cgit/linux/kernel/git/torvalds/linux.git/tree/lib/ratelimit.c
>>
>> I can prep a patch if you want.
>
> good idea, let's do that.
I sent 2 patches to wayland-devel.
Thanks
David
More information about the wayland-devel
mailing list