linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Petr Mladek <pmladek@suse.com>
To: Calvin Owens <calvinowens@fb.com>
Cc: "Paul E. McKenney" <paulmck@linux.vnet.ibm.com>,
	Andrew Morton <akpm@linux-foundation.org>,
	David Howells <dhowells@redhat.com>,
	Pranith Kumar <bobby.prani@gmail.com>,
	David Woodhouse <David.Woodhouse@intel.com>,
	Johannes Weiner <hannes@cmpxchg.org>,
	Ard Biesheuvel <ard.biesheuvel@linaro.org>,
	Tejun Heo <tj@kernel.org>,
	Sergey Senozhatsky <sergey.senozhatsky@gmail.com>,
	Vasily Averin <vvs@virtuozzo.com>,
	Thierry Reding <treding@nvidia.com>,
	Geliang Tang <geliangtang@163.com>,
	Ivan Delalande <colona@arista.com>,
	linux-kernel@vger.kernel.org, kernel-team@fb.com
Subject: Re: [RFC][PATCH] printk: Add option to append kernel version to the dict
Date: Tue, 17 May 2016 11:24:46 +0200	[thread overview]
Message-ID: <20160517092446.GI2895@pathway.suse.cz> (raw)
In-Reply-To: <51047c0f6e86abcb9ee13f60653b6946f8fcfc99.1463172791.git.calvinowens@fb.com>

On Fri 2016-05-13 13:58:04, Calvin Owens wrote:
> We use netconsole to collect kernel logs from all the servers at
> Facebook. We use this patch internally so each logline has a record of
> which kernel version emitted it.
> 
> At first glance, this might seem lazy: as you would expect, we have a
> database which records which kernel version a host is currently running.
> But there are a lot of situations where that database cannot be current:
> early-ish boot crashes are probably the best example, but even beyond
> that there are lots of varieties of kernel brokenness that can prevent
> the database from being updated. Doing it explicitly this way ensures
> that we always know exactly what version emitted a given message.
> 
> Doing it in printk() itself rather than extended netconsole ends up
> being much simpler, and has the advantage that future extended console
> implementations will be able to benefit from this as well.

I do not have strong opinion about it. I am just not sure that repeating the
very same string in each message is efficient and practical in general.

If you store the entire log somewhere, you should be able to find
the kernel version from the early boot messages, e.g. from
pr_notice("%s", linux_banner). Of course, this does not help
if the boot fails earlier but it is rather a corner case.

The risk is that someone else might need another information.
If we do it more generic, we might end up with quite complex code.

If we really need such a feature. It might make sense to print
the identifier at the beginning of each message. It will be the same
on each line and it might be easier to parse.

Best Regards,
Petr

  parent reply	other threads:[~2016-05-17  9:24 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-05-13 20:58 [RFC][PATCH] printk: Add option to append kernel version to the dict Calvin Owens
2016-05-14 22:19 ` Richard Weinberger
2016-05-16 21:41   ` Calvin Owens
2016-05-15  6:36 ` Sergey Senozhatsky
2016-05-16 22:02   ` Calvin Owens
2016-05-17 14:42     ` Sergey Senozhatsky
2016-05-17 13:51       ` Tejun Heo
2016-05-17 15:43         ` Sergey Senozhatsky
2016-05-17 16:05           ` Tejun Heo
2016-05-17  9:24 ` Petr Mladek [this message]
2016-05-17 10:08   ` Tejun Heo

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=20160517092446.GI2895@pathway.suse.cz \
    --to=pmladek@suse.com \
    --cc=David.Woodhouse@intel.com \
    --cc=akpm@linux-foundation.org \
    --cc=ard.biesheuvel@linaro.org \
    --cc=bobby.prani@gmail.com \
    --cc=calvinowens@fb.com \
    --cc=colona@arista.com \
    --cc=dhowells@redhat.com \
    --cc=geliangtang@163.com \
    --cc=hannes@cmpxchg.org \
    --cc=kernel-team@fb.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=paulmck@linux.vnet.ibm.com \
    --cc=sergey.senozhatsky@gmail.com \
    --cc=tj@kernel.org \
    --cc=treding@nvidia.com \
    --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;
as well as URLs for NNTP newsgroup(s).