[systemd-devel] systemd-udevd rule tracing ?

Lennart Poettering lennart at poettering.net
Mon Jun 1 10:41:16 UTC 2020


On Mo, 01.06.20 06:55, Branko (brankob at s5tehnika.net) wrote:

> HI,
>
> I have a problem with and FTDI-based device. It keeps dissapearing and
> reappearing on every 1-2s or so. Nothing in dmesg to indicate failure.
>
> I'm trying to make my way through systemd-udevd, but it's not easy to debug
> things there ( neither is classic udev BTW).
>
> udevadm monitor -u shows that whole interface is being released,
> unbound,rremoved and then added again.
> Interestingly, it behaves the same with --kernel as with --udev options.
> So it seems that flurry of re/mount requests are coming from kernel
> (5.4.43), not from something in rules setup - or so it seems now.
>
>
> NO good, obvious reason why. Kernel shows no error, system-udevd log show
> nothing.
>
> It just repeats that add/remove cycle.
>
> Daemon has -D option, which changes nothing for me - I still get the same
> info back.
>
> Is there a way to trace down which rule gets executed and why ?

udevadm monitor --kernel tells you what the kernel sends to udev, udev
then just reacts to that. If you already see the traffic in that
output then you know it's really the kernel which is doing this.

For all systemd services you can turn on debug logging by setting the
env var SYSTEMD_LOG_LEVEL=debug. i.e.:

systemctl edit systemd-udevd

then type in:

        [Service]
        Environment=SYSTEMD_LOG_LEVEL=debug

save, exit the editor and restart.

> udevadm test /dev/ttyUSB0 gets me nothing of use - just a list of rule files
> that were parsed, not what was actually executed.
>
> BTW, while slightly offtopic, is there somethign in kernel that would get me
> more debug info ?
>
> There used to be some "generate debug info" in USB stack some time ago...

Better something to ask the kernel people.

if you boot with "debug" on the kernel cmdline you get a bunch more
debug info from both kernelspace and userspace.

Lennart

--
Lennart Poettering, Berlin


More information about the systemd-devel mailing list