Re: Using kevent for event logging?

From: Evgeniy Polyakov
Date: Fri Feb 16 2007 - 10:14:45 EST

On Fri, Feb 16, 2007 at 03:57:08PM +0100, Michael Holzheu (holzheu2@xxxxxxxxxxxxxxxxxx) wrote:
> Hallo Evgeniy,

Hi Michael.

> On s390 we are looking for a good mechanism to notify userspace
> about kernel events. Currently such events are handled with printks
> in most cases. There are automation tools, which want to automatically
> react on kernel events. To get the event information, these tools are
> parsing printks, which is not a really good mechanism for that
> purpose.
> When I read about kevents, I was wondering, if it could be used to solve
> this problem. E.g. it would be possible to put an event number into a
> kevent and provide another interface to get the complete event data.
> Do you think, that kevent could be used for this purpose?

You will need to have implemented two types of operations - userspace
daemon, which will request some notifications (i.e. notify me when event
type:1, event:2 is ready), and that one which will mark such requests as

For exactly your purpose I would use userspace kevent notifications -
although in documentation I say that such notifications can be
marked from userspace, you can mark them as ready from kernel too
(obviously, since kevent is kernel mechanism).

You can also create own kevent notification type and storage (userspace
notification requests are stored in the main kevent queue (kevent_user))
and compile them only for s390 arch and thus do not overlap with
possible usage of userspace notifications.

As another tool to do the same I would suggest netlink (raw netlink
usage is not appreciated, but instead you can use connector or

Kevent is much more lightweight especially when event is marked as ready
compared to netlink allocation. From the other point, kevent requires
some requests from userspace which can be marked as ready, while netlink
allows to generate them from 'void' (i.e. withoug userspace creating

> Michael

Evgeniy Polyakov
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at
Please read the FAQ at