All the mail mirrored from lore.kernel.org
 help / color / mirror / Atom feed
From: Petr Mladek <pmladek@suse.com>
To: Stephen Boyd <swboyd@chromium.org>
Cc: Andrew Morton <akpm@linux-foundation.org>,
	linux-kernel@vger.kernel.org, Jiri Olsa <jolsa@kernel.org>,
	Alexei Starovoitov <ast@kernel.org>, Jessica Yu <jeyu@kernel.org>,
	Evan Green <evgreen@chromium.org>,
	Hsin-Yi Wang <hsinyi@chromium.org>,
	Steven Rostedt <rostedt@goodmis.org>,
	Sergey Senozhatsky <sergey.senozhatsky@gmail.com>,
	Andy Shevchenko <andriy.shevchenko@linux.intel.com>,
	Rasmus Villemoes <linux@rasmusvillemoes.dk>,
	linux-doc@vger.kernel.org, Matthew Wilcox <willy@infradead.org>
Subject: Re: [PATCH v6 05/13] module: Add printk formats to add module build ID to stacktraces
Date: Tue, 11 May 2021 13:35:21 +0200	[thread overview]
Message-ID: <YJpr+T616Wki2542@alley> (raw)
In-Reply-To: <20210511003845.2429846-6-swboyd@chromium.org>

On Mon 2021-05-10 17:38:37, Stephen Boyd wrote:
> Let's make kernel stacktraces easier to identify by including the build
> ID[1] of a module if the stacktrace is printing a symbol from a module.

> --- a/include/linux/module.h
> +++ b/include/linux/module.h
> @@ -11,6 +11,7 @@
>  
>  #include <linux/list.h>
>  #include <linux/stat.h>
> +#include <linux/buildid.h>
>  #include <linux/compiler.h>
>  #include <linux/cache.h>
>  #include <linux/kmod.h>
> @@ -364,6 +365,11 @@ struct module {
>  	/* Unique handle for this module */
>  	char name[MODULE_NAME_LEN];
>  
> +#ifdef CONFIG_STACKTRACE_BUILD_ID
> +	/* Module build ID */
> +	unsigned char build_id[BUILD_ID_SIZE_MAX];
> +#endif
> +
>  	/* Sysfs stuff. */
>  	struct module_kobject mkobj;
>  	struct module_attribute *modinfo_attrs;
> @@ -627,7 +633,7 @@ void *dereference_module_function_descriptor(struct module *mod, void *ptr);
>  const char *module_address_lookup(unsigned long addr,
>  			    unsigned long *symbolsize,
>  			    unsigned long *offset,
> -			    char **modname,
> +			    char **modname, const unsigned char **modbuildid,

Nit: It would have been better to follow the existing style and put only one
     parameter per-line.

Please, fix it in the next version if there is any. But no need
to resend it just because of this unless Jessica asks for it.

>  			    char *namebuf);
>  int lookup_module_symbol_name(unsigned long addr, char *symname);
>  int lookup_module_symbol_attrs(unsigned long addr, unsigned long *size, unsigned long *offset, char *modname, char *name);

> diff --git a/kernel/module.c b/kernel/module.c
> index 30479355ab85..a5eaf5188a83 100644
> --- a/kernel/module.c
> +++ b/kernel/module.c
> @@ -4235,7 +4257,7 @@ void * __weak dereference_module_function_descriptor(struct module *mod,
>  const char *module_address_lookup(unsigned long addr,
>  			    unsigned long *size,
>  			    unsigned long *offset,
> -			    char **modname,
> +			    char **modname, const unsigned char **modbuildid,

Same here.

>  			    char *namebuf)
>  {
>  	const char *ret = NULL;

Otherwise, it looks good.

Reviewed-by: Petr Mladek <pmladek@suse.com>

Best Regards,
Petr

  reply	other threads:[~2021-05-11 11:35 UTC|newest]

Thread overview: 42+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-05-11  0:38 [PATCH v6 00/13] Add build ID to stacktraces Stephen Boyd
2021-05-11  0:38 ` Stephen Boyd
2021-05-11  0:38 ` Stephen Boyd
2021-05-11  0:38 ` [PATCH v6 01/13] buildid: Only consider GNU notes for build ID parsing Stephen Boyd
2021-05-11  0:38 ` [PATCH v6 02/13] buildid: Add API to parse build ID out of buffer Stephen Boyd
2021-05-11  0:38 ` [PATCH v6 03/13] buildid: Stash away kernels build ID on init Stephen Boyd
2021-05-11  0:38   ` Stephen Boyd
2021-05-11  0:38 ` [PATCH v6 04/13] dump_stack: Add vmlinux build ID to stack traces Stephen Boyd
2021-05-11  0:38 ` [PATCH v6 05/13] module: Add printk formats to add module build ID to stacktraces Stephen Boyd
2021-05-11 11:35   ` Petr Mladek [this message]
2021-05-11 16:51     ` Stephen Boyd
2021-05-11  0:38 ` [PATCH v6 06/13] arm64: stacktrace: Use %pSb for backtrace printing Stephen Boyd
2021-05-11  0:38   ` Stephen Boyd
2021-05-11  0:38 ` [PATCH v6 07/13] x86/dumpstack: Use %pSb/%pBb " Stephen Boyd
2021-05-11  0:38 ` [PATCH v6 08/13] scripts/decode_stacktrace.sh: Support debuginfod Stephen Boyd
2021-05-11  0:38 ` [PATCH v6 09/13] scripts/decode_stacktrace.sh: Silence stderr messages from addr2line/nm Stephen Boyd
2021-05-11  0:38 ` [PATCH v6 10/13] scripts/decode_stacktrace.sh: Indicate 'auto' can be used for base path Stephen Boyd
2021-05-11  0:38 ` [PATCH v6 11/13] buildid: Mark some arguments const Stephen Boyd
2021-05-11  0:38 ` [PATCH v6 12/13] buildid: Fix kernel-doc notation Stephen Boyd
2021-05-11  0:38 ` [PATCH v6 13/13] kdump: Use vmlinux_build_id to simplify Stephen Boyd
2021-05-11  0:38   ` Stephen Boyd
2021-05-11 11:48 ` [PATCH v6 00/13] Add build ID to stacktraces Petr Mladek
2021-05-11 11:48   ` Petr Mladek
2021-05-11 11:48   ` Petr Mladek
2021-05-11 12:36 ` David Laight
2021-05-11 12:36   ` David Laight
2021-05-11 12:36   ` David Laight
2021-05-11 12:52   ` Steven Rostedt
2021-05-11 12:52     ` Steven Rostedt
2021-05-11 12:52     ` Steven Rostedt
2021-05-11 12:58     ` David Laight
2021-05-11 12:58       ` David Laight
2021-05-11 12:58       ` David Laight
2021-05-11 14:21       ` Petr Mladek
2021-05-11 14:21         ` Petr Mladek
2021-05-11 14:21         ` Petr Mladek
2021-05-11 14:31         ` David Laight
2021-05-11 14:31           ` David Laight
2021-05-11 14:31           ` David Laight
2021-05-11 14:35           ` Matthew Wilcox
2021-05-11 14:35             ` Matthew Wilcox
2021-05-11 14:35             ` Matthew Wilcox

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=YJpr+T616Wki2542@alley \
    --to=pmladek@suse.com \
    --cc=akpm@linux-foundation.org \
    --cc=andriy.shevchenko@linux.intel.com \
    --cc=ast@kernel.org \
    --cc=evgreen@chromium.org \
    --cc=hsinyi@chromium.org \
    --cc=jeyu@kernel.org \
    --cc=jolsa@kernel.org \
    --cc=linux-doc@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux@rasmusvillemoes.dk \
    --cc=rostedt@goodmis.org \
    --cc=sergey.senozhatsky@gmail.com \
    --cc=swboyd@chromium.org \
    --cc=willy@infradead.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.