]> git.ipfire.org Git - thirdparty/systemd.git/commitdiff
login: add several debugging logs about synthetic events 37654/head
authorYu Watanabe <watanabe.yu+github@gmail.com>
Thu, 29 May 2025 02:05:29 +0000 (11:05 +0900)
committerYu Watanabe <watanabe.yu+github@gmail.com>
Thu, 29 May 2025 02:41:25 +0000 (11:41 +0900)
src/login/logind-seat.c

index cfc3dd1bf1031ef73da0c53727b4f7a81f3580a8..db476af251f25be3aa7d355d0fcb447cf8b3931c 100644 (file)
@@ -30,6 +30,7 @@
 #include "string-util.h"
 #include "terminal-util.h"
 #include "tmpfile-util.h"
+#include "udev-util.h"
 #include "user-record.h"
 
 int seat_new(Manager *m, const char *id, Seat **ret) {
@@ -205,8 +206,10 @@ int seat_preallocate_vts(Seat *s) {
 static void seat_triggered_uevents_done(Seat *s) {
         assert(s);
 
-        if (!set_isempty(s->uevents))
+        if (!set_isempty(s->uevents)) {
+                log_debug("%s: waiting for %u events being processed by udevd.", s->id, set_size(s->uevents));
                 return;
+        }
 
         Session *session = s->active;
 
@@ -244,6 +247,7 @@ int manager_process_device_triggered_by_seat(Manager *m, sd_device *dev) {
         if (!s)
                 return 0;
 
+        log_device_uevent(dev, "Received event processed by udevd");
         free(ASSERT_PTR(set_remove(s->uevents, &uuid)));
         seat_triggered_uevents_done(s);
 
@@ -306,6 +310,8 @@ static int seat_trigger_devices(Seat *s) {
                         continue;
                 }
 
+                log_device_debug(d, "Triggered synthetic event (ACTION=change, UUID=%s).", SD_ID128_TO_UUID_STRING(uuid));
+
                 _cleanup_free_ sd_id128_t *copy = newdup(sd_id128_t, &uuid, 1);
                 if (!copy)
                         return -ENOMEM;