Received: by 2002:a05:6a10:1a4d:0:0:0:0 with SMTP id nk13csp2293966pxb; Wed, 9 Feb 2022 15:23:47 -0800 (PST) X-Google-Smtp-Source: ABdhPJzWKMFRDObAeWN+QgfHtmWliucpIYBt19nVMSp4OOSQoClrU5M5hSQxCoWKPev4AORLzHwY X-Received: by 2002:a17:90b:707:: with SMTP id s7mr5218738pjz.99.1644449027627; Wed, 09 Feb 2022 15:23:47 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1644449027; cv=none; d=google.com; s=arc-20160816; b=hZfytl8k8mzWJmcFrJRkk19Vb6jljZ0lja8zUd2uMvjXuaq0HkaQUGhAp2+LDU1L20 N2s8B/DHbKOwJB7/I7I8VkY45GX/02z2kwLR8pr7/T1wBmcWu+m5w0gbGLtF1I+F2BL7 xTCa9LxJ4o5tM7catiIG1pFKfWFULGwUguvWFjsbUqamNmZ/O6FNINHR/9m7LA1HWFPQ 4faWFGlJS+8atB0in4KUCCLKW99g26+sv2AN/B7nU5ZllpnznDWYflt5wGeKZSq+0fF9 w7U+ILoinfX6H8dRea+aXB48vopdAThsz1nLRKp9sV3rs8JonCa3GC9tGuNgM73Wdrae GBmA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:in-reply-to:content-disposition :mime-version:references:message-id:subject:cc:to:from:date :dkim-signature; bh=EhkMnswuaL4sL/SMOM6zzAjgMyXYRzGf0cCGaPp86to=; b=VPne+YyM/lLXgWGYj68XI3pNn7V9ArfFeQ1OwqiUNzIKvP86QjiCJRtiaUheQj7xO4 to7yVeYkGM8ZJmTrw56FrAwRVJknB094YJaFsLFdKHgWwS4q6yTPeg26HTXD+oMqTRBM qNCdFJH/tcwFh8tvLxIXiwgwuusnWFrlKkcZnnZj6H6C1z3B6SwLKphTxlSvP5WC0Mke iJORh+aDWOIushu/ej5MvcNqFPB3gWx969wPC8xHuPcjRcj+7zPjGqzOF2+0YG1xKm++ lcHhR+Rb1WRHykJ/FG56HOIioVw7fCBpirDxjhjzg2zVOiPUuG6NBUmmouU5yw4AlduJ MrdA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@infradead.org header.s=bombadil.20210309 header.b=ZP4VvJJy; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from lindbergh.monkeyblade.net (lindbergh.monkeyblade.net. [2620:137:e000::1:18]) by mx.google.com with ESMTPS id y14si296914pll.426.2022.02.09.15.23.47 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 09 Feb 2022 15:23:47 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:18 as permitted sender) client-ip=2620:137:e000::1:18; Authentication-Results: mx.google.com; dkim=pass header.i=@infradead.org header.s=bombadil.20210309 header.b=ZP4VvJJy; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id 1468BE063177; Wed, 9 Feb 2022 15:19:05 -0800 (PST) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S236914AbiBIXCc (ORCPT + 99 others); Wed, 9 Feb 2022 18:02:32 -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 X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,MAILING_LIST_MULTI,RDNS_NONE,SPF_HELO_NONE, T_SCC_BODY_TEXT_LINE autolearn=no autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net 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