diff options
author | Zbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl> | 2020-04-22 14:24:07 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-04-22 14:24:07 +0200 |
commit | eecf4f7e0425db72ea7a0c13a937fa6fcdbe3b1e (patch) | |
tree | a0092028233a6c7e5d1cfd3e8bc58bcd533a1743 | |
parent | Merge pull request #15519 from DaanDeMeyer/sd-bus-message-read-strv-docs (diff) | |
parent | core: add debug log when a job in the activation queue is not runnable (diff) | |
download | systemd-eecf4f7e0425db72ea7a0c13a937fa6fcdbe3b1e.tar.xz systemd-eecf4f7e0425db72ea7a0c13a937fa6fcdbe3b1e.zip |
Merge pull request #15526 from bluca/start_stop_wait_debug
Add debug log when a job in the activation queue is not runnable
-rw-r--r-- | src/core/job.c | 12 | ||||
-rw-r--r-- | src/core/unit.h | 5 |
2 files changed, 13 insertions, 4 deletions
diff --git a/src/core/job.c b/src/core/job.c index 2114889d32..cf3bca88d6 100644 --- a/src/core/job.c +++ b/src/core/job.c @@ -516,12 +516,20 @@ static bool job_is_runnable(Job *j) { return true; HASHMAP_FOREACH_KEY(v, other, j->unit->dependencies[UNIT_AFTER], i) - if (other->job && job_compare(j, other->job, UNIT_AFTER) > 0) + if (other->job && job_compare(j, other->job, UNIT_AFTER) > 0) { + log_unit_debug(j->unit, + "starting held back, waiting for: %s", + other->id); return false; + } HASHMAP_FOREACH_KEY(v, other, j->unit->dependencies[UNIT_BEFORE], i) - if (other->job && job_compare(j, other->job, UNIT_BEFORE) > 0) + if (other->job && job_compare(j, other->job, UNIT_BEFORE) > 0) { + log_unit_debug(j->unit, + "stopping held back, waiting for: %s", + other->id); return false; + } return true; } diff --git a/src/core/unit.h b/src/core/unit.h index 2e103f7ab2..e38871a97c 100644 --- a/src/core/unit.h +++ b/src/core/unit.h @@ -883,8 +883,9 @@ int unit_can_clean(Unit *u, ExecCleanMask *ret_mask); #define log_unit_full(unit, level, error, ...) \ ({ \ const Unit *_u = (unit); \ - _u ? log_object_internal(level, error, PROJECT_FILE, __LINE__, __func__, _u->manager->unit_log_field, _u->id, _u->manager->invocation_log_field, _u->invocation_id_string, ##__VA_ARGS__) : \ - log_internal(level, error, PROJECT_FILE, __LINE__, __func__, ##__VA_ARGS__); \ + (log_get_max_level() < LOG_PRI(level)) ? -ERRNO_VALUE(error) : \ + _u ? log_object_internal(level, error, PROJECT_FILE, __LINE__, __func__, _u->manager->unit_log_field, _u->id, _u->manager->invocation_log_field, _u->invocation_id_string, ##__VA_ARGS__) : \ + log_internal(level, error, PROJECT_FILE, __LINE__, __func__, ##__VA_ARGS__); \ }) #define log_unit_debug(unit, ...) log_unit_full(unit, LOG_DEBUG, 0, ##__VA_ARGS__) |