]> git.ipfire.org Git - thirdparty/systemd.git/commit
do not report total time when kernel time is not provided (#8063)
authorBoucman <jeremy.rosen@enst-bretagne.fr>
Fri, 2 Feb 2018 14:58:40 +0000 (15:58 +0100)
committerZbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl>
Fri, 2 Feb 2018 14:58:40 +0000 (15:58 +0100)
commitd21b0c826f6c9ba365f6257becd260aa9d2d82ff
tree1f3d5399a7e1bac37fc3b338419c9f737fba8dc5
parenta1db49c30e3933f9e0bf74b58dedcf9d079ba9a1
do not report total time when kernel time is not provided (#8063)

the whole systemd-analyze time logic is based on the fact that monotonic
time 0 is the start of the kernel.

If the firmware does not provide a correct time, firmware_time degrades to
0, which is the start of the kernel. The diference between FinishTime and
firmware_time is thus correct.

That assumption is still true with containers, but the start time of the
kernel is not what the user expects : It's the time when the host booted.

The total is thus still correct, but highly misleading. Containers can be
easily detected (and, in fact, already are) by systemd not reporting any
kernel non-monotonic timestamp.

This patch simply avoids printing a misleading time when it can detect that
case
src/analyze/analyze.c