linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Kay Sievers <kay@vrfy.org>
To: Linus Torvalds <torvalds@linux-foundation.org>
Cc: Sasha Levin <levinsasha928@gmail.com>,
	Greg KH <gregkh@linuxfoundation.org>,
	Yinghai Lu <yinghai@kernel.org>, Joe Perches <joe@perches.com>,
	Ingo Molnar <mingo@kernel.org>,
	linux-kernel@vger.kernel.org
Subject: Re: [PATCH RESEND 1/3] printk: convert byte-buffer to variable-length record buffer
Date: Sun, 13 May 2012 13:08:04 +0200	[thread overview]
Message-ID: <CAPXgP11xpPk3pZo7VbVsEtQvD7DrX1Jm6=tSLME2dMgWSn4oUg@mail.gmail.com> (raw)
In-Reply-To: <CA+55aFyeXdUyj_OzccctFSj1f4su1G8DyxiQwD4W5sV9Dh0Zpg@mail.gmail.com>

On Sat, May 12, 2012 at 8:35 PM, Linus Torvalds
<torvalds@linux-foundation.org> wrote:
> On Sat, May 12, 2012 at 12:43 AM, Sasha Levin <levinsasha928@gmail.com> wrote:
>>
>> So I got something like this:
>>
>> # sleep 61 ; echo foo > /dev/kmsg ; sleep 61 ; echo bar > /dev/kmsg ;
>> sleep 5 ; echo zoot > /dev/kmsg ; sleep 10 ; echo foo > /dev/kmsg ;
>> echo bar > /dev/kmsg ; sleep 61 ; echo zoot > /dev/kmsg ; echo foo >
>> /dev/kmsg
>>
>> [  673.222632] foo
>> [  734.315249] bar
>> [   +5.077527] zoot
>> [  +10.235225] foo
>> [   +0.002971] bar
>> [  810.883085] zoot
>> [   +0.003081] foo
>>
>> If that looks right, I can send a patch once this printf overhaul is
>> stable, unless Kay already plans on doing it as part of his work.
>
> So judging by my own use, I really think that
>
>  (a) the microseconds are *totally* useless for the absolute time. In
> fact, they are worse than useless: they take up space and are actively
> distracting.
>
>      If the last message was over a minute ago, *nobody* cares about
> the microsecond. The microseconds are useful when there are multiple
> messages and you see that "oh, those events happened within a couple
> of ms of each other", but for the absolute time they are just bad.
>
>     Even the *seconds* are probably not that interesting.
>
>  (b) The one thing I have often wanted is not "after how many seconds
> of boot", but "when". So it would actually be nice if the absolute
> time was converted into local time. The kernel can actually do that,
> so I suspect that the best format for the relative timestamps would
> really be something like
>
>   > [May12 11:27] foo
>   > [May12 11:28] bar
>   > [  +5.077527] zoot
>   > [ +10.235225] foo
>   > [  +0.002971] bar
>   > [May12 11:29] zoot
>   > [  +0.003081] foo
>
> because that would be really useful sometimes.
>
> (And no, never mind the year. If you log those things long-term, the
> year will be in the full log, so logging the year in the dmesg is just
> pointless.)
>
> I dunno. The above is what I would have liked to see quite often. I
> look at dmesg, and notice that I had an WARN_ON_ONCE in it, and I have
> no idea when it happened, because the "seconds since boot" is totally
> useless information for me, as I'm too lazy to try to use /proc/uptime
> to calculate what it is.

Yeah, that looks generally more useful.

"dmesg -T" tries to translate that to wall clock time too. At the
moment, it can't really do that reliable at the point of reading the
timestamps though, because the monotonic time used does not include
the time spent in suspend.

One other problem with the current logic is that the timestamp we get
at the moment is not guaranteed to monotonic, log lines from different
CPUs at the same time can jump forth and back, so the relative-time
calculation could, with the current code, show negative values.

Not sure what options we have to use a more better clock source, if
things are expected to work in NMIs and IRQs.

Kay

  reply	other threads:[~2012-05-13 11:08 UTC|newest]

Thread overview: 100+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-05-03  0:29 [PATCH RESEND 1/3] printk: convert byte-buffer to variable-length record buffer Kay Sievers
2012-05-03 19:48 ` Peter Zijlstra
2012-05-03 19:54   ` Kay Sievers
2012-05-03 19:55     ` Peter Zijlstra
2012-05-03 19:56   ` Linus Torvalds
2012-05-03 20:02     ` Peter Zijlstra
2012-05-03 20:09       ` Linus Torvalds
2012-05-03 20:11         ` Peter Zijlstra
2012-05-03 20:18           ` Greg Kroah-Hartmann
2012-05-08  8:48 ` Sasha Levin
2012-05-08 11:14   ` Kay Sievers
2012-05-08 13:33     ` Sasha Levin
2012-05-08 14:29       ` Kay Sievers
2012-05-08 15:33         ` Kay Sievers
2012-05-08 15:57           ` Sasha Levin
2012-05-08 16:27             ` Kay Sievers
2012-05-08 22:57               ` Greg Kroah-Hartmann
2012-05-09  3:52     ` Linus Torvalds
2012-05-09  4:06       ` Joe Perches
2012-05-09  4:11       ` Sasha Levin
2012-05-09  4:27         ` Linus Torvalds
2012-05-09  4:36           ` Linus Torvalds
2012-05-09  7:07             ` Ingo Molnar
2012-05-09 13:21               ` Kay Sievers
2012-05-09 13:29               ` Kay Sievers
2012-05-10  0:54                 ` Kay Sievers
2012-05-10  1:18                   ` Linus Torvalds
2012-05-10  2:32                     ` Kay Sievers
2012-05-10  2:46                       ` Joe Perches
2012-05-10 16:39                     ` Kay Sievers
2012-05-10 16:47                       ` Linus Torvalds
2012-05-10 18:49                         ` Tony Luck
2012-05-10 19:09                         ` Kay Sievers
2012-05-10 20:14                           ` Ted Ts'o
2012-05-10 20:37                             ` Joe Perches
2012-05-10 20:39                               ` Kay Sievers
2012-05-10 20:46                                 ` Joe Perches
2012-05-10 20:52                                   ` Linus Torvalds
2012-05-10 21:11                                     ` Joe Perches
2012-05-10 21:15                                       ` Kay Sievers
2012-05-10 21:58                                       ` Linus Torvalds
2012-05-11  0:13                                         ` Joe Perches
2012-05-11  0:38                                     ` Kay Sievers
2012-05-11  1:23                                       ` Kay Sievers
2012-05-14 18:46                                         ` Kay Sievers
2012-05-10 21:01                                   ` Kay Sievers
2012-05-10 20:38                             ` Kay Sievers
2012-05-09  9:38       ` Kay Sievers
2012-05-09 13:50         ` Joe Perches
2012-05-09 14:37           ` Kay Sievers
2012-05-09 23:02             ` Yinghai Lu
2012-05-09 23:06               ` Greg Kroah-Hartmann
2012-05-10  2:30                 ` Kay Sievers
2012-05-11 10:35                   ` Sasha Levin
2012-05-11 15:19                     ` Greg KH
2012-05-11 15:22                       ` Sasha Levin
2012-05-11 15:35                       ` Linus Torvalds
2012-05-11 15:40                         ` Kay Sievers
2012-05-11 15:47                           ` Linus Torvalds
2012-05-11 19:51                             ` Mark Lord
2012-05-11 20:02                               ` Linus Torvalds
2012-05-12 18:04                                 ` Mark Lord
2012-05-12  7:43                             ` Sasha Levin
2012-05-12 18:35                               ` Linus Torvalds
2012-05-13 11:08                                 ` Kay Sievers [this message]
2012-05-13 13:22                                 ` Mark Lord
2012-05-13 18:01                                   ` Linus Torvalds
2012-05-13 22:19                                     ` Mark Lord
2012-05-14 16:40                                   ` valdis.kletnieks
2012-05-17  3:44                                 ` H. Peter Anvin
2012-05-13 21:48                               ` Kay Sievers
2012-05-13 21:30                     ` Kay Sievers
2012-05-26 11:11 ` Anton Vorontsov
2012-05-27 14:23   ` Kay Sievers
2012-05-29 16:07     ` Kay Sievers
2012-05-29 16:14       ` Joe Perches
2012-05-29 16:34         ` Kay Sievers
2012-05-29 16:51           ` Joe Perches
2012-05-29 17:11       ` Luck, Tony
2012-05-29 17:22         ` Kay Sievers
2012-05-30 11:29           ` Kay Sievers
2012-06-06  6:33       ` Greg Kroah-Hartmann
2012-06-15  0:04       ` Greg KH
2012-06-15  1:31         ` Anton Vorontsov
2012-06-15 12:07         ` Kay Sievers
2012-06-15 12:23           ` Ingo Molnar
2012-06-15 21:53             ` Greg KH
2012-06-15 12:23           ` Anton Vorontsov
2012-06-15 20:54           ` Tony Luck
2012-11-28 13:33 ` Michael Kerrisk
2012-11-28 16:22   ` Kay Sievers
2012-11-28 16:37     ` Linus Torvalds
2012-11-28 16:49       ` Kay Sievers
2012-11-28 17:51         ` Kay Sievers
2012-11-29 13:18           ` Michael Kerrisk (man-pages)
2012-11-29 13:28             ` Kay Sievers
2012-11-29 13:37               ` Michael Kerrisk (man-pages)
2012-11-29 14:08                 ` Kay Sievers
2012-11-29 14:18                   ` Michael Kerrisk (man-pages)
2012-11-29 14:31                     ` Kay Sievers

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='CAPXgP11xpPk3pZo7VbVsEtQvD7DrX1Jm6=tSLME2dMgWSn4oUg@mail.gmail.com' \
    --to=kay@vrfy.org \
    --cc=gregkh@linuxfoundation.org \
    --cc=joe@perches.com \
    --cc=levinsasha928@gmail.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mingo@kernel.org \
    --cc=torvalds@linux-foundation.org \
    --cc=yinghai@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;
as well as URLs for NNTP newsgroup(s).