From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 87FD9C433F5 for ; Wed, 9 Feb 2022 23:02:37 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S236958AbiBIXCd (ORCPT ); Wed, 9 Feb 2022 18:02:33 -0500 Received: from gmail-smtp-in.l.google.com ([23.128.96.19]:53740 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S236886AbiBIXCX (ORCPT ); Wed, 9 Feb 2022 18:02:23 -0500 Received: from bombadil.infradead.org (bombadil.infradead.org [IPv6:2607:7c80:54:e::133]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 71982C0302D7 for ; Wed, 9 Feb 2022 15:02:25 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=bombadil.20210309; h=Sender:In-Reply-To:Content-Type: MIME-Version:References:Message-ID:Subject:Cc:To:From:Date:Reply-To: Content-Transfer-Encoding:Content-ID:Content-Description; bh=EhkMnswuaL4sL/SMOM6zzAjgMyXYRzGf0cCGaPp86to=; b=ZP4VvJJyFFRdDuI4A20xKjwyK9 oNK2RILfVvVTJJFPVmsMlGxKVz5Npyns1O1VqFKTyZQb5SiBufHOKWKlMK0dN+mthGrjQqtt+rsde Eg7RruNFjq3flRI7HSrDkBkO942InE8BitV91uoNATJYS2mJv9QOaJsiwzA0Nbess1hdiSZzxAGsv PWolH3gONGAtKMhYngHOtTGQ+a07WMT+9EJQGQ0FpR/hVlhm/WYAYaDQliIL4bxwcxijA2XbhS4r/ BU9RsrNTeFw8MbjkSgI5HejXoWClKAVlRyjvWBZzTWEkgZKeEUYBCcURbyx2G9c6Bs6zNm5Dg+J/r f4/rZ1oA==; Received: from mcgrof by bombadil.infradead.org with local (Exim 4.94.2 #2 (Red Hat Linux)) id 1nHvyQ-00212U-Ny; Wed, 09 Feb 2022 23:02:06 +0000 Date: Wed, 9 Feb 2022 15:02:06 -0800 From: Luis Chamberlain To: Petr Mladek , Vimal Agrawal Cc: Maninder Singh , rostedt@goodmis.org, senozhatsky@chromium.org, andriy.shevchenko@linux.intel.com, linux@rasmusvillemoes.dk, akpm@linux-foundation.org, wangkefeng.wang@huawei.com, mbenes@suse.cz, swboyd@chromium.org, ojeda@kernel.org, linux-kernel@vger.kernel.org, will@kernel.org, catalin.marinas@arm.com, Vaneet Narang , Aaron Tomlin Subject: Re: [PATCH 1/1] kallsyms: print module name in %ps/S case when KALLSYMS is disabled Message-ID: References: <20220201040044.1528568-1-maninder1.s@samsung.com> <20220209114038.GA8279@pathway.suse.cz> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20220209114038.GA8279@pathway.suse.cz> Sender: Luis Chamberlain Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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