From: Stefan Schaeckeler <sschaeck@cisco.com>
To: Richard Weinberger <richard@nod.at>
Cc: David Woodhouse <dwmw2@infradead.org>,
Brian Norris <computersforpeace@gmail.com>,
Boris Brezillon <boris.brezillon@bootlin.com>,
Marek Vasut <marek.vasut@gmail.com>,
"linux-mtd@lists.infradead.org" <linux-mtd@lists.infradead.org>,
"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>
Subject: Re: [PATCH] mtd: mtdoops: optionally dump boottime
Date: Sun, 20 May 2018 19:29:24 -0700 [thread overview]
Message-ID: <20180521022924.GA33758@sjc-ads-587.cisco.com> (raw)
Hello Richard and others,
> I get the use-case, but why is this only for mtdoops?
Powerpc's nvram module also stores oops messages and does so by adding an
additional timestamp, as well (search for kmsg_dump_get_buffer() in
arch/powerpc/kernel/nvram_64.c).
This timestamp is the number of seconds since 1970 and stored as a 64 bit
integer in the nvram header. Basically, the last kmesg timestamp is a few ms
less than this additionally stored timestamp. Recording boottime would be more
elegant, I guess.
> IMHO this needs to go into generic code such that all kmsg dumpers can
> benefit from it.
This would be not that easy:
#1 kmsg_dump_get_buffer(...size...) returns the most recent <size> bytes.
Consecutive calls return older chunks. It would be natural to return the
boottime as the first line, e.g. in the last call, but some clients such as
mtdoops call kmsg_dump_get_buffer() only once. The returned buffer may be
complete including boottime, or not.
#2 consistency with other clients: nvram_64.c has the same requirement of
storing a kind of wall-time but does it in a completely different way: no
readable ascii text timestamp preprended to the kmsg buffer but a 64 bit
timestamp in its header. Note, I don't think we should make mtdoops behave like
nvram_64.c by storing the timestamp as a 64 bit integer (in its header) b/c
most people do a cat or string of the mtd device /dev/mtdX and a 64 bit integer
would just read as garbage.
I hope we can have separate implementations for recording additional
timestamps. Later, I'll send a patch with stylistic changes unless we
completely disagree on how to move forward.
Stefan
next reply other threads:[~2018-05-21 2:42 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-05-21 2:29 Stefan Schaeckeler [this message]
2018-05-21 7:13 ` Richard Weinberger
-- strict thread matches above, loose matches on Subject: below --
2018-05-20 3:39 Stefan M Schaeckeler
2018-05-20 8:17 ` Richard Weinberger
2018-05-20 19:48 ` kbuild test robot
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=20180521022924.GA33758@sjc-ads-587.cisco.com \
--to=sschaeck@cisco.com \
--cc=boris.brezillon@bootlin.com \
--cc=computersforpeace@gmail.com \
--cc=dwmw2@infradead.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-mtd@lists.infradead.org \
--cc=marek.vasut@gmail.com \
--cc=richard@nod.at \
/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®