public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* kobject_uevent
@ 2005-01-07 14:50 Ikke
  2005-01-07 15:14 ` kobject_uevent Ikke
                   ` (2 more replies)
  0 siblings, 3 replies; 8+ messages in thread
From: Ikke @ 2005-01-07 14:50 UTC (permalink / raw)
  To: linux-kernel

One of the new features of 2.6.10 (well, AFAIK its new) is the
kobject_uevent function set.
Currently only some places send out events like this, so I was
thinking to add some more.

Question is: how can I test this? Is there any userland program that
catches these events and prints some information on them to the
screen?

I found out Kay Siever and RML's (maybe some others too?) work on
kernel->userspace events, but the syntax used there seems to be
somewhat different. Kay's got a listener
(http://vrfy.org/projects/kdbusd/kdbusd.c), but is this one
compatible?

Regards, Ikke

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: kobject_uevent
  2005-01-07 14:50 kobject_uevent Ikke
@ 2005-01-07 15:14 ` Ikke
  2005-01-07 16:55   ` kobject_uevent Robert Love
  2005-01-07 17:39   ` kobject_uevent Greg KH
  2005-01-07 17:38 ` kobject_uevent Greg KH
  2005-01-07 21:25 ` kobject_uevent Ikke
  2 siblings, 2 replies; 8+ messages in thread
From: Ikke @ 2005-01-07 15:14 UTC (permalink / raw)
  To: linux-kernel

Next to this, there seems to be a mistake in the 2.6.10 changelog: it writes
[quote]
kobject_uevent(const char *signal,
	                 struct kobject *kobj,
	                 struct attribute *attr)
[/quote]
whilst include/linux/kobject_uevent.h defines
[quote]
int kobject_uevent(struct kobject *kobj,
                   enum kobject_action action,
                   struct attribute *attr);
[/quote]
which is something completely different.

On Fri, 7 Jan 2005 15:50:52 +0100, Ikke <ikke.lkml@gmail.com> wrote:
> One of the new features of 2.6.10 (well, AFAIK its new) is the
> kobject_uevent function set.
> Currently only some places send out events like this, so I was
> thinking to add some more.
> 
> Question is: how can I test this? Is there any userland program that
> catches these events and prints some information on them to the
> screen?
> 
> I found out Kay Siever and RML's (maybe some others too?) work on
> kernel->userspace events, but the syntax used there seems to be
> somewhat different. Kay's got a listener
> (http://vrfy.org/projects/kdbusd/kdbusd.c), but is this one
> compatible?
> 
> Regards, Ikke
>

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: kobject_uevent
  2005-01-07 15:14 ` kobject_uevent Ikke
@ 2005-01-07 16:55   ` Robert Love
  2005-01-07 17:39   ` kobject_uevent Greg KH
  1 sibling, 0 replies; 8+ messages in thread
From: Robert Love @ 2005-01-07 16:55 UTC (permalink / raw)
  To: Ikke; +Cc: linux-kernel

On Fri, 2005-01-07 at 16:14 +0100, Ikke wrote:

> Next to this, there seems to be a mistake in the 2.6.10 changelog: it writes
> [quote]
> kobject_uevent(const char *signal,
> 	                 struct kobject *kobj,
> 	                 struct attribute *attr)
> [/quote]
> whilst include/linux/kobject_uevent.h defines
> [quote]
> int kobject_uevent(struct kobject *kobj,
>                    enum kobject_action action,
>                    struct attribute *attr);
> [/quote]
> which is something completely different.

The signal as a string was replaced by the kobject_action enumeration,
which is mapped to a string.  It is just an attempt at providing type
safety.

	Robert Love



^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: kobject_uevent
  2005-01-07 14:50 kobject_uevent Ikke
  2005-01-07 15:14 ` kobject_uevent Ikke
@ 2005-01-07 17:38 ` Greg KH
  2005-01-07 21:25 ` kobject_uevent Ikke
  2 siblings, 0 replies; 8+ messages in thread
From: Greg KH @ 2005-01-07 17:38 UTC (permalink / raw)
  To: Ikke; +Cc: linux-kernel

On Fri, Jan 07, 2005 at 03:50:52PM +0100, Ikke wrote:
> One of the new features of 2.6.10 (well, AFAIK its new) is the
> kobject_uevent function set.
> Currently only some places send out events like this, so I was
> thinking to add some more.
> 
> Question is: how can I test this? Is there any userland program that
> catches these events and prints some information on them to the
> screen?

http://www.us.kernel.org/pub/linux/utils/kernel/hotplug/uevent_listen.c
should be a good place to start.  It's what I used to verify stuff was
working properly.

Good luck,

greg k-h

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: kobject_uevent
  2005-01-07 15:14 ` kobject_uevent Ikke
  2005-01-07 16:55   ` kobject_uevent Robert Love
@ 2005-01-07 17:39   ` Greg KH
  1 sibling, 0 replies; 8+ messages in thread
From: Greg KH @ 2005-01-07 17:39 UTC (permalink / raw)
  To: Ikke; +Cc: linux-kernel

On Fri, Jan 07, 2005 at 04:14:07PM +0100, Ikke wrote:
> Next to this, there seems to be a mistake in the 2.6.10 changelog: it writes
> [quote]
> kobject_uevent(const char *signal,
> 	                 struct kobject *kobj,
> 	                 struct attribute *attr)
> [/quote]
> whilst include/linux/kobject_uevent.h defines
> [quote]
> int kobject_uevent(struct kobject *kobj,
>                    enum kobject_action action,
>                    struct attribute *attr);
> [/quote]
> which is something completely different.

Look further on in the changelog where I changed the api to the current
one :)

thanks,

greg k-h

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: kobject_uevent
  2005-01-07 14:50 kobject_uevent Ikke
  2005-01-07 15:14 ` kobject_uevent Ikke
  2005-01-07 17:38 ` kobject_uevent Greg KH
@ 2005-01-07 21:25 ` Ikke
  2005-01-07 23:36   ` kobject_uevent Greg KH
  2 siblings, 1 reply; 8+ messages in thread
From: Ikke @ 2005-01-07 21:25 UTC (permalink / raw)
  To: linux-kernel

I've been working a bit on the kobject_uevent stuff, and got a
prototype system working (well, almost) which takes kernel's uevents,
and sends them to the DBUS system bus so other software can (ab)use
them.
I'll add more uevents later, once I understand the system completely.
I'm a little confused by the use of KOBJ_* stuff in
include/linux/kobject_uevent.h and the string representation of them
in lib/kobject_uevent.c, which means people must edit 2 files if they
want to add new events?

More information on my little work here [1]

Regards, Ikke


[1] http://blog.eikke.com/index.php/ikke/2005/01/07/kernel_events_to_dbus

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: kobject_uevent
  2005-01-07 21:25 ` kobject_uevent Ikke
@ 2005-01-07 23:36   ` Greg KH
  2005-01-08  9:56     ` kobject_uevent Ikke
  0 siblings, 1 reply; 8+ messages in thread
From: Greg KH @ 2005-01-07 23:36 UTC (permalink / raw)
  To: Ikke; +Cc: linux-kernel

On Fri, Jan 07, 2005 at 10:25:14PM +0100, Ikke wrote:
> I'm a little confused by the use of KOBJ_* stuff in
> include/linux/kobject_uevent.h and the string representation of them
> in lib/kobject_uevent.c, which means people must edit 2 files if they
> want to add new events?

Yes, that is exactly correct.  The enumerated type is used for the
callers to kobject_uevent* and the string is sent out on the wire from
within the kevent core code.

Hope this helps,

greg k-h

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: kobject_uevent
  2005-01-07 23:36   ` kobject_uevent Greg KH
@ 2005-01-08  9:56     ` Ikke
  0 siblings, 0 replies; 8+ messages in thread
From: Ikke @ 2005-01-08  9:56 UTC (permalink / raw)
  To: Greg KH; +Cc: linux-kernel

Ok, events are sent to DBUS now, including the additional string
information [1]. Code (for now, it's not "done" yet!) is here [2].

I'll ask the DBUS guys whether it's usefull to get this (optionally)
directly into DBUS.

Let's hope other kernel devs will also start introducing events into
their code! :-)

Greetings, Ikke

[1] http://blog.eikke.com/index.php/ikke/2005/01/08/udev_kernel_events_part_2
[2] http://www.eikke.com/files/code/uevent_listen.c


On Fri, 7 Jan 2005 15:36:32 -0800, Greg KH <greg@kroah.com> wrote:
> On Fri, Jan 07, 2005 at 10:25:14PM +0100, Ikke wrote:
> > I'm a little confused by the use of KOBJ_* stuff in
> > include/linux/kobject_uevent.h and the string representation of them
> > in lib/kobject_uevent.c, which means people must edit 2 files if they
> > want to add new events?
> 
> Yes, that is exactly correct.  The enumerated type is used for the
> callers to kobject_uevent* and the string is sent out on the wire from
> within the kevent core code.
> 
> Hope this helps,
> 
> greg k-h
>

^ permalink raw reply	[flat|nested] 8+ messages in thread

end of thread, other threads:[~2005-01-08 10:00 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2005-01-07 14:50 kobject_uevent Ikke
2005-01-07 15:14 ` kobject_uevent Ikke
2005-01-07 16:55   ` kobject_uevent Robert Love
2005-01-07 17:39   ` kobject_uevent Greg KH
2005-01-07 17:38 ` kobject_uevent Greg KH
2005-01-07 21:25 ` kobject_uevent Ikke
2005-01-07 23:36   ` kobject_uevent Greg KH
2005-01-08  9:56     ` kobject_uevent Ikke

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox