The timestamps of the "log -T" option are inaccurate because they are
from local_clock(), which returns the raw counter in the local CPU and
it's different from the elapsed wall time. (See [1] for details)

The dmesg command, which the "log -T" option imitates, has a similar
behavior in nature and a warning in its help text.  Let's add a warning
also to the crash's help text to inform the inaccuracy for now.

[1] 
https://listman.redhat.com/archives/crash-utility/2021-September/msg00044.html

Reported-by: Martin Moore <[email protected]>
Signed-off-by: Kazuhito Hagio <[email protected]>
---
 help.c | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/help.c b/help.c
index c19b69b8b20c..04a7effd0534 100644
--- a/help.c
+++ b/help.c
@@ -3893,6 +3893,8 @@ char *help_log[] = {
 "  record format, where the timestamp is contained in each log entry's 
header.",
 "  ",
 "    -T  Display the message text with human readable timestamp.",
+"        (Be aware that the timestamp could be inaccurate!  The timestamp is",
+"         from local_clock(), which is different from the elapsed wall time.)",
 "    -t  Display the message text without the timestamp; only applicable to 
the",
 "        variable-length record format.",
 "    -d  Display the dictionary of key/value pair properties that are 
optionally",
-- 
2.27.0


--
Crash-utility mailing list
[email protected]
https://listman.redhat.com/mailman/listinfo/crash-utility

Reply via email to