Received: by 2002:a25:8b91:0:0:0:0:0 with SMTP id j17csp13336901ybl; Sun, 29 Dec 2019 09:35:05 -0800 (PST) X-Google-Smtp-Source: APXvYqwpDISuWC6f53sKqw0sZ2ZRJpQE9pSo/bu+Hfjz8FH/V8A1w3HUa70BNcZ79er16XC8wEkV X-Received: by 2002:a9d:7d99:: with SMTP id j25mr56262133otn.226.1577640905292; Sun, 29 Dec 2019 09:35:05 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1577640905; cv=none; d=google.com; s=arc-20160816; b=sR3wxLnMk2RNsuyewImE9FD6/CLbuah/Kf+rb6UVnZ51+nQHn1q1OG1YPGdZ5fBpVW bz9DRYCdnR3GRF0QvqIICXuGWGEWTMdQnnEZPCeWWqjmgj1K37xd8g91MYkIpR1lscoE GbXKA5mzz9xBDNkhBSzzMhwey60DnoZC6A75AAdem1bwUomV6WvDiGGfy4ZkAoHMlmwL 1h913DH6ibhEAKVZ4Ukme9Mc4wFit7KZTXRYdB5Khb/PgGxiczkxupji3KeCIuDTgNLs KrnkUNvIbmbUJ9WVdzmiOP729H4iJBUBd9/yyWENGbenpnJuPF6BDxIC0h9aoxnnrBIV W/Gw== 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=d/lOgSxPBbUpjdVEKP+xtzZ0Rv575lsmFa1TUcy1qGk=; b=ZmAZjPe/HAME4O4z2JXeSD9GThkqH9etjT5XHG43ojiAoRkyCOM/VKe39o8l8X8M5Q zB5xY0+NS8nmpv4JF4UmzSTMm1c//AUZFwEC0JwTA6gYThydsHpKbMnYomUV383Oxtrn zSEmn1kGPBGUB8zqDWnr+tt5md9vYSLIvwHsc8Wm1U4xMvrgluRUIQUegIiRwFhARO6A xDziFvMQVRSXNUpTFDYWxbYD4gBTSBhiUFF9apZoP9UrkLDuj+v4xRhcYrZnHRi2pWTJ 2vSOs/p/f/4SKgESbNGQcbRdHtjjE64BsQ7wsZZuIRc5azOD6a6DBa9ADVCy02Jgb04P Plhw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=QT8DOW+2; 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 z4si18642459oix.48.2019.12.29.09.34.53; Sun, 29 Dec 2019 09:35:05 -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=QT8DOW+2; 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 S1729362AbfL2Rcs (ORCPT + 99 others); Sun, 29 Dec 2019 12:32:48 -0500 Received: from mail.kernel.org ([198.145.29.99]:33528 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1729352AbfL2Rcp (ORCPT ); Sun, 29 Dec 2019 12:32:45 -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 825BE207FD; Sun, 29 Dec 2019 17:32:44 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1577640765; bh=B/hzK1s8pmZi/6DHH3MZ5L8Scvw4VTgEaRTBRdd5xF0=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=QT8DOW+2Bqx44PEKu/ra+1UQYvilpWSv6YV6ujx35o7HRdVp8YhKxG7hNbUutHvN7 Y++/7/uCsKxqp1NGCz4aFbkKPSEkQjv53cuntIlh4jCpaUFrIFIXLd/0urnRTwMRN8 Xt1t0DzF6Ogl84vsc0Vrl3MLz0X3qaByXbNAxzwM= 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 4.19 127/219] perf probe: Fix to probe an inline function which has no entry pc Date: Sun, 29 Dec 2019 18:18:49 +0100 Message-Id: <20191229162527.514542689@linuxfoundation.org> X-Mailer: git-send-email 2.24.1 In-Reply-To: <20191229162508.458551679@linuxfoundation.org> References: <20191229162508.458551679@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 c4fe0678e322..d0d333c90b35 100644 --- a/tools/perf/util/probe-finder.c +++ b/tools/perf/util/probe-finder.c @@ -950,7 +950,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