Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1352720 > unrolled thread

Re: [PATCH 0/2 v6] printk, Add monotonic and real printk timestamps

Started byThomas Gleixner <tglx@linutronix.de>
First post2016-03-08 09:10 +0100
Last post2016-03-10 16:40 +0100
Articles 4 — 3 participants

Back to article view | Back to linux.kernel

This discussion starts older than the indexed window; earlier articles aren't shown. The article labeled Started by below is the oldest one visible, not the original post.


Contents

  Re: [PATCH 0/2 v6] printk, Add monotonic and real printk  timestamps Thomas Gleixner <tglx@linutronix.de> - 2016-03-08 09:10 +0100
    Re: [PATCH 0/2 v6] printk, Add monotonic and real printk timestamps Prarit Bhargava <prarit@redhat.com> - 2016-03-08 12:10 +0100
      Re: [PATCH 0/2 v6] printk, Add monotonic and real printk timestamps Petr Mladek <pmladek@suse.com> - 2016-03-10 11:10 +0100
        Re: [PATCH 0/2 v6] printk, Add monotonic and real printk  timestamps Thomas Gleixner <tglx@linutronix.de> - 2016-03-10 16:40 +0100

#1352720 — Re: [PATCH 0/2 v6] printk, Add monotonic and real printk timestamps

FromThomas Gleixner <tglx@linutronix.de>
Date2016-03-08 09:10 +0100
SubjectRe: [PATCH 0/2 v6] printk, Add monotonic and real printk timestamps
Message-ID<rakSn-6EA-33@gated-at.bofh.it>
On Tue, 23 Feb 2016, Prarit Bhargava wrote:

> This patchset adds monotonic and real printk timestamps.  The first patch
> changes CONFIG_PRINT_TIME from a bool to an int to allow for the additional
> timestamps that are added in patch 2.
> 
> Changes from v6: Petr Mladek pointed out that the current patch
> fails to indicate to userspace programs which timestamp is being used.

How is that solved?

Thanks,

	tglx

[toc] | [next] | [standalone]


#1352886 — Re: [PATCH 0/2 v6] printk, Add monotonic and real printk timestamps

FromPrarit Bhargava <prarit@redhat.com>
Date2016-03-08 12:10 +0100
SubjectRe: [PATCH 0/2 v6] printk, Add monotonic and real printk timestamps
Message-ID<ranGy-8tF-29@gated-at.bofh.it>
In reply to#1352720

On 03/08/2016 02:59 AM, Thomas Gleixner wrote:
> On Tue, 23 Feb 2016, Prarit Bhargava wrote:
> 
>> This patchset adds monotonic and real printk timestamps.  The first patch
>> changes CONFIG_PRINT_TIME from a bool to an int to allow for the additional
>> timestamps that are added in patch 2.
>>
>> Changes from v6: Petr Mladek pointed out that the current patch
>> fails to indicate to userspace programs which timestamp is being used.
> 
> How is that solved?

Hi Thomas,

Userspace programs can now look at /sys/modules/printk/parameters/time which
will contain [0-3] for the timestamp clock.

The file is globally readable so it shouldn't cause any problems for userspace
programs:

[root@intel-wildcatpass-06 dummy-module]# ls -l /sys/module/printk/parameters/time
-rw-r--r--. 1 root root 4096 Mar  8 06:01 /sys/module/printk/parameters/time

P.

> 
> Thanks,
> 
> 	tglx
> 

[toc] | [prev] | [next] | [standalone]


#1354969 — Re: [PATCH 0/2 v6] printk, Add monotonic and real printk timestamps

FromPetr Mladek <pmladek@suse.com>
Date2016-03-10 11:10 +0100
SubjectRe: [PATCH 0/2 v6] printk, Add monotonic and real printk timestamps
Message-ID<rb5HA-5r7-21@gated-at.bofh.it>
In reply to#1352886
On Tue 2016-03-08 06:03:24, Prarit Bhargava wrote:
> 
> 
> On 03/08/2016 02:59 AM, Thomas Gleixner wrote:
> > On Tue, 23 Feb 2016, Prarit Bhargava wrote:
> > 
> >> This patchset adds monotonic and real printk timestamps.  The first patch
> >> changes CONFIG_PRINT_TIME from a bool to an int to allow for the additional
> >> timestamps that are added in patch 2.
> >>
> >> Changes from v6: Petr Mladek pointed out that the current patch
> >> fails to indicate to userspace programs which timestamp is being used.
> > 
> > How is that solved?
> 
> Hi Thomas,
> 
> Userspace programs can now look at /sys/modules/printk/parameters/time which
> will contain [0-3] for the timestamp clock.

But it includes only the current setting that is valid only for
messages printed with this setting. The ring buffer might include
different messages produced with different setting.

I suggest to look how dmesg handles the time stamp. I wonder how it
converts the relative time into an absolute one. I wonder if you
could convert all timestamps to the relative format, so that you
do not need to change all userspace tools at all.

Best regards,
Petr

[toc] | [prev] | [next] | [standalone]


#1355204

FromThomas Gleixner <tglx@linutronix.de>
Date2016-03-10 16:40 +0100
Message-ID<rbaQV-vD-1@gated-at.bofh.it>
In reply to#1354969
On Thu, 10 Mar 2016, Petr Mladek wrote:
> On Tue 2016-03-08 06:03:24, Prarit Bhargava wrote:
> > 
> > 
> > On 03/08/2016 02:59 AM, Thomas Gleixner wrote:
> > > On Tue, 23 Feb 2016, Prarit Bhargava wrote:
> > > 
> > >> This patchset adds monotonic and real printk timestamps.  The first patch
> > >> changes CONFIG_PRINT_TIME from a bool to an int to allow for the additional
> > >> timestamps that are added in patch 2.
> > >>
> > >> Changes from v6: Petr Mladek pointed out that the current patch
> > >> fails to indicate to userspace programs which timestamp is being used.
> > > 
> > > How is that solved?
> > 
> > Hi Thomas,
> > 
> > Userspace programs can now look at /sys/modules/printk/parameters/time which
> > will contain [0-3] for the timestamp clock.
> 
> But it includes only the current setting that is valid only for
> messages printed with this setting. The ring buffer might include
> different messages produced with different setting.
> 
> I suggest to look how dmesg handles the time stamp. I wonder how it
> converts the relative time into an absolute one. I wonder if you
> could convert all timestamps to the relative format, so that you
> do not need to change all userspace tools at all.

  ctime = system_boot_time + dmesg_stamp

The reason why you see wrong values here is that dmesg_stamp is not based on
clock monotonic. So if printk uses clock monotonic, dmesg does not have to be
changed.

Though you have to know, that the above is a linearized history because
system_boot_time is 

  clock_monotonic_now() + boot_offset

So you can't observe stuff like leap seconds, settimeofday or other things
which result in a non linear behaviour of clock realtime.

Thanks,

	tglx

[toc] | [prev] | [standalone]


Back to top | Article view | linux.kernel


csiph-web