Received: by 2002:a17:90a:9103:0:0:0:0 with SMTP id k3csp11813936pjo; Thu, 2 Jan 2020 14:44:37 -0800 (PST) X-Google-Smtp-Source: APXvYqx6tC792b9S/eihLcE2GxgpEWXOOlnNF3F2Fufc8r3NAHjVUZuuhKEgb75oL4KkwyBaFUv4 X-Received: by 2002:a05:6830:304c:: with SMTP id p12mr64157831otr.214.1578005077257; Thu, 02 Jan 2020 14:44:37 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1578005077; cv=none; d=google.com; s=arc-20160816; b=UI08dJtA3l9oSKmj3PviR5SYk8GoSpiQKFiVHqfZ/RpRpiqxBT9++HlWksQJJYVsv7 fE3FWG14XtGyrGITCcvGB8r5xFyvPhHSExE+AIwWCFGCKJnk7hUGO0hWjhLKViNpKeHb /3OY0u+VanxdtuYo8sCtkuokqJ50ERV+z4JlbaUn/WTZxkSTV4uMkY4x+IOIhjm7IXPg tp95cmoo2Q0GdjZh8qf6DxBh4HR93+8g9v/Ntqu4vAVO/yXjPMb55Jsf1v1pxDfcL6wX LpYG3FuiCgxmVOnmR82EFai1eYxjxv2kfjzuz3Ub1zjqgo49wo04f++G4eM36jJ/swi2 KhUA== 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=K7xjp5yIpGlJ1JG1TzrX3U8e3Y+kP1/OHxDo6VE8poQ=; b=pvo3Wl0I2lwcDGqYozoZ8AO6+qXvVbwkUHohmTybt4ivkb5bOYGCxoLl0s3f4CLOnY eliPlbmLm5Ybh0H4BavyqQbv0WxC9v1U7RXS0q4T10FBoUkcSlIioMhgyJlvOpXKsFWV qmgZ9GTDKwx57k7PMfCVdTO7DMn4hCAGfMz5M42c/xN9FKrP7LwyopVo+Q3xZZ+TZhYF YD1HVWjzn8gRiRgUJqUzVjDSwHm3P7LZy8KQItXMTQh8ULyvBDL7p7vE6QbY2wGazJs9 9uoX1uuNXiA7bzB5L5gdUxxhLSSd26Nei9XqdhnOq5HPU0QSqOrtFypTalvMX0RqY3t8 ojMw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=s3fyRSMb; 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 m20si24530088otk.279.2020.01.02.14.44.25; Thu, 02 Jan 2020 14:44:37 -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=s3fyRSMb; 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 S1730837AbgABWfd (ORCPT + 99 others); Thu, 2 Jan 2020 17:35:33 -0500 Received: from mail.kernel.org ([198.145.29.99]:45148 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1730706AbgABWf0 (ORCPT ); Thu, 2 Jan 2020 17:35:26 -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 91D0B20863; Thu, 2 Jan 2020 22:35:25 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1578004526; bh=a8t8FuYO2SHNXMtQiSejOpMZB3LWTT4qrFJO7aIh7e8=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=s3fyRSMbXBeV4owZMafQ6YBrgh1nH5jxdkqH3GOQFUPWCsEXjnrBUtwpmbtHZCOKD 2pP4pg+dMf71tBfsxe0pfbSSl9GMHa1iJu+yYhnHvvYf/j1Fofop6eo7iHl+MRZie2 5kYqPorQk3hbyE61wnQsGvrEJSNmWNSk6XDGLpfI= 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.4 043/137] perf probe: Fix to show inlined function callsite without entry_pc Date: Thu, 2 Jan 2020 23:06:56 +0100 Message-Id: <20200102220552.387223309@linuxfoundation.org> X-Mailer: git-send-email 2.24.1 In-Reply-To: <20200102220546.618583146@linuxfoundation.org> References: <20200102220546.618583146@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 ed7777ed4d38..5f32fed5eeb3 100644 --- a/tools/perf/util/dwarf-aux.c +++ b/tools/perf/util/dwarf-aux.c @@ -659,7 +659,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