Re: [PATCH 0/5] Input: serio_raw - add monitor/replay debugging interface

From: Che-liang Chiou
Date: Mon May 28 2012 - 05:42:34 EST


Hi Dmitry,

I am sorry for getting back to you so late. See below.

On Sat, Apr 21, 2012 at 2:21 PM, Dmitry Torokhov
<dmitry.torokhov@xxxxxxxxx> wrote:
> On Tue, Feb 14, 2012 at 11:18:38AM +0800, Daniel Kurtz wrote:
>> On Wed, Feb 8, 2012 at 11:24 AM, Che-Liang Chiou <clchiou@xxxxxxxxxxxx> wrote:
>> >
>> > The serio_raw driver is designed to provide "raw access" to mice, keyboards
>> > etc; thus, a driver accessing serio_raw may live entirely in userland.
>> >
>> > However, serio_raw lacks testability. ÂIt is practically impossible to do
>> > regression tests on changes to a serio_raw -based userland driver. ÂOn the other
>> > hand, the kernel's input subsystem has good testability support. ÂWith the help
>> > of tools like utouch-evemu, we may capture and replay input events for evdev
>> > drivers in regression tests.
>> >
>> > This patchset contains extensions to the serio_raw driver which add debugfs
>> > entries for monitoring and replaying byte sequence between a userland driver
>> > and device. ÂThese byte sequences can be used in regression tests of the
>> > userland driver. ÂThis patchset closes the gap between serio_raw and the input
>> > subsystem regarding testability.
>> >
>> > This patchset is successfully applied on kernel version 3.3-rc2.
>> >
>> > Che-Liang Chiou (5):
>> > ÂInput: serio_raw - return proper result when serio_raw_read fails
>> > ÂInput: serio_raw - extract queue interface
>> > ÂInput: serio_raw - factor out common pattern of write
>> > ÂInput: serio_raw - add debugfs interface
>> > ÂInput: serio_raw - implement debugfs interface
>>
>> For patches 3-5:
>> Reviewed-by: Daniel Kurtz <djkurtz@xxxxxxxxxx>
>>
>> For patch 1 (and its implication on queue_read() in patch 2, I'd
>> prefer to hear feedback from the list.
>
> I have already taken the patch 1, but I am unsure why we need kernel
> support for the monitor and replay. It seems you should only need a
> userspace program that would sit between the driver being tested and
> serio_raw misc device and pipe data back and forth, optionally saving
> it for subsequent replay.

Sadly some user space drivers hard codes path, like
"/dev/serio_raw%d", and quite often their source codes are not
available; so it is effectively impossible to monitor these drivers
without kernel's help.

Besides, changing from accessing a char device to communicating
through IPC requires rewriting the user space driver, no matter it's a
pair of named pipes or a socket. This may sometimes be quite hard
depending on the I/O strategy of the driver.

> Thanks.
>
> --
> Dmitry

Regards,
Che-Liang
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/