[systemd-devel] device units rely on udev rules?

Koen Kooi koen at dominion.thruhere.net
Tue May 10 11:37:23 PDT 2011


Op 10 mei 2011, om 19:01 heeft Kay Sievers het volgende geschreven:

> On Tue, May 10, 2011 at 17:34, Koen Kooi <koen at dominion.thruhere.net> wrote:
> 
>> So after rebuilding eglibc against 2.6.37 headers and udev from git:
>> 
>> root at beagleboard-systemd:~# time ( udevadm trigger ; udevadm settle )
>> 
>> real    0m10.475s
> 
> Ok, at least the timeout issue seems gone.
> 
> How many device do you have?
>  find /sys -name uevent | wc -l

root at beagleboard-systemd:/usr/bin#  find /sys -name uevent | wc -l
462

> How many devices have a modalias:
>  find /sys -name modalias | wc -l

root at beagleboard-systemd:/usr/bin# find /sys -name modalias | wc -l
84



>> And the matching systemd-analyze plot: http://dominion.thruhere.net/koen/angstrom/systemd/git-with-accept4.svg
> 
> What does:
>  time udevadm test /sys/class/tty/ttyO0
> show?

root at beagleboard-systemd:/usr/bin# time udevadm test /sys/class/tty/ttyO0
run_command: calling: test
udevadm_test: version 168
This program is for debugging only, it does not run any program,
specified by a RUN key. It may show incorrect results, because
some values may be different, or not available at a simulation run.

parse_file: reading '/lib/udev/rules.d/42-qemu-usb.rules' as rules file
parse_file: reading '/lib/udev/rules.d/50-firmware.rules' as rules file
parse_file: reading '/etc/udev/rules.d/50-udev-default.rules' as rules file
parse_file: reading '/lib/udev/rules.d/60-cdrom_id.rules' as rules file
parse_file: reading '/lib/udev/rules.d/60-floppy.rules' as rules file
parse_file: reading '/etc/udev/rules.d/60-persistent-alsa.rules' as rules file
parse_file: reading '/etc/udev/rules.d/60-persistent-input.rules' as rules file
parse_file: reading '/etc/udev/rules.d/60-persistent-serial.rules' as rules file
parse_file: reading '/etc/udev/rules.d/60-persistent-storage-tape.rules' as rules file
parse_file: reading '/etc/udev/rules.d/60-persistent-storage.rules' as rules file
parse_file: reading '/lib/udev/rules.d/60-persistent-v4l.rules' as rules file
parse_file: reading '/lib/udev/rules.d/61-mobile-action.rules' as rules file
parse_file: reading '/lib/udev/rules.d/61-persistent-storage-edd.rules' as rules file
parse_file: reading '/lib/udev/rules.d/70-acl.rules' as rules file
parse_file: reading '/lib/udev/rules.d/70-hid2hci.rules' as rules file
parse_file: reading '/lib/udev/rules.d/75-cd-aliases-generator.rules' as rules file
parse_file: reading '/etc/udev/rules.d/75-net-description.rules' as rules file
parse_file: reading '/lib/udev/rules.d/75-persistent-net-generator.rules' as rules file
parse_file: reading '/lib/udev/rules.d/75-probe_mtd.rules' as rules file
parse_file: reading '/etc/udev/rules.d/75-tty-description.rules' as rules file
parse_file: reading '/etc/udev/rules.d/78-sound-card.rules' as rules file
parse_file: reading '/etc/udev/rules.d/80-drivers.rules' as rules file
parse_file: reading '/lib/udev/rules.d/95-keyboard-force-release.rules' as rules file
parse_file: reading '/lib/udev/rules.d/95-keymap.rules' as rules file
parse_file: reading '/etc/udev/rules.d/95-udev-late.rules' as rules file
parse_file: reading '/lib/udev/rules.d/97-bluetooth-hid2hci.rules' as rules file
parse_file: reading '/lib/udev/rules.d/97-bluetooth.rules' as rules file
parse_file: reading '/lib/udev/rules.d/99-systemd.rules' as rules file
parse_file: reading '/etc/udev/rules.d/local.rules' as rules file
parse_file: reading '/etc/udev/rules.d/permissions.rules' as rules file
parse_file: reading '/etc/udev/rules.d/run.rules' as rules file
parse_file: reading '/etc/udev/rules.d/udev.rules' as rules file
udev_rules_new: rules use 27348 bytes tokens (2279 * 12 bytes), 15978 bytes buffer
udev_rules_new: temporary index used 16860 bytes (843 * 20 bytes)
udev_device_new_from_syspath: device 0x1fd50d0 has devpath '/devices/platform/omap/omap_uart.0/tty/ttyO0'
udev_device_new_from_syspath: device 0x1fe48e0 has devpath '/devices/platform/omap/omap_uart.0/tty/ttyO0'
udev_device_read_db: device 0x1fe48e0 filled with db file data
udev_rules_apply_to_event: GROUP 20 /etc/udev/rules.d/50-udev-default.rules:11
udev_device_new_from_syspath: device 0x1fdf078 has devpath '/devices/platform/omap/omap_uart.0'
udev_device_new_from_syspath: device 0x1fdf2b8 has devpath '/devices/platform/omap'
udev_device_new_from_syspath: device 0x1fdf438 has devpath '/devices/platform'
udev_rules_apply_to_event: GROUP 20 /etc/udev/rules.d/permissions.rules:43
udev_rules_apply_to_event: RUN 'socket:/org/kernel/udev/monitor' /etc/udev/rules.d/run.rules:2
udev_event_execute_rules: no node name set, will use kernel supplied name 'ttyO0'
udev_node_add: creating device node '/dev/ttyO0', devnum=252:0, mode=0660, uid=0, gid=20
udev_node_mknod: preserve file '/dev/ttyO0', because it has correct dev_t
udev_node_mknod: preserve permissions /dev/ttyO0, 020660, uid=0, gid=20
node_symlink: preserve already existing symlink '/dev/char/252:0' to '../ttyO0'
udev_device_update_db: created db file '/run/udev/data/c252:0' for '/devices/platform/omap/omap_uart.0/tty/ttyO0'
UDEV_LOG=6
DEVPATH=/devices/platform/omap/omap_uart.0/tty/ttyO0
MAJOR=252
MINOR=0
DEVNAME=/dev/ttyO0
ACTION=add
SUBSYSTEM=tty
TAGS=:systemd:
run: 'socket:/org/kernel/udev/monitor'

real	0m0.065s
user	0m0.023s
sys	0m0.016s


> 
> If you run it only for certain subsystems, what does it give you:
>  time ( udevadm trigger -s block; udevadm settle )

That triggers a preempt bug and oopses the kernel.

>  time ( udevadm trigger -s tty; udevadm settle )

root at beagleboard-systemd:~#  time ( udevadm trigger -s tty; udevadm settle )

real    0m1.203s
user    0m0.000s
sys     0m0.031s

>> I'll do some more digging after linuxtag.
> 
> I'll be around Fri+Sat. Maybe we'll walk into each other ...

I'll attend the systemd talk :)

regards,

Koen

> 
> Kay



More information about the systemd-devel mailing list