Received: by 2002:a25:8b91:0:0:0:0:0 with SMTP id j17csp13474931ybl; Sun, 29 Dec 2019 12:47:56 -0800 (PST) X-Google-Smtp-Source: APXvYqw09pHDUQ+9dQ5rzt/vteAgCHu8ay1BPfyFWYgZjT144X/QfvNctrey9Hj5sTrjFq1oPZ13 X-Received: by 2002:a9d:7f16:: with SMTP id j22mr68589798otq.256.1577652476055; Sun, 29 Dec 2019 12:47:56 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1577652476; cv=none; d=google.com; s=arc-20160816; b=vjFLxTnpAMFukn4x5LW3wFEcutYUO2pFYM5NHJA0dct7SJ4u/5sjgmGKZScrjACgQ8 ixlvQQ1yDQsCS+iqtImJ0r6hTN4EHg9VmgOBaedsqvKMxHjaKUo+/h7ocLb8bAVAxV63 d6F03M9Txs8wy7Stfrjq63cLX8DNdRGd5eJLU3zmyIIaIy3WoHu9uu7+LGkJaMN54pjx BmBC6VEU3tSVSm3AYvQ/OeoLE9XeU4qO2ehQQfbNqVDa24zFhhW2C4ygOn4y7KOcY93K oIiHVOxGNw/r18CfkXflRHPK2RCMwZGXrhTgJTG7ti7KNdpwvc0x2tKeWjFLC/+zXGW8 7pjQ== 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=ZQRlI6gCuqGLspfr4UGy2hBN9FCL6AqvGkcwKvejWow=; b=g+j3seer8J1wccCFq4fFMyqZLP/uhQJ6kUd/FCz1yBrwmDM09J5wqd2lzYVrChbxlh N/bRY4h/ZaoXwQ62ExFb43pNeuJIrfYQDxsECUNhJkEfJ7MS4jix8IMMsamGBUM/Ekpc bdd8JbPM14Reo6Nc0AGgUTskuZeicfuvU0h09Ij5rOiFt10vMSfM6bIOJJs7V3UkLmPi ocqMDKHGtRinDVqg+zDpj7PcQOPu4WrYt1FFJAhjaZVDQGJwHAvTgaEC35CN9g3oYq54 BmvHWjCuBTdOzP4OSf9PqajU7SzeW3E97v7OpXLw0TZilb8pacECXqOODIfN5M7YzOWF IfKg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b="dph/aR9k"; 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 h14si16448535oie.98.2019.12.29.12.47.45; Sun, 29 Dec 2019 12:47:56 -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="dph/aR9k"; 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 S1732076AbfL2RvY (ORCPT + 99 others); Sun, 29 Dec 2019 12:51:24 -0500 Received: from mail.kernel.org ([198.145.29.99]:36500 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1732058AbfL2RvT (ORCPT ); Sun, 29 Dec 2019 12:51:19 -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 13D6220718; Sun, 29 Dec 2019 17:51:17 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1577641878; bh=jphEfFQKijuTGRj65Je5DlIlgMQ3inR2NKTRNZ5w+bg=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=dph/aR9kmTABLKmzc9o4iyXqeZokKrMvYZ8l1bNdhDBGffQ3twAikzVZHw9CI9kw2 arJMBkkQnS+3HMh/6mnDp9PL/oc1ckqJBaN0OuF7Y1dAYmMTzxsUw8DqDLFMOoYPr3 V0tgNQOYqCCuc3/QGaql8cZgSFpuSkOuveWEWTt4= 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 250/434] perf probe: Fix to show inlined function callsite without entry_pc Date: Sun, 29 Dec 2019 18:25:03 +0100 Message-Id: <20191229172718.511624671@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 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 4b1890204e99..08aba015e072 100644 --- a/tools/perf/util/dwarf-aux.c +++ b/tools/perf/util/dwarf-aux.c @@ -673,7 +673,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