[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <CA+55aFz-VvPBoW0RvDW4eN5YhwaUzcMvsYzrqEC41QdfOdiF4Q@mail.gmail.com>
Date: Tue, 14 Nov 2017 15:18:47 -0800
From: Linus Torvalds <torvalds@...ux-foundation.org>
To: Thomas Gleixner <tglx@...utronix.de>
Cc: Mark Salyzyn <salyzyn@...roid.com>, Petr Mladek <pmladek@...e.com>,
LKML <linux-kernel@...r.kernel.org>,
Ingo Molnar <mingo@...nel.org>,
"H. Peter Anvin" <hpa@...or.com>,
Peter Zijlstra <peterz@...radead.org>,
Andrew Morton <akpm@...ux-foundation.org>,
Prarit Bhargava <prarit@...hat.com>,
Sergey Senozhatsky <sergey.senozhatsky@...il.com>,
Steven Rostedt <rostedt@...dmis.org>
Subject: Re: [GIT pull] printk updates for 4.15
On Tue, Nov 14, 2017 at 3:04 PM, Thomas Gleixner <tglx@...utronix.de> 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?
Linus
Powered by blists - more mailing lists