3 ms·
The timestamps output by dmesg -T are inaccurate - e.g. on virtual machines that are frequently snapshotted for backup. This is clearly stated in the manpage:
by grafelic 8y ago
The timestamps output by dmesg -T are inaccurate - e.g. on virtual machines that are frequently snapshotted for backup. This is clearly stated in the manpage:
-T, --ctime
Print human-readable timestamps.
Be aware that the timestamp could be inaccurate! The time source used for the logs is not updated after system SUSPEND/RESUME.
- aepiepaey 8y agoThe timestamps use linux' local_clock (which is per-cpu). It will also drift, even if you never suspend/resume. The longer the uptime, the higher this discrepancy can be. This means the timestamp is useless for many purposes. You can check the current offset using: echo test >> /dev/kmsg && uptime=$(cut -d' ' -f 1 /proc/uptime ) && timestamp=$(dmesg |tail -1| awk -F '[][]' {'print $2'}) && echo "$timestamp-$uptime" | bc