From: Karel Zak <kzak@redhat.com>
To: "corentin.labbe" <corentin.labbe@geomatys.fr>
Cc: util-linux@vger.kernel.org
Subject: Re: [PATCH] dmesg.c: print human readable timestamp
Date: Wed, 29 Jun 2011 16:59:57 +0200 [thread overview]
Message-ID: <20110629145957.GM6418@nb.net.home> (raw)
In-Reply-To: <4DD6593D.2090202@geomatys.fr>
On Fri, May 20, 2011 at 02:06:21PM +0200, corentin.labbe wrote:
>
> This patch add the -H option to dmesg which allow to print human
> readable time instead of the number of seconds since boot.
Nice idea, but it's not so simple :-(
The time stamp used for printk() is not based on normal system time
(as you know from gettimeofday()). It uses cpu_clock() (IMHO to
keep printk() robust and without xtime_lock).
The problem is that the cpu_clock is not updated after system resume,
so if you suspend (e.g. pm-suspend(8)) and resume than the dmesg -H
command prints nonsenses...
For example (copy & past from /var/log/messages):
Jun 27 23:39:53 nb kernel: [50065.238635] PM: Syncing filesystems ... done.
Jun 28 20:23:29 nb kernel: [50065.284226] Freezing user space processes ... (elapsed 0.09 seconds) done.
^^^^^
The first line is before suspend and second is after resume. The time
stamp [50065.xxxxxx] is still the same although the system was
suspended for almost whole day.
The same system, the latest kernel message:
# date
Wed Jun 29 16:29:28 CEST 2011
# mount /dev/sdb1 /mnt/test
# ./sys-utils/dmesg -H | tail -1
[Tue Jun 28 11:10:41 2011] EXT4-fs (sdb1): mounted filesystem with ordered data mode. Opts: (null)
Karel
next prev parent reply other threads:[~2011-06-29 15:00 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2011-05-20 12:06 [PATCH] dmesg.c: print human readable timestamp corentin.labbe
2011-06-29 14:59 ` Karel Zak [this message]
2011-07-18 14:56 ` corentin.labbe
2011-07-20 12:48 ` Karel Zak
2011-07-20 13:33 ` Voelker, Bernhard
2011-07-20 13:51 ` Karel Zak
2011-07-20 14:25 ` Voelker, Bernhard
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20110629145957.GM6418@nb.net.home \
--to=kzak@redhat.com \
--cc=corentin.labbe@geomatys.fr \
--cc=util-linux@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox