From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751672AbcEPVmR (ORCPT ); Mon, 16 May 2016 17:42:17 -0400 Received: from mx0a-00082601.pphosted.com ([67.231.145.42]:52339 "EHLO mx0a-00082601.pphosted.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750913AbcEPVmP (ORCPT ); Mon, 16 May 2016 17:42:15 -0400 Date: Mon, 16 May 2016 14:41:03 -0700 From: Calvin Owens To: Richard Weinberger CC: "Paul E. McKenney" , Andrew Morton , David Howells , Pranith Kumar , David Woodhouse , Johannes Weiner , Ard Biesheuvel , Petr Mladek , Tejun Heo , Sergey Senozhatsky , Vasily Averin , Thierry Reding , Geliang Tang , Ivan Delalande , LKML , Subject: Re: [RFC][PATCH] printk: Add option to append kernel version to the dict Message-ID: <20160516214103.GB2018262@devbig337.prn1.facebook.com> References: <51047c0f6e86abcb9ee13f60653b6946f8fcfc99.1463172791.git.calvinowens@fb.com> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.5.21 (2010-09-15) X-Originating-IP: [192.168.52.123] X-Proofpoint-Spam-Reason: safe X-FB-Internal: Safe X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10432:,, definitions=2016-05-16_09:,, signatures=0 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Sunday 05/15 at 00:19 +0200, Richard Weinberger wrote: > On Fri, May 13, 2016 at 10:58 PM, 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. > > > > Signed-off-by: Calvin Owens > > --- > > init/Kconfig | 8 ++++++++ > > kernel/printk/printk.c | 14 ++++++++++++++ > > 2 files changed, 22 insertions(+) > > I don't think adding a new config option is appropriate. > How about adding a log format string tunable to netconsole? Like a generic way to append arbitrary key/val to the dict? It would still need to be configured via the kernel cmdline or at compile time: I can't rely getting to userspace. I had steered away from something more general like that because it didn't seem worth the trobule, but I can certainly go that route: what sort of format specifiers would we want? I only care about UTS_RELEASE, but I suppose UTS_NODENAME and UTS_VERSION might be handy in some cases? Thanks, Calvin > -- > Thanks, > //richard