Received: by 2002:a17:90a:9103:0:0:0:0 with SMTP id k3csp11818402pjo; Thu, 2 Jan 2020 14:49:42 -0800 (PST) X-Google-Smtp-Source: APXvYqxFtJJCvK3xpg/Oh/zwnqromSyuwlMonAFYOn6+JaNAHlpF/hCSftRa7CN3wLwcqnnQPHan X-Received: by 2002:a9d:6a5a:: with SMTP id h26mr97083316otn.103.1578005382371; Thu, 02 Jan 2020 14:49:42 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1578005382; cv=none; d=google.com; s=arc-20160816; b=nRoRE9IjuOTlIi6KSu7y3bBNP8cYREl/K5UQDZkDRBD1zsQs8QWrPuQYXBpXPhQqUC NjiSC2ofqBEcHBC27HlqWcCAqukRHrT6GnqMqTLsvfoxsJ62VxbrRmU/AA8pOPFL8nEk cISfYP+WsdWw1F7DIvK4ukL6feqtfZo+LtiwdGOFQ5lNvxIFKfDxIelA6SrIyENPAJny 4/x7wuCHRbkNLinu44lFitXG9KAbKVN4j/9N6T2P8M1CLO+SIucZyAzo1y/4vtDz5BpM o+Hx4r+DS31lAW+pfBiblgLxzGW+y1gtlIghrZd1SUmZBpqktBv8Qss9oZwL23tmCFw+ PTYw== 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=uFFuMsdqVFiabT+P4gjU2DxYDcDpVxYVSkeJ2uyLw4I=; b=fd+P4w27y2uDWxk2XEa1Xw56uzpPx/qMBcn/TwNFflWKfi/PIOR1vROexX3f+74gzC dazZbb9+z5dy/uTkuN0uOlQPoK3pVV69yEFl+w+Anh+rsipBswCVReIGr3sEfAQqdni8 ClKWbRZJqyU9ZDmClM8f19qYukZfkbQaoI8m8OLmXdakPfGleB5mjcLvB1eXXoOq6n9m apkwYWeixNPCM8ms3IK17XQIFw1q1jdZflTEu2wMWdgWW1sd1CABPJxak00/m3OAY1qc LjDu4hQTMzrlxFpWySy4yfEiZdjImuf7Qij2EZuXlRdaO8V38sCDJM3zNLjM8WlspDbp ak2w== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b="zfCYZc/8"; 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 i15si28031996otk.120.2020.01.02.14.49.31; Thu, 02 Jan 2020 14:49:42 -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="zfCYZc/8"; 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 S1727267AbgABW3E (ORCPT + 99 others); Thu, 2 Jan 2020 17:29:04 -0500 Received: from mail.kernel.org ([198.145.29.99]:59540 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1729974AbgABW3B (ORCPT ); Thu, 2 Jan 2020 17:29:01 -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 4B22020866; Thu, 2 Jan 2020 22:29:00 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1578004140; bh=TUW1YUbnK5ZSP11+qLepT2hjKbi/LiZ7AI04j4Z73qE=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=zfCYZc/8msMk0WymClp9NY0npQFoPrhNbjZARENCEaW2DtBJMktSKshv5eFdTXyNx IloDXJH2TqeoH6kmsnVPT0ginZNbFG8PPvr0H7WVpv/HpE/XPM+fHIJUKYj59UQXiz O1md5ZXG+TnXamxP26CqoX8aiZHzVPqarsPHKu1A= 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.9 055/171] perf probe: Fix to show inlined function callsite without entry_pc Date: Thu, 2 Jan 2020 23:06:26 +0100 Message-Id: <20200102220554.607955684@linuxfoundation.org> X-Mailer: git-send-email 2.24.1 In-Reply-To: <20200102220546.960200039@linuxfoundation.org> References: <20200102220546.960200039@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 18e21eb671dc87a4f0546ba505a89ea93598a634 ] Fix 'perf probe --line' option to show inlined function callsite lines even if the function DIE has only ranges. Without this: # perf probe -L amd_put_event_constraints ... 2 { 3 if (amd_has_nb(cpuc) && amd_is_nb_event(&event->hw)) __amd_put_nb_event_constraints(cpuc, event); 5 } With this patch: # perf probe -L amd_put_event_constraints ... 2 { 3 if (amd_has_nb(cpuc) && amd_is_nb_event(&event->hw)) 4 __amd_put_nb_event_constraints(cpuc, event); 5 } Committer testing: Before: [root@quaco ~]# perf probe -L amd_put_event_constraints 0 static void amd_put_event_constraints(struct cpu_hw_events *cpuc, struct perf_event *event) 2 { 3 if (amd_has_nb(cpuc) && amd_is_nb_event(&event->hw)) __amd_put_nb_event_constraints(cpuc, event); 5 } PMU_FORMAT_ATTR(event, "config:0-7,32-35"); PMU_FORMAT_ATTR(umask, "config:8-15" ); [root@quaco ~]# After: [root@quaco ~]# perf probe -L amd_put_event_constraints 0 static void amd_put_event_constraints(struct cpu_hw_events *cpuc, struct perf_event *event) 2 { 3 if (amd_has_nb(cpuc) && amd_is_nb_event(&event->hw)) 4 __amd_put_nb_event_constraints(cpuc, event); 5 } PMU_FORMAT_ATTR(event, "config:0-7,32-35"); PMU_FORMAT_ATTR(umask, "config:8-15" ); [root@quaco ~]# perf probe amd_put_event_constraints:4 Added new event: probe:amd_put_event_constraints (on amd_put_event_constraints:4) You can now use it in all perf tools, such as: perf record -e probe:amd_put_event_constraints -aR sleep 1 [root@quaco ~]# [root@quaco ~]# perf probe -l probe:amd_put_event_constraints (on amd_put_event_constraints:4@arch/x86/events/amd/core.c) probe:clear_tasks_mm_cpumask (on clear_tasks_mm_cpumask@kernel/cpu.c) [root@quaco ~]# Using it: [root@quaco ~]# perf trace -e probe:* ^C[root@quaco ~]# Ok, Intel system here... :-) Fixes: 4cc9cec636e7 ("perf probe: Introduce lines walker interface") Signed-off-by: Masami Hiramatsu Tested-by: Arnaldo Carvalho de Melo Cc: Jiri Olsa Cc: Namhyung Kim Link: http://lore.kernel.org/lkml/157199322107.8075.12659099000567865708.stgit@devnote2 Signed-off-by: Arnaldo Carvalho de Melo Signed-off-by: Sasha Levin --- tools/perf/util/dwarf-aux.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tools/perf/util/dwarf-aux.c b/tools/perf/util/dwarf-aux.c index 574ba3ac4fba..3aea343c7179 100644 --- a/tools/perf/util/dwarf-aux.c +++ b/tools/perf/util/dwarf-aux.c @@ -683,7 +683,7 @@ static int __die_walk_funclines_cb(Dwarf_Die *in_die, void *data) if (dwarf_tag(in_die) == DW_TAG_inlined_subroutine) { fname = die_get_call_file(in_die); lineno = die_get_call_lineno(in_die); - if (fname && lineno > 0 && dwarf_entrypc(in_die, &addr) == 0) { + if (fname && lineno > 0 && die_entrypc(in_die, &addr) == 0) { lw->retval = lw->callback(fname, lineno, addr, lw->data); if (lw->retval != 0) return DIE_FIND_CB_END; -- 2.20.1