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.
This commit is contained in:
Uwe Kleine-König 2020-03-09 22:02:30 +01:00 committed by Zbigniew Jędrzejewski-Szmek
parent 0335d110af
commit 7600dbb870
1 changed files with 11 additions and 0 deletions

View File

@ -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) : "<unknown>");
}
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;
}