Commit graph

31 commits

Author SHA1 Message Date
Alan Jenkins e25fa4faf5 udevd: use a tighter loop for compare_devpath()
This crops up in my threaded udevd profiles from time to time.
It's not consistent - probably due to variations in the number
of concurrent events - but it can hit 4% user time and higher.

The change halves the user time spent in compare_devpath().

Signed-off-by: Alan Jenkins <alan-jenkins@tuffmail.co.uk>
2008-10-25 19:41:52 +02:00
Kay Sievers 54808d77a3 prefix udev-util.c functions with util_* 2008-10-18 20:12:55 +02:00
Kay Sievers c3b1fa66d2 selinux_init(udev) -> udev_selinux_init(udev) 2008-10-18 19:30:42 +02:00
Kay Sievers 2d73813ebc udev_rules_run() -> udev_event_execute_run(); 2008-10-18 15:50:16 +02:00
Kay Sievers dcdcb8cc06 udev_event_run() -> udev_event_execute_rules() 2008-10-18 15:46:55 +02:00
Alan Jenkins 836dcf951c udevd: avoid overhead of calling rmdir on non-empty directories
Unfortunately the linux rmdir implementation unhashes the dentry
even when the directory is not removed.  This is apparently by
design (for filesystems that don't allow deleting open files).

Results from time(1) and oprofile follow.

Before:

0.35user 0.90system
samples  %        image name               symbol name
608       9.6738  vmlinux                  shrink_dcache_parent
293       4.6619  vmlinux                  copy_page_c
271       4.3119  vmlinux                  copy_page_range
257       4.0891  udevd                    udev_rules_iter_next

After:

0.31user 0.67system
samples  %        image name               symbol name
361       5.0419  vmlinux                  copy_page_range
322       4.4972  udevd                    udev_rules_iter_next
300       4.1899  vmlinux                  copy_page_c

Signed-off-by: Alan Jenkins <alan-jenkins@tuffmail.co.uk>
2008-10-18 15:28:49 +02:00
Kay Sievers d7ddce186c make struct udev_rules opaque 2008-10-18 15:02:01 +02:00
Kay Sievers c7521974a3 merge udev-rules.c and udev-rules-parse.c 2008-10-18 14:33:37 +02:00
Kay Sievers 7e02792760 udevd: use udev_list_node 2008-10-17 18:59:27 +02:00
Kay Sievers cb25a9585d libudev: monitor - add set_receive_buffer_size() 2008-10-17 16:49:27 +02:00
Kay Sievers 8460299b57 rename udev source files 2008-10-16 18:13:48 +02:00
Kay Sievers aa8734ffcb udevd: use libudev 2008-10-16 17:16:58 +02:00
Kay Sievers 30f8f89625 udevd: clarify deprecated sysfs layout warning 2008-10-04 13:52:39 +02:00
Kay Sievers e598c5738c libudev: get rid of selinux
"Hello world!" linked against libselinux parses /proc/mounts and
whatever else on startup, even when the lib is not needed at all.
Not funny! Get rid of that thing where it's not absolutely needed.
2008-10-02 18:48:40 +02:00
Kay Sievers 033e9f8cde use no_argument, required_argument, optional_argument in longopts 2008-10-02 16:49:05 +02:00
Kay Sievers f13e4c36c2 udevd: print warning if CONFIG_SYSFS_DEPRECATED is used
Future udev versions will depend on the current sysfs layout, which
includes features which are not available in the deprecated mode.
2008-10-01 19:00:55 +02:00
Alan Jenkins 659353f5a9 replace strerror() usage with threadsafe "%m" format string
strerror() is not threadsafe.  It uses a buffer to build messages of the form
"Unknown error 387689".

syslog() provides a %m format which is equivalent to strerror(errno).
As a GNU extension, this is also accepted by printf and friends.
At least in the current implementation, it is correctly threadsafe.

Signed-off-by: Alan Jenkins <alan-jenkins@tuffmail.co.uk>
2008-09-29 17:06:00 +02:00
Kay Sievers 38f27948cd always include config.h from Makefile 2008-09-19 23:03:49 -07:00
Kay Sievers 17fcfb5972 use size definitions from libudev 2008-09-10 21:50:21 +02:00
Kay Sievers 31c1f53745 get rid of udev_sysdeps.c 2008-09-10 18:59:42 +02:00
Kay Sievers ecc9ec579f convert to libudev and delete udev_utils_string.c 2008-09-10 18:39:23 +02:00
Kay Sievers 55e9959b15 update file headers 2008-09-10 02:40:42 +02:00
Kay Sievers 4f4b12c203 libudev: add selinux 2008-09-10 00:46:17 +02:00
Kay Sievers 3bc7c84cf0 udevd: remove max_childs_running logic
This was needed in the old days, where all the hotplug scripts did
nothing better than sleep for seconds to work around timing issues.
It made sure, that w continued to fork processes, while the machine
was doing nothing than sleeping, but the maximim number of childs
was already reached. This is no longer needed today, we do not run
many of these scripts anymore.
2008-09-09 15:14:38 +02:00
Kay Sievers d59f11e140 move udev_ctrl to libudev-private 2008-09-08 17:59:00 +02:00
Kay Sievers 7d563a17f3 use libudev code, unify logging, pass udev context around everywhere 2008-09-06 15:45:31 +02:00
Kay Sievers 2b725651e5 udevadm: control - use getopt_long() 2008-09-03 21:56:47 +02:00
Alan Jenkins 593453115b remove deprecated envp[] in main()
envp is not standardized, and may become invalid when environment variables
are modified.  Since udev never actually uses it, we can simply remove it.

Should anyone miss it in future, they can use the standardized environ
variable - like udev_rules.c does already.
2008-09-02 23:19:36 +02:00
Kay Sievers 44aff4cd6d udev_device_init() remove statically allocated device support 2008-09-01 20:59:09 +02:00
Kay Sievers 01618658fd use autotools 2008-07-30 01:45:23 +02:00
Kay Sievers 726687ad48 delete all Makefiles and move udev source to udev/ 2008-07-30 00:39:15 +02:00
Renamed from udevd.c (Browse further)