Received: by 2002:a25:8b91:0:0:0:0:0 with SMTP id j17csp13341182ybl; Sun, 29 Dec 2019 09:40:33 -0800 (PST) X-Google-Smtp-Source: APXvYqwr4sZuF9itFilgy5M+QjoXJwAsvp/YRi3azOzzgZRWyYKvPXSBVozh0iG5ZFV3kbxma1wP X-Received: by 2002:a9d:7593:: with SMTP id s19mr65515636otk.219.1577641233578; Sun, 29 Dec 2019 09:40:33 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1577641233; cv=none; d=google.com; s=arc-20160816; b=F6b6lao2PXczR8MlmM7D+lqKbKdIxifWglqIFjqdrOJo2rgeLuACXuHwt35jVckP2m pC87JG1KS0SeVUpW+Bse8AX3Iv1R+QALJEUrRzEkEzEG1ZPPVQPkUlUC1k82WOsU5AW0 wryZ06zLIxs4Y/NyD1Z8yEi3elgsDr3z4W1TVi92omLGvjNeCcSk8Kjou7aQxnt36QzG sHTO4B4Oq65620YjfT4+/ccqsYMz6cc0o7tg1vJL1doO+apIf2/msbLr764NYg44t/3F XXLAWTl/eWY3Z7huY4qYf00OQfeF/q6Op2NDJG2OJ79DrmUDIsrUP9cuomrcJgzANMpm cv4A== 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=gWRJm522JaBG1Jw4821my3AELC34STW4W2RbThDr03A=; b=kd/ongnTtQOB6T+8wZb0HG0FPCu0tOe84QzS+H4F1f2+JBmKzZRpxMkN4AjUn9kqpB INkdUVv7vk4dEngK15BKQ/bgBMYhIeY1hHyiE1hNRMRuGsp126FmYDMucO2WO8m4YX4D S6QIO8r8zOeIpFJXUt/CNN5qejv9ytywzSlXgXnKMxBk3xUS89We5N+hM5hxMHpTP6FT mMg6CzhZ9gT4jAb5ev+1AqDlx5jq1l9Ae3eKtGlnhw1nMOfneZ8sjn5gITxvqVWqTHpM tTVPhue9aregWwHm4VYOtoAnQOQwbqyYsEPUvgczHya//taQnQtAosI73BaFpj90aO1E CPAQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=tFRZsnUb; 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 x11si4011377oic.185.2019.12.29.09.40.22; Sun, 29 Dec 2019 09:40:33 -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=tFRZsnUb; 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 S1729400AbfL2RdK (ORCPT + 99 others); Sun, 29 Dec 2019 12:33:10 -0500 Received: from mail.kernel.org ([198.145.29.99]:34192 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728344AbfL2RdD (ORCPT ); Sun, 29 Dec 2019 12:33:03 -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 602F0207FD; Sun, 29 Dec 2019 17:33:01 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1577640781; bh=GjOvPGm6PqSGGOiu9tK8kV5MobSRSOCzbdnt+LiYdYA=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=tFRZsnUbhf26mq2wOAZbrKWxhV5aixw+roVxcAL+h/3waSbEsxEX3lx6UFMy92Ovm QgXKdcXoHv86bALM8sUcSWxb5QjkDckT0+UzDHtmtraIKk2Yi/12zDAhmz9oyCVDWl bBLtJ5kIeV+3J3GFRFLGbK9JVU593bM8N9/tudlQ= 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 129/219] perf probe: Fix to show inlined function callsite without entry_pc Date: Sun, 29 Dec 2019 18:18:51 +0100 Message-Id: <20191229162528.167195708@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 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 14a3da24a0a8..fc3f3573332d 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