Re: [patch] kernel sysfs events layer

Daniel Stekloff
2004-09-11T01:24:52Z

On Fri, 2004-09-10 at 17:48, Greg KH wrote:
> On Fri, Sep 10, 2004 at 05:18:49PM -0700, Tim Hockin wrote:
> > On Fri, Sep 10, 2004 at 04:54:09PM -0700, Greg KH wrote:
> > > To send an event, the user needs to pass the kobject, a optional
> > > sysfs-attribute and the signal string to the following function:
> > >
> > > kobject_uevent(const char *signal,
> > > struct kobject *kobj,
> > > struct attribute *attr)
> >
> > Sorry I missed the flare up of this topic. What about events for which
> > there is no associated kobject?
>
> Tough, no event for them :)
>
> > why is the kobject argument not first? Seems weird..
>
> Yeah, it is a bit "odd", but it follows my old kobject_hotplug() way.
>
> > What happened to a formatted string argument? The signal argument can
> > become the pre-formatted string, and someone can provide a wrapper
> > that takes a printf() like format and args.
> > kobject_uevent_printf(kobj, "something bad: 0x%08x", err);
>
> Use an attribute, and have userspace read that formatted argument if
> need be. This keeps the kernel interface much simpler, and doesn't
> allow you to abuse it for things it is not intended for (like error
> reporting stuff...)

Not to be cheeky, but cpu "overheating" isn't an error event? <grin>