]> git.ipfire.org Git - thirdparty/systemd.git/commitdiff
udevadm: improve debug logging when triggering/watching events
authorLennart Poettering <lennart@poettering.net>
Tue, 23 May 2023 07:29:57 +0000 (09:29 +0200)
committerLennart Poettering <lennart@poettering.net>
Tue, 23 May 2023 16:53:37 +0000 (09:53 -0700)
Let's make debugging udev triggering a bit easier, by generating debug
log messages whenever we trigger a device, and also when we see the
event in pid1.

src/core/device.c
src/udev/udevadm-trigger.c

index 8d1c6f7d775bab46eee3a44c1feb22008bddf348..79082d1688b662dfe86af31aace2f57d80f0199e 100644 (file)
@@ -1142,6 +1142,8 @@ static int device_dispatch_io(sd_device_monitor *monitor, sd_device *dev, void *
                 return 0;
         }
 
+        log_device_debug(dev, "Got '%s' action on syspath '%s'.", device_action_to_string(action), sysfs);
+
         if (action == SD_DEVICE_MOVE)
                 device_remove_old_on_move(m, dev);
 
index 4e3d5bdd0fa8aaef31259d5defe8a71100173102..5f7cc3509a007f0b2622502ee277326d80d33589 100644 (file)
@@ -112,7 +112,8 @@ static int exec_list(
                         if (ret == 0 && !ignore)
                                 ret = r;
                         continue;
-                }
+                } else
+                        log_device_debug(d, "Triggered device with action '%s'.", action_str);
 
                 if (uuid_supported < 0)
                         uuid_supported = true;