From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1757178AbdKNXW5 (ORCPT ); Tue, 14 Nov 2017 18:22:57 -0500 Received: from Galois.linutronix.de ([146.0.238.70]:39602 "EHLO Galois.linutronix.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1756551AbdKNXWt (ORCPT ); Tue, 14 Nov 2017 18:22:49 -0500 Date: Wed, 15 Nov 2017 00:22:45 +0100 (CET) From: Thomas Gleixner To: Linus Torvalds cc: Mark Salyzyn , Petr Mladek , LKML , Ingo Molnar , "H. Peter Anvin" , Peter Zijlstra , Andrew Morton , Prarit Bhargava , Sergey Senozhatsky , Steven Rostedt Subject: Re: [GIT pull] printk updates for 4.15 In-Reply-To: Message-ID: References: <20171114100336.uil744pxmbsawq63@pathway.suse.cz> <7d23f705-1479-7874-7918-f2af9ec02c86@android.com> <7f0e0165-2b22-f2cf-ce6e-8db3d7325973@android.com> User-Agent: Alpine 2.20 (DEB 67 2015-01-07) MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII X-Linutronix-Spam-Score: -1.0 X-Linutronix-Spam-Level: - X-Linutronix-Spam-Status: No , -1.0 points, 5.0 required, ALL_TRUSTED=-1,SHORTCIRCUIT=-0.0001 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Tue, 14 Nov 2017, Linus Torvalds wrote: > On Tue, Nov 14, 2017 at 3:04 PM, Thomas Gleixner wrote: > > True. I already replaced all of them except this one: > > > > @@ -1022,6 +1026,7 @@ void log_buf_vmcoreinfo_setup(void) > > */ > > VMCOREINFO_STRUCT_SIZE(printk_log); > > VMCOREINFO_OFFSET(printk_log, ts_nsec); > > + VMCOREINFO_OFFSET(printk_log, ts); > > VMCOREINFO_OFFSET(printk_log, len); > > VMCOREINFO_OFFSET(printk_log, text_len); > > VMCOREINFO_OFFSET(printk_log, dict_len); > > > > If I remove ts_nsec completely, then the VMCORE info changes and that would > > break existing tools because they search for ts_nsec and fail.... > > Dear god, that's nasty. > > I agree that the vmcore info name probably needs to be retained, but > maybe we could just do that with > > #define VMCOREINFO_FIELD_AND_OFFSET(name, field, offset) \ > vmcoreinfo_append_str("OFFSET(%s.%s)=%lu\n", name, field, offset) > > and then do > > #define VMCOREINFO_OFFSET(name, field) \ > VMCOREINFO_FIELD_AND_OFFSET(#name, #field, \ > (unsigned long)offsetof(struct name, offset)) > > and for that ts_nsec you can then do > > /* ts.mono used to be called "ts_nsec" */ > VMCOREINFO_FIELD_AND_OFFSET("printk_log", "ts_nsec", > (unsigned long)offsetof(struct printk_log, ts.mono)) > > or something. > > And I may obviously have messed that all up, I wrote it all in the > email client, so it's more pseudo-code than anything else. > > But it looks pretty straight-forward conceptually, and would make it > pretty clear what is going on, no? That should work. I'll try that tomorrow with brain awake. Thanks, tglx