mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Thomas Gleixner <tglx@linutronix.de>
To: Petr Mladek <pmladek@suse.com>
Cc: Prarit Bhargava <prarit@redhat.com>,
	linux-kernel@vger.kernel.org,
	John Stultz <john.stultz@linaro.org>,
	Xunlei Pang <pang.xunlei@linaro.org>,
	Baolin Wang <baolin.wang@linaro.org>,
	Andrew Morton <akpm@linux-foundation.org>,
	Greg Kroah-Hartman <gregkh@linuxfoundation.org>,
	Tejun Heo <tj@kernel.org>,
	Peter Hurley <peter@hurleysoftware.com>,
	Vasily Averin <vvs@virtuozzo.com>, Joe Perches <joe@perches.com>
Subject: Re: [PATCH] printk, allow different timestamps for printk.time [v2]
Date: Thu, 4 Feb 2016 18:25:29 +0100 (CET)	[thread overview]
Message-ID: <alpine.DEB.2.11.1602041822570.25254@nanos> (raw)
In-Reply-To: <20160204164824.GB3305@pathway.suse.cz>

On Thu, 4 Feb 2016, Petr Mladek wrote:
> On Thu 2016-01-28 07:43:49, Prarit Bhargava wrote:
> > +static u64 printk_get_ts(void)
> > +{
> > +	u64 mono, offset_real;
> > +
> > +	if (printk_time == 0)
> > +		return 0;
> > +
> > +	if (printk_time == 1)
> > +		return local_clock();
> > +
> > +	mono = ktime_get_log_ts(&offset_real);
> > +
> > +	if (printk_time == 2)
> > +		return mono;
> > +
> > +	return mono + offset_real;
> 
> At least dmesg is not capable to read the absolute size of the
> real time. It expects offset against the start of the timekeeping
> stuff or so. I get this:
> 
> $> dmesg | tail -n 5
> [    7.128924] IPv6: ADDRCONF(NETDEV_CHANGE): eth0: link becomes ready
> [    0.000000] printk: timestamp set to 0.
> [  179.983704] printk: timestamp set to 1.
> [  181.895655] printk: timestamp set to 2.
> [1454602412.026424] printk: timestamp set to 3.
> 
> $dmesg -T -S | tail -n 5
> [Thu Feb  4 17:10:34 2016] IPv6: ADDRCONF(NETDEV_CHANGE): eth0: link becomes ready
> [Thu Feb  4 17:10:27 2016] printk: timestamp set to 0.
> [Thu Feb  4 17:13:26 2016] printk: timestamp set to 1.
> [Thu Feb  4 17:13:28 2016] printk: timestamp set to 2.
> [Fri Mar 10 09:23:59 2062] printk: timestamp set to 3.
> 
> Please, note that the last entry points to the year 2062.

That's a problem of dmesg -T -S. It doesn't know that the timestamp (3) is
actually CLOCKTIME_REAL already:

-> 1454602412 / (3600 * 24 * 365)
 = 46.1251
-> 1970 + 46
 = 2016
 
Thanks,

	tglx

      parent reply	other threads:[~2016-02-04 17:26 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-01-28 12:43 Prarit Bhargava
2016-01-28 12:52 ` Vasily Averin
2016-01-28 13:17   ` Prarit Bhargava
2016-01-28 13:49     ` Vasily Averin
2016-02-04 16:48 ` Petr Mladek
2016-02-04 17:03   ` Prarit Bhargava
2016-02-08 15:51     ` Petr Mladek
2016-02-08 16:05       ` Prarit Bhargava
2016-02-04 17:25   ` Thomas Gleixner [this message]

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=alpine.DEB.2.11.1602041822570.25254@nanos \
    --to=tglx@linutronix.de \
    --cc=akpm@linux-foundation.org \
    --cc=baolin.wang@linaro.org \
    --cc=gregkh@linuxfoundation.org \
    --cc=joe@perches.com \
    --cc=john.stultz@linaro.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=pang.xunlei@linaro.org \
    --cc=peter@hurleysoftware.com \
    --cc=pmladek@suse.com \
    --cc=prarit@redhat.com \
    --cc=tj@kernel.org \
    --cc=vvs@virtuozzo.com \
    /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

all inboxes | Powered by JetHome®