From 7600dbb870d3f8adc4e91ea35e93b44e5912e013 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Uwe=20Kleine-K=C3=B6nig?= Date: Mon, 9 Mar 2020 22:02:30 +0100 Subject: [PATCH] udev: add debug logs for delaying and delegation of events Up to now each uevent logs the following things at debug level: - Device is queued - Processing device - Device processed However when the device is queued it might still have to wait for earlier devices to be processed before being able to start being processed itself. When analysing logs this dependency information is quite cruicial, so add respective debug log calls. --- src/udev/udevd.c | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/src/udev/udevd.c b/src/udev/udevd.c index ca65474f27..456bc8c479 100644 --- a/src/udev/udevd.c +++ b/src/udev/udevd.c @@ -559,6 +559,14 @@ static void event_run(Manager *manager, struct event *event) { assert(manager); assert(event); + if (DEBUG_LOGGING) { + DeviceAction action; + + r = device_get_action(event->dev, &action); + log_device_debug(event->dev, "Device (SEQNUM=%"PRIu64", ACTION=%s) ready for processing", + event->seqnum, r >= 0 ? device_action_to_string(action) : ""); + } + HASHMAP_FOREACH(worker, manager->workers, i) { if (worker->state != WORKER_IDLE) continue; @@ -770,6 +778,9 @@ static int is_device_busy(Manager *manager, struct event *event) { return false; set_delaying_seqnum: + log_device_debug(event->dev, "SEQNUM=%" PRIu64 " blocked by SEQNUM=%" PRIu64, + event->seqnum, loop_event->seqnum); + event->delaying_seqnum = loop_event->seqnum; return true; }