logs-show: adjust source timestamp with header timestamp
authorYu Watanabe <watanabe.yu+github@gmail.com>
Tue, 30 Apr 2024 20:12:12 +0000 (05:12 +0900)
committerYu Watanabe <watanabe.yu+github@gmail.com>
Wed, 1 May 2024 21:34:01 +0000 (06:34 +0900)
commitaffde1d7e79a634ee6053dbd4a57b3b51b74c170
tree9b52cf54eef71abe2c6c7115d1eeb9524983d5bf
parent6ed286d2cfa160a4dc8a41819228e51f3f14be85
logs-show: adjust source timestamp with header timestamp

Previously, _SOURCE_REALTIME_TIMESTAMP was only used for realtime
timestamp, and _SOURCE_MONOTONIC_TIMESTAMP was for monotonic.

This make these journal field used more aggressively. If we need
realtime timestamp, but an entry has only _SOURCE_MONOTONIC_TIMESTAMP,
then now realtime timestamp is calculated based on
_SOURCE_MONOTONIC_TIMESTAMP and the header dual timestamp.
Similary, monotonic timestamp is obtained from
_SOURCE_REALTIME_TIMESTAMP and the header dual timestamp.

This should change shown timestamps not so much in most cases, but may
be improve the situation such as #32492.
src/basic/time-util.h
src/shared/logs-show.c