Received: by 2002:a17:90a:9103:0:0:0:0 with SMTP id k3csp11814603pjo; Thu, 2 Jan 2020 14:45:22 -0800 (PST) X-Google-Smtp-Source: APXvYqzPYTrHtCXscexdSBLFc0K6ibty8aTUglB6jwwepv3ajIaCip1GuXCHMm6sLWR2MQ5Kc4W6 X-Received: by 2002:a05:6830:13da:: with SMTP id e26mr21596886otq.302.1578005122719; Thu, 02 Jan 2020 14:45:22 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1578005122; cv=none; d=google.com; s=arc-20160816; b=0pmjkqIkfIUAzDmHPUx7SK27YeJjUsJZ6XxRkc4JUbp91tOCWaYQOwDvxpb4E0Dxtm jAn4On4i/FEpDQLSn3HY5zPXVdWLoIX8JPX5BcrgOUtNKgEn32Ows0YsOnW7lHSuxY85 EP+bXQBVBxClvqWUV7lq0eEsf8LlzIJ00+fvt108IyNMFa0fW6d3cW41jFxblGduLivW yXQjL/d5wNpcElksSqmSFEPAfHbV1g/V9DL0fNQPUYnLXbtIKktdSIuM5ZRQVTo4yu6U ltPQ65uaJY6f1xFj5erTBCYnxk8SZ4b7zQ+LmqCEOXOgOJv5Tujha0GKmL7+HVPd7KNa IDhQ== 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=SBb2NgShbGfvIpt5okNyqin7xxCKw5Oej9Apai0GwcA=; b=kI4vdghAfNo7YrBdecTCaM7vFczk1DV6DluyeUV0wCjTx5b9H85PMOn2NjUTwaEPN+ rSUksDoCP6S0uFqTTi3y/fZJvkmLFuek2FUYs3hVpdgUDD05bzfGZOy4r/zsv/zJ/KB+ 4snuJHjylh91u+J+NhKwVIBohzJaJwtBsa8wC7YuC1CjBorojr8NVF7oWpgqHiNeZGxU SVAh+jR/L7ouCv5bIZCNxAaa1F9G9ucOlkD9FXabehM7Bue4a8IybJY030Q1GWPDKTzb /1hHDtrpFBoE7CS+cVpoaGhG0WcIYNwiEcDHWiJ5eMsHfNgod4OQpIVqmyzznTnYciuu mn5A== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=zhoGM7Ag; 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 p21si32994651otr.58.2020.01.02.14.45.10; Thu, 02 Jan 2020 14:45:22 -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=zhoGM7Ag; 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 S1731224AbgABWnA (ORCPT + 99 others); Thu, 2 Jan 2020 17:43:00 -0500 Received: from mail.kernel.org ([198.145.29.99]:45018 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1729062AbgABWfW (ORCPT ); Thu, 2 Jan 2020 17:35:22 -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 C604E20863; Thu, 2 Jan 2020 22:35:20 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1578004521; bh=Nv6XiNZITsliWRdQc4rFMkKdM/QxaNweNuuNEPunRHs=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=zhoGM7Ag8hrW6Dk2lYXOCsF4UbbS8yLhf50+DwSo2SStEv5eI0FGY/ESftwiQub8O Fx2oqZumkOpFagQVwXuIFbufHVNr+7pT6XkqxhXfcdPiE80R0eFLnFmq7EdNT1zIf5 op3A3t3oMwDmqOh9VI/ReZsUCjY+7yeeR5qTMKbg= 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 042/137] perf probe: Fix to show ranges of variables in functions without entry_pc Date: Thu, 2 Jan 2020 23:06:55 +0100 Message-Id: <20200102220552.279420485@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 af04dd2f8ebaa8fbd46f698714acbf43da14da45 ] Fix to show ranges of variables (--range and --vars option) in functions which DIE has only ranges but no entry_pc attribute. Without this fix: # perf probe --range -V clear_tasks_mm_cpumask Available variables at clear_tasks_mm_cpumask @ (No matched variables) With this fix: # perf probe --range -V clear_tasks_mm_cpumask Available variables at clear_tasks_mm_cpumask @ [VAL] int cpu @ Committer testing: Before: [root@quaco ~]# perf probe --range -V clear_tasks_mm_cpumask Available variables at clear_tasks_mm_cpumask @ (No matched variables) [root@quaco ~]# After: [root@quaco ~]# perf probe --range -V clear_tasks_mm_cpumask Available variables at clear_tasks_mm_cpumask @ [VAL] int cpu @ [root@quaco ~]# Using it: [root@quaco ~]# perf probe clear_tasks_mm_cpumask cpu Added new event: probe:clear_tasks_mm_cpumask (on clear_tasks_mm_cpumask with cpu) You can now use it in all perf tools, such as: perf record -e probe:clear_tasks_mm_cpumask -aR sleep 1 [root@quaco ~]# perf probe -l probe:clear_tasks_mm_cpumask (on clear_tasks_mm_cpumask@kernel/cpu.c with cpu) [root@quaco ~]# [root@quaco ~]# perf trace -e probe:*cpumask ^C[root@quaco ~]# Fixes: 349e8d261131 ("perf probe: Add --range option to show a variable's location range") Signed-off-by: Masami Hiramatsu Tested-by: Arnaldo Carvalho de Melo Cc: Jiri Olsa Cc: Namhyung Kim Link: http://lore.kernel.org/lkml/157199323018.8075.8179744380479673672.stgit@devnote2 Signed-off-by: Arnaldo Carvalho de Melo Signed-off-by: Sasha Levin --- tools/perf/util/dwarf-aux.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/tools/perf/util/dwarf-aux.c b/tools/perf/util/dwarf-aux.c index ef6fa620a426..ed7777ed4d38 100644 --- a/tools/perf/util/dwarf-aux.c +++ b/tools/perf/util/dwarf-aux.c @@ -989,7 +989,7 @@ static int die_get_var_innermost_scope(Dwarf_Die *sp_die, Dwarf_Die *vr_die, bool first = true; const char *name; - ret = dwarf_entrypc(sp_die, &entry); + ret = die_entrypc(sp_die, &entry); if (ret) return ret; @@ -1050,7 +1050,7 @@ int die_get_var_range(Dwarf_Die *sp_die, Dwarf_Die *vr_die, struct strbuf *buf) bool first = true; const char *name; - ret = dwarf_entrypc(sp_die, &entry); + ret = die_entrypc(sp_die, &entry); if (ret) return ret; -- 2.20.1