From: Uwe Kleine-König Date: Mon, 9 Mar 2020 21:02:30 +0000 (+0100) Subject: udev: add debug logs for delaying and delegation of events X-Git-Tag: v246-rc1~766 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=7600dbb870d3f8adc4e91ea35e93b44e5912e013;p=thirdparty%2Fsystemd.git 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. --- diff --git a/src/udev/udevd.c b/src/udev/udevd.c index ca65474f276..456bc8c479a 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; }