Received: by 2002:a25:8b91:0:0:0:0:0 with SMTP id j17csp13349980ybl; Sun, 29 Dec 2019 09:52:30 -0800 (PST) X-Google-Smtp-Source: APXvYqwJR3gtcUr+U/ED7ywIxph18yzEYua/hTrFFuoh9kXmtTdVFSJFayKYWnlCtzsL6vKdW0pd X-Received: by 2002:a05:6830:1d6a:: with SMTP id l10mr71569937oti.233.1577641950522; Sun, 29 Dec 2019 09:52:30 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1577641950; cv=none; d=google.com; s=arc-20160816; b=gL/OdD+bPIJZ4TedBvO7GtQ9gX/58lsg88bz+zY3z+U5T01YKg1fNhjhY4dfGYSyf1 XcPnmR2eV6z26e8n8gwbY0/4SDvjtoY9HI9hTRsBk1LHNjy/Cjq00bK8dDnYeRcNfupQ 1ZxPxzI78bAiwBEueAe5It0OfwLzN51kh2xVyyF+bJJN/yP6E81xHmQaMQpe4nUOY3r6 pXLzHA3P44XrrxUFGrTnVNZvliyg3lDvE0RI/6H4tEdpmf7JT4OhIl6/vC97guGu67yu AQk8unnQVRR6uBSuv1G/fJzOik+mtOYpoHY1Sfl91aRvMryyCzDVqRccFCBcor53vBBw 41ZQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=UWGBFWn3S6e+GTYNykDlDd76JczJ7O2ScO9GfzYeHVs=; b=lWDPqybSRsEauqXJVCwTqluC4/qQ2EuFys3kMmq5FgLvlFNPn7Eq6i6cSgcgueWj// ot1L/SMNO7QaR+2QpLpGM5MQaKNiToJeO3AcmE3106PcPd7K1a2mSmwkEhl0zLeHIo3A OB+Bapc+lL6GKck7ohHDoaqpff8+lkdqbnp3uzVMxmdrxp/S3xgvgDGnfWTpZEFc5831 uoqDbEI+vk0dZjDm1kRcflGSrGXr9RnKo2U/9pNZsCTaFhjyv/cFcW9vqlaU2mEVVeVx rWBrOdPO5PfJENMXIXcDlISohYPaUNR7kF+/ibr6jQ6W59iiRuKwEUfxKHoZQ4I9L6hi MpHA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=oqKfn+dx; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id m18si18547935otq.72.2019.12.29.09.52.19; Sun, 29 Dec 2019 09:52:30 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=oqKfn+dx; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1732059AbfL2RvT (ORCPT + 99 others); Sun, 29 Dec 2019 12:51:19 -0500 Received: from mail.kernel.org ([198.145.29.99]:36370 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1732044AbfL2RvO (ORCPT ); Sun, 29 Dec 2019 12:51:14 -0500 Received: from localhost (83-86-89-107.cable.dynamic.v4.ziggo.nl [83.86.89.107]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 40AA8207FD; Sun, 29 Dec 2019 17:51:13 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1577641873; bh=8PUwx2HjpsbnxcQYYBiZXa9T/rE5w9D0hPa3UvgDYF8=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=oqKfn+dx4nsuVFmNNZG5qHrQT47AEvFkGiz/dPwebd2Bd6NGD3ZFPrqwwNGe8+a9Q Owoih8aB6demDOS77dQV3ykXl/aUlqN8YQOntQnHqRhaaDgo0aezlPBM+Pk9Pi40Cp Z+A9r6dgSn6qrJDAF19NkbVUX6Osvc/FxyqHo66w= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Masami Hiramatsu , Arnaldo Carvalho de Melo , Jiri Olsa , Namhyung Kim , Sasha Levin Subject: [PATCH 5.4 248/434] perf probe: Fix to probe an inline function which has no entry pc Date: Sun, 29 Dec 2019 18:25:01 +0100 Message-Id: <20191229172718.360610159@linuxfoundation.org> X-Mailer: git-send-email 2.24.1 In-Reply-To: <20191229172702.393141737@linuxfoundation.org> References: <20191229172702.393141737@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Masami Hiramatsu [ Upstream commit eb6933b29d20bf2c3053883d409a53f462c1a3ac ] Fix perf probe to probe an inlne function which has no entry pc or low pc but only has ranges attribute. This seems very rare case, but I could find a few examples, as same as probe_point_search_cb(), use die_entrypc() to get the entry address in probe_point_inline_cb() too. Without this patch: # perf probe -D __amd_put_nb_event_constraints Failed to get entry address of __amd_put_nb_event_constraints. Probe point '__amd_put_nb_event_constraints' not found. Error: Failed to add events. With this patch: # perf probe -D __amd_put_nb_event_constraints p:probe/__amd_put_nb_event_constraints amd_put_event_constraints+43 Committer testing: Before: [root@quaco ~]# perf probe -D __amd_put_nb_event_constraints Failed to get entry address of __amd_put_nb_event_constraints. Probe point '__amd_put_nb_event_constraints' not found. Error: Failed to add events. [root@quaco ~]# After: [root@quaco ~]# perf probe -D __amd_put_nb_event_constraints p:probe/__amd_put_nb_event_constraints _text+33789 [root@quaco ~]# Fixes: 4ea42b181434 ("perf: Add perf probe subcommand, a kprobe-event setup helper") Signed-off-by: Masami Hiramatsu Tested-by: Arnaldo Carvalho de Melo Cc: Jiri Olsa Cc: Namhyung Kim Link: http://lore.kernel.org/lkml/157199320336.8075.16189530425277588587.stgit@devnote2 Signed-off-by: Arnaldo Carvalho de Melo Signed-off-by: Sasha Levin --- tools/perf/util/probe-finder.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tools/perf/util/probe-finder.c b/tools/perf/util/probe-finder.c index 7c8d30fb2b99..7857ae7a10b7 100644 --- a/tools/perf/util/probe-finder.c +++ b/tools/perf/util/probe-finder.c @@ -942,7 +942,7 @@ static int probe_point_inline_cb(Dwarf_Die *in_die, void *data) ret = find_probe_point_lazy(in_die, pf); else { /* Get probe address */ - if (dwarf_entrypc(in_die, &addr) != 0) { + if (die_entrypc(in_die, &addr) != 0) { pr_warning("Failed to get entry address of %s.\n", dwarf_diename(in_die)); return -ENOENT; -- 2.20.1