[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <YgRH7hwFC2AGISdP@bombadil.infradead.org>
Date: Wed, 9 Feb 2022 15:02:06 -0800
From: Luis Chamberlain <mcgrof@...nel.org>
To: Petr Mladek <pmladek@...e.com>, Vimal Agrawal <avimalin@...il.com>
Cc: Maninder Singh <maninder1.s@...sung.com>, rostedt@...dmis.org,
senozhatsky@...omium.org, andriy.shevchenko@...ux.intel.com,
linux@...musvillemoes.dk, akpm@...ux-foundation.org,
wangkefeng.wang@...wei.com, mbenes@...e.cz, swboyd@...omium.org,
ojeda@...nel.org, linux-kernel@...r.kernel.org, will@...nel.org,
catalin.marinas@....com, Vaneet Narang <v.narang@...sung.com>,
Aaron Tomlin <atomlin@...hat.com>
Subject: Re: [PATCH 1/1] kallsyms: print module name in %ps/S case when
KALLSYMS is disabled
On Wed, Feb 09, 2022 at 12:40:38PM +0100, Petr Mladek wrote:
> > --- a/include/linux/kallsyms.h
> > +++ b/include/linux/kallsyms.h
> > @@ -163,6 +163,33 @@ static inline bool kallsyms_show_value(const struct cred *cred)
> > return false;
> > }
> >
> > +#ifdef CONFIG_MODULES
> > +static inline int fill_minimal_module_info(char *sym, int size, unsigned long value)
> > +{
> > + struct module *mod;
> > + unsigned long offset;
> > + int ret = 0;
> > +
> > + preempt_disable();
> > + mod = __module_address(value);
> > + if (mod) {
> > + offset = value - (unsigned long)mod->core_layout.base;
> > + snprintf(sym, size - 1, "0x%lx+0x%lx [%s]",
> > + (unsigned long)mod->core_layout.base, offset, mod->name);
> > +
> > + sym[size - 1] = '\0';
> > + ret = 1;
> > + }
> > +
> > + preempt_enable();
> > + return ret;
> > +}
>
> It looks too big for an inlined function. Anyway, we will need
> something even more complex, see below.
Interesting, these observations might apply to Vimal's work as well [0].
[0] https://lkml.kernel.org/r/YgKyC4ZRud0JW1PF@bombadil.infradead.org
Luis
Powered by blists - more mailing lists