summaryrefslogtreecommitdiff
path: root/src/run
diff options
context:
space:
mode:
authorZbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl>2021-07-01 14:32:46 +0200
committerZbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl>2021-07-09 11:03:36 +0200
commit5291f26d4a6450d1fbf3656640ef20c5e78aa6a5 (patch)
tree9eb548b3f97f16b6b521c7481fec65e451f600a4 /src/run
parent5e62ac8b512ee801f92146e1a144c4077a672d8a (diff)
downloadsystemd-5291f26d4a6450d1fbf3656640ef20c5e78aa6a5.tar.gz
tree-wide: add FORMAT_TIMESPAN()
Diffstat (limited to 'src/run')
-rw-r--r--src/run/run.c12
1 files changed, 4 insertions, 8 deletions
diff --git a/src/run/run.c b/src/run/run.c
index 38de0322e0..7378658ce9 100644
--- a/src/run/run.c
+++ b/src/run/run.c
@@ -1322,17 +1322,13 @@ static int start_transient_service(
if (timestamp_is_set(c.inactive_enter_usec) &&
timestamp_is_set(c.inactive_exit_usec) &&
- c.inactive_enter_usec > c.inactive_exit_usec) {
- char ts[FORMAT_TIMESPAN_MAX];
+ c.inactive_enter_usec > c.inactive_exit_usec)
log_info("Service runtime: %s",
- format_timespan(ts, sizeof ts, c.inactive_enter_usec - c.inactive_exit_usec, USEC_PER_MSEC));
- }
+ FORMAT_TIMESPAN(c.inactive_enter_usec - c.inactive_exit_usec, USEC_PER_MSEC));
- if (c.cpu_usage_nsec != NSEC_INFINITY) {
- char ts[FORMAT_TIMESPAN_MAX];
+ if (c.cpu_usage_nsec != NSEC_INFINITY)
log_info("CPU time consumed: %s",
- format_timespan(ts, sizeof ts, DIV_ROUND_UP(c.cpu_usage_nsec, NSEC_PER_USEC), USEC_PER_MSEC));
- }
+ FORMAT_TIMESPAN(DIV_ROUND_UP(c.cpu_usage_nsec, NSEC_PER_USEC), USEC_PER_MSEC));
if (c.ip_ingress_bytes != UINT64_MAX) {
char bytes[FORMAT_BYTES_MAX];