Received: by 2002:a25:8b91:0:0:0:0:0 with SMTP id j17csp13386406ybl; Sun, 29 Dec 2019 10:38:25 -0800 (PST) X-Google-Smtp-Source: APXvYqxdcIsrbuFS8aDCounasI2Owruid4baAykiL+MwdBewV0wgjPIh8Ftfi3CVx9PAlr4OusAA X-Received: by 2002:a9d:7586:: with SMTP id s6mr69240392otk.342.1577644705783; Sun, 29 Dec 2019 10:38:25 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1577644705; cv=none; d=google.com; s=arc-20160816; b=frR3IW8DPHxxefjyfB7GJnFmA3N+5ZaJkVxW4bbeq3BOK04onbS5BKcdjypez4Kv1u nZF2yIGr49jMpmU3rAxbixjZh+ttTzkoIo6woRglER8j9la0gGoYYADZpk5UjvqiVCPm MmyOSB8jr+/IJW81MYs7OsXtDzjTJE8+69sS80JmiUb6ehoI2f2p1JLiRgG/NWa2/8Q9 F++hMXiOiEwSkUmN6R4vZ/l3qy/PSBQjU2i34OEQVF21dvt4R4BWvrGWh6OYegNEgnPt cfP1TVFpoShJFmQz2DQArV5JVBwoHRP3+Gjs7zoLaZgjsYMo8o9aNJRS6QYpYlP3C6rd J3mg== 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=afO1VWI6XNuOla2g9eUhcyDTk4IGVprUFEeftYUpQDA=; b=F2iDi3+WqiIROdVoyVToIubwzWpw+NnpwQaTa4re6RlMiGGaq0lTtjg3wXxNfp1lQz G8csVtnjgpjPty09xPYPwC9nwjsOm5dRN4vYASTof/Ts6ZKwgtndZYc9jHZTzAcRqfqk mRDSyPrERA2CKCCZAPhyRUS5dQJCdfJnR5imaReAk4whdQWWUxgpjPtr1nd2VjJi329/ FR09zDBd5aAHuDWSoBRis2l6tVfu6xCWtDQ6Wi/MsbX9XzYwJKgiUrs/BGjNbI4RjcND 6Zkof43byjELWFvE/RJb5oWc4AO3HoFhlWkvSM1p4gw+sv+cIMEN4AYOthd+VIZqHgDz e6KQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=2lTBE7Nm; 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 v1si21702015otf.161.2019.12.29.10.38.14; Sun, 29 Dec 2019 10:38:25 -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=2lTBE7Nm; 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 S1727820AbfL2RYw (ORCPT + 99 others); Sun, 29 Dec 2019 12:24:52 -0500 Received: from mail.kernel.org ([198.145.29.99]:43922 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727814AbfL2RYu (ORCPT ); Sun, 29 Dec 2019 12:24:50 -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 B467E21744; Sun, 29 Dec 2019 17:24:48 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1577640289; bh=CrTKOL/JK4sjKRXD6vu4PCPwRLXhxoI5TymAj38itLw=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=2lTBE7Nm5eCLCJGZQpmZC43EjPE7E/XSc8GlAFYDqvOUHsvjFWJgdeGw/rFqZT3fN HiFWjpWg7HlU+c7Pux4TeOWoPUtH3T6DDZIKq0LymCVgb6sFYdrGW4QclproCRZEhE wa6BS8dPj3cswCEIGoHA3n4qQ4DW4naR5eSwFq7A= 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.14 097/161] perf probe: Fix to show inlined function callsite without entry_pc Date: Sun, 29 Dec 2019 18:19:05 +0100 Message-Id: <20191229162426.644909354@linuxfoundation.org> X-Mailer: git-send-email 2.24.1 In-Reply-To: <20191229162355.500086350@linuxfoundation.org> References: <20191229162355.500086350@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 21c2ed42ad6b..0a5de865563c 100644 --- a/tools/perf/util/dwarf-aux.c +++ b/tools/perf/util/dwarf-aux.c @@ -686,7 +686,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