[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <7616c5f4-def1-7362-ceef-db76107b9c2b@arista.com>
Date: Mon, 20 Apr 2020 18:25:32 +0100
From: Dmitry Safonov <dima@...sta.com>
To: Joe Perches <joe@...ches.com>, linux-kernel@...r.kernel.org
Cc: Dmitry Safonov <0x7f454c46@...il.com>,
Andrew Morton <akpm@...ux-foundation.org>,
Greg Kroah-Hartman <gregkh@...uxfoundation.org>,
Ingo Molnar <mingo@...nel.org>, Jiri Slaby <jslaby@...e.com>,
Petr Mladek <pmladek@...e.com>,
Sergey Senozhatsky <sergey.senozhatsky@...il.com>,
Steven Rostedt <rostedt@...dmis.org>,
Tetsuo Handa <penguin-kernel@...ove.SAKURA.ne.jp>,
Albert Ou <aou@...s.berkeley.edu>,
Ben Segall <bsegall@...gle.com>,
Dietmar Eggemann <dietmar.eggemann@....com>,
Greentime Hu <green.hu@...il.com>,
Ingo Molnar <mingo@...hat.com>,
James Hogan <jhogan@...nel.org>,
Juri Lelli <juri.lelli@...hat.com>,
Mel Gorman <mgorman@...e.de>, Michal Simek <monstr@...str.eu>,
Palmer Dabbelt <palmer@...belt.com>,
Paul Burton <paulburton@...nel.org>,
Paul Walmsley <paul.walmsley@...ive.com>,
Peter Zijlstra <peterz@...radead.org>,
Ralf Baechle <ralf@...ux-mips.org>,
Thomas Gleixner <tglx@...utronix.de>,
Vincent Chen <deanbo422@...il.com>,
Vincent Guittot <vincent.guittot@...aro.org>,
Will Deacon <will@...nel.org>, linux-mips@...r.kernel.org,
linux-riscv@...ts.infradead.org
Subject: Re: [PATCHv3 01/50] kallsyms/printk: Add loglvl to print_ip_sym()
Hi Joe,
On 4/18/20 9:40 PM, Joe Perches wrote:
> On Sat, 2020-04-18 at 21:18 +0100, Dmitry Safonov wrote:
>> print_ip_sym() needs to have a log level parameter to comply with other
>> parts being printed. Otherwise, half of the expected backtrace would be
>> printed and other may be missing with some logging level.
>
> I'd rather create another extension to %ps that also emits
> the [<address>] along with the symbol lookup and retire
> print_ip_sym altogether.
Makes sense.
Would you mind if I'll do it on the top of these patches?
[not to mix new printk-format with patches those add loglvl parameter]
>
> Something like:
> ---
> lib/vsprintf.c | 4 ++++
> 1 file changed, 4 insertions(+)
>
> diff --git a/lib/vsprintf.c b/lib/vsprintf.c
> index 7c488a..8fce8f 100644
> --- a/lib/vsprintf.c
> +++ b/lib/vsprintf.c
> @@ -2072,6 +2072,8 @@ char *fwnode_string(char *buf, char *end, struct fwnode_handle *fwnode,
> * - 'S' For symbolic direct pointers (or function descriptors) with offset
> * - 's' For symbolic direct pointers (or function descriptors) without offset
> * - '[Ss]R' as above with __builtin_extract_return_addr() translation
> + * - '[Ss]B' [<address>] and symbolic direct pointers as above
> + * (was used previously used as print_ip_sym)
> * - '[Ff]' %pf and %pF were obsoleted and later removed in favor of
> * %ps and %pS. Be careful when re-using these specifiers.
> * - 'B' For backtraced symbolic direct pointers with offset
> @@ -2183,6 +2185,8 @@ char *pointer(const char *fmt, char *buf, char *end, void *ptr,
> case 'S':
> case 's':
> ptr = dereference_symbol_descriptor(ptr);
> + if (fmt[1] == 'B')
> + buf += vsprintf(buf, end, "[<%px>] ", ptr);
> /* Fallthrough */
> case 'B':
> return symbol_string(buf, end, ptr, spec, fmt);
>
>
Thanks,
Dmitry
Powered by blists - more mailing lists