Received: by 2002:a05:7412:8d08:b0:f9:2d0a:d759 with SMTP id bj8csp11129rdb; Sat, 16 Dec 2023 23:18:14 -0800 (PST) X-Google-Smtp-Source: AGHT+IG0O51LI+uz2IXnVylQxuHRjqsa29mlMSMAPBspXsA55bFbao3VrWFEJEWpH4xY1uid+FH4 X-Received: by 2002:a0c:d848:0:b0:67a:b71d:4d8f with SMTP id i8-20020a0cd848000000b0067ab71d4d8fmr12455088qvj.31.1702797493802; Sat, 16 Dec 2023 23:18:13 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1702797493; cv=none; d=google.com; s=arc-20160816; b=RbChg9xKZwly5PVf/JcQdsQ/Y5IUoT8h4q43bVLN8Ja+qy1hKJXYVdh200oPXy4qVh z0IN+hgJh9wm8ojei5peZoWYoQzoyQan3uXLIcziOjm8FaFb5ERZPjtpsTIgpf6IbRww d3gRInnVKb77FhrUb1kFUDh0+vRM/vwUbzTKb7+x4QuoOyp9mBbYpLdQKVNGqwQYE6rq ONvOQYPH/ZAyEt0ldsCcxWi4jx0v0BbpoaN6mxzSxp3mBjVkntRe2cOA9mahOuiWQlsd b5dTLaxx4gegBBs3ggchCD/mcdB6g+XgOFtOt2JInqr7dhR4CrO0atkkjU9M15GreCfq JUkQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:references:in-reply-to:message-id :subject:cc:to:from:date:dkim-signature; bh=mMh3aLLQZ9OyEehsgcRZjwaGihG6hCvXO2NO1EW2zeY=; fh=K2O3G65ILcIrw4YKhFEPyjfURq2dw0pJF1n7t8IOkEY=; b=PBipdyknXmDU+Acfu/ZWd9QxVj6qb12DjG8Q0MdNaR3Ci05jeWE2Zuxgp0YWyas15r kWpQrzBfxt6p3mrN89SuY/sUbIgWJNaSwjYK8jGqy9CdMCy6t+fLQAnbJ5UKWzO9Ioe1 /pMurmcHqAHNK+J5PnojAZDw5ouvA8kyG78PazUZx/QjKu/Ns69kVpT68LE1U+H3yyfn kSPSjispcJLA4yjkibwcMZNTRJPy01jhgEoZ5z2PqZuwW5jQkj09zQa6CsepU4cHH95N veq+R06mFNJhhp3RdoEFcYJJIAnuwKcrVVJd9v6x+GsLQvnitag4FnaH6H9E2CPbdwxn ffOA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=s2ERO6rX; spf=pass (google.com: domain of linux-kernel+bounces-2495-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) smtp.mailfrom="linux-kernel+bounces-2495-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from ny.mirrors.kernel.org (ny.mirrors.kernel.org. [147.75.199.223]) by mx.google.com with ESMTPS id mg20-20020a056214561400b0067a1a581179si21623767qvb.585.2023.12.16.23.18.13 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 16 Dec 2023 23:18:13 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-2495-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) client-ip=147.75.199.223; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=s2ERO6rX; spf=pass (google.com: domain of linux-kernel+bounces-2495-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) smtp.mailfrom="linux-kernel+bounces-2495-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ny.mirrors.kernel.org (Postfix) with ESMTPS id 717B11C2190B for ; Sun, 17 Dec 2023 07:18:13 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 46B221863; Sun, 17 Dec 2023 07:18:07 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="s2ERO6rX" X-Original-To: linux-kernel@vger.kernel.org Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 47C771849; Sun, 17 Dec 2023 07:18:05 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id EBCC2C433C7; Sun, 17 Dec 2023 07:18:03 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1702797485; bh=X6xpH21gdd4WYGs0usyDoYV2mF1KI4snptAZ8ED9dFE=; h=Date:From:To:Cc:Subject:In-Reply-To:References:From; b=s2ERO6rXkv/Uv6ozdFecOVOeBxANLoarwv9SEJiOWQ8ij0sBCfRLfAK0JFBkzP1XR 1vwvW+ZjGdGd+YP3KcFWSnZQtSlTIejbmp+oDyCbgcM/SXaRe2HOPysgA3bsLabTxx 1TyruoFuNkv3zOIHSBkz/o339La5elklUJckzjxAVOr+O0FJuAj0+LK/O684PkWhYi Un+7DCss85FydP2Kex1HmSFFOw1YzCP8szf5OZejs3TGF30BFQPLsLg/2cyzel6R4H MrvA7wXSjB40LQeSJf5Il8piTtHeMAmCGtFjpjAcM74ZK871MUSpgRwQSmBtLxqHih DA7rUuk5EKC9w== Date: Sun, 17 Dec 2023 16:18:01 +0900 From: Masami Hiramatsu (Google) To: Naveen N Rao Cc: , , Steven Rostedt , Masami Hiramatsu , Srikar Dronamraju Subject: Re: [PATCH v4] trace/kprobe: Display the actual notrace function when rejecting a probe Message-Id: <20231217161801.ec0121c047c163a772cfce1c@kernel.org> In-Reply-To: <20231214051702.1687300-1-naveen@kernel.org> References: <20231214051702.1687300-1-naveen@kernel.org> X-Mailer: Sylpheed 3.7.0 (GTK+ 2.24.33; x86_64-pc-linux-gnu) Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit On Thu, 14 Dec 2023 10:47:02 +0530 Naveen N Rao wrote: > Trying to probe update_sd_lb_stats() using perf results in the below > message in the kernel log: > trace_kprobe: Could not probe notrace function _text > > This is because 'perf probe' specifies the kprobe location as an offset > from '_text': > $ sudo perf probe -D update_sd_lb_stats > p:probe/update_sd_lb_stats _text+1830728 > > However, the error message is misleading and doesn't help convey the > actual notrace function that is being probed. Fix this by looking up the > actual function name that is being probed. With this fix, we now get the > below message in the kernel log: > trace_kprobe: Could not probe notrace function update_sd_lb_stats.constprop.0 > OK, this looks good to me. let me pick this. Thank you! > Signed-off-by: Naveen N Rao > --- > v4: Use printk format specifier %ps with probe address to lookup the > symbol, as suggested by Masami. > > kernel/trace/trace_kprobe.c | 4 ++-- > 1 file changed, 2 insertions(+), 2 deletions(-) > > diff --git a/kernel/trace/trace_kprobe.c b/kernel/trace/trace_kprobe.c > index 3d7a180a8427..0017404d6e8d 100644 > --- a/kernel/trace/trace_kprobe.c > +++ b/kernel/trace/trace_kprobe.c > @@ -487,8 +487,8 @@ static int __register_trace_kprobe(struct trace_kprobe *tk) > return -EINVAL; > > if (within_notrace_func(tk)) { > - pr_warn("Could not probe notrace function %s\n", > - trace_kprobe_symbol(tk)); > + pr_warn("Could not probe notrace function %ps\n", > + (void *)trace_kprobe_address(tk)); > return -EINVAL; > } > > > base-commit: 4758560fa268cecfa1144f015aa9f2525d164b7e > -- > 2.43.0 > -- Masami Hiramatsu (Google)