Received: by 2002:a05:6a10:206:0:0:0:0 with SMTP id 6csp3436453pxj; Tue, 11 May 2021 04:36:56 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwM47Lg8UcjR2wozxDpBHIiUBS9pqhc1I7EWJyj1gwWKS/KitLo9yltBpBFtmL97mMP3Wsq X-Received: by 2002:a05:6402:4251:: with SMTP id g17mr34958244edb.205.1620733016382; Tue, 11 May 2021 04:36:56 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1620733016; cv=none; d=google.com; s=arc-20160816; b=Eap8lgNfcRVo4o31hY2Xg9yrMnfGq8pzySwLgdYgmUmcoO7sIqWuqdZekQKF3AI8aG 6d0AiAiq7pLd3jSE7wo4aweDqYo915Sy50aGo+RgW79ul7dhzRjmsSOWO9gTCa6q9iDE b7OuDmV0IJqymAzArEB+rAtJ4Wf1KjfwI30M3gX7iBfL2xMIFsaE9221Jpr+nLBnZA2V 1NhMt8Z4HeeI6cOkPqIcljoQQd79XsX2sf5zjHM/HXuskFjnFZhu9x3Mbzt7lBn0hRRn dJ6UO3ZSMwLAYs+nBvt1fxl0ZhaZkDburPgD2trcS7tIfWu+sjMWhQMiIHrnMwbhVqFX Mc+g== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-disposition:mime-version :references:message-id:subject:cc:to:from:date:dkim-signature; bh=X9ftnEprnJR+ecG9/KIu42CmG3FUYjZYMpe6qMgEarE=; b=Ox+LICx+44d2kR/B3iKay5two1fLhzTdPOFMgLin6Nx82VHMIYXB+n7LkiozXM+A6V kRMT3Eq6RyNTNOm9ymlUrulnkOAqqS3RmJZ2177V/ZOauNgIGHThxUrENqeqQ4AACDPi x3sKZl/z8RPsbyAn7mJWWJ+ch0qxnnasQPvFqv0AZ4+JJPKqjulWxRJIbI0DvY/hArX/ ci2JT7svMEZ82x1uGa4h2Kbv0Xux0y565kKOk7BHZaDsBmF324zdj1PqodJYcJzklKXA ZXZadO3/kKcAA2ocuFxuIqL14m+vH1veO9iCrXgTwXoyVt1OsXpwmnD6t/CSAI6O062o aMqw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@suse.com header.s=susede1 header.b=ske5PixW; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=QUARANTINE sp=NONE dis=NONE) header.from=suse.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id n2si12945937eda.470.2021.05.11.04.36.32; Tue, 11 May 2021 04:36:56 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@suse.com header.s=susede1 header.b=ske5PixW; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=QUARANTINE sp=NONE dis=NONE) header.from=suse.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231382AbhEKLgb (ORCPT + 99 others); Tue, 11 May 2021 07:36:31 -0400 Received: from mx2.suse.de ([195.135.220.15]:51518 "EHLO mx2.suse.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230501AbhEKLga (ORCPT ); Tue, 11 May 2021 07:36:30 -0400 X-Virus-Scanned: by amavisd-new at test-mx.suse.de DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.com; s=susede1; t=1620732923; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc:cc: mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=X9ftnEprnJR+ecG9/KIu42CmG3FUYjZYMpe6qMgEarE=; b=ske5PixWDoCRPpfIHj7Q9RLA35KvPYh3oejmOcRz7cIRInPeazbnvZODdpJA0AtN2vSeFM hIb3buKHSCUJy6uN4jg9Pa8DlLt+OL/J7tG5qG4QryLSwTYL4+J1TVAla7CVhCTws7v1q2 giJJlIBrHBHh7S0z7Sr79RPy2cxrMHs= Received: from relay2.suse.de (unknown [195.135.221.27]) by mx2.suse.de (Postfix) with ESMTP id 12785B05C; Tue, 11 May 2021 11:35:23 +0000 (UTC) Date: Tue, 11 May 2021 13:35:21 +0200 From: Petr Mladek To: Stephen Boyd Cc: Andrew Morton , linux-kernel@vger.kernel.org, Jiri Olsa , Alexei Starovoitov , Jessica Yu , Evan Green , Hsin-Yi Wang , Steven Rostedt , Sergey Senozhatsky , Andy Shevchenko , Rasmus Villemoes , linux-doc@vger.kernel.org, Matthew Wilcox Subject: Re: [PATCH v6 05/13] module: Add printk formats to add module build ID to stacktraces Message-ID: References: <20210511003845.2429846-1-swboyd@chromium.org> <20210511003845.2429846-6-swboyd@chromium.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20210511003845.2429846-6-swboyd@chromium.org> Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.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 > #include > +#include > #include > #include > #include > @@ -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 Best Regards, Petr