From dc53421de56c311a64c65e0c7408046f6c0e44e0 Mon Sep 17 00:00:00 2001 From: Lennart Poettering Date: Tue, 23 May 2023 09:29:57 +0200 Subject: [PATCH] udevadm: improve debug logging when triggering/watching events 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 | 2 ++ src/udev/udevadm-trigger.c | 3 ++- 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/src/core/device.c b/src/core/device.c index 8d1c6f7d775..79082d1688b 100644 --- a/src/core/device.c +++ b/src/core/device.c @@ -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); diff --git a/src/udev/udevadm-trigger.c b/src/udev/udevadm-trigger.c index 4e3d5bdd0fa..5f7cc3509a0 100644 --- a/src/udev/udevadm-trigger.c +++ b/src/udev/udevadm-trigger.c @@ -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;