linux-hotplug.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Kay Sievers <kay.sievers@vrfy.org>
To: linux-hotplug@vger.kernel.org
Subject: Re: Calling kobject_uevent directly
Date: Thu, 08 Nov 2007 00:07:15 +0000	[thread overview]
Message-ID: <1194480435.2303.72.camel@lov.site> (raw)
In-Reply-To: <58b503a50711062152x3e3cedafxde62c964174a3e53@mail.gmail.com>

On Wed, 2007-11-07 at 15:37 -0800, Tom wrote:
> > Right, it's fine to send "change", you can also add additional keys to
> > the environment,
> > to make it easier for the possible consumer so determine what this
> > event is about. See:
> >   drivers/acpi/dock.c::dock_event()
> 
> Is there any advantage to sending the additional key directly with
> kobject_uevent_env() rather than just doing a kobject_uevent() call
> and using SYSFS{attribute}="some_value" in the udev rule? (e.g.,
> perhaps it's faster?)

There is no general rule, and it doesn't really matter for most of the
users. It is a bit faster, sure, but that's not interesting at all here,
and definitely not a reason to put stuff into the environment.

If you need to send an "atomic" event, you will need to carry the data
in the environment, because the sysfs file may be read some time after
the event is sent and may return a different value in the meantime.
Think of a series of error conditions that may happen, or similar, it's
not possible to stick that into a sysfs file, but they can be put into a
stream of events.
Sometimes it's useful to add a "subtype" of the event to the
environment, which doesn't directly match to a sysfs file.

On the other hand, environment values are a bit harder to debug, because
they are not easily available for test scripts and such, and matches on
special environment keys will not work, without running from the real
event.

So, if you don't have special requirements, the plain sysfs files and
ATTR{} matches should be fine.

Kay


-------------------------------------------------------------------------
This SF.net email is sponsored by: Splunk Inc.
Still grepping through log files to find problems?  Stop.
Now Search log events and configuration files using AJAX and a browser.
Download your FREE copy of Splunk now >> http://get.splunk.com/
_______________________________________________
Linux-hotplug-devel mailing list  http://linux-hotplug.sourceforge.net
Linux-hotplug-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/linux-hotplug-devel

  parent reply	other threads:[~2007-11-08  0:07 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2007-11-07  5:52 Calling kobject_uevent directly Tom
2007-11-07  6:53 ` Greg KH
2007-11-07 11:17 ` Kay Sievers
2007-11-07 23:37 ` Tom
2007-11-08  0:07 ` Kay Sievers [this message]
2007-11-08 22:35 ` Tom

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1194480435.2303.72.camel@lov.site \
    --to=kay.sievers@vrfy.org \
    --cc=linux-hotplug@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).