Received: by 2002:a25:8b91:0:0:0:0:0 with SMTP id j17csp13474479ybl; Sun, 29 Dec 2019 12:47:15 -0800 (PST) X-Google-Smtp-Source: APXvYqzYfoV7WyAfVjoVili9y4HCS7OxnISQpdUc4MBB8IO3fkWv2cQfBldAyHLgvEuXee62KtRi X-Received: by 2002:a9d:6f11:: with SMTP id n17mr55938715otq.126.1577652434891; Sun, 29 Dec 2019 12:47:14 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1577652434; cv=none; d=google.com; s=arc-20160816; b=Y2sUXuiULHqARsOtgOwiNfGQfx9tD91m5d2vX6Jc6XDXWP0gIrrUA3JocTNlTdcNUa TlMvWtPhSu/qf6C5O/T90kiFlriUNr7th5PIcrdaMZ84kU0Gj6hFHRJvKKGufb1AxTSR XWfDPZ2qoHKgls03Y9SzYChrp6bOIBteu+JcKnH6bRjnTAQsmulQTP2J3rQ8HzwDVzDW 8eIUWeYTMtmdMcv9e7+NZ+mNGTYXqXjEBz4cZHgNWukVz7mqYlt4FjAO6OhPGtDqTCcw vmiZ8Z2Nw5TH06s1jKWoqaC4B3QtAx2oKNbuTsGcs1QclyceeTiv1FJUS+n19D7kwzT1 VSvw== 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=z+Lx4HyKauAux/IZDRHTP2/wVxhSXf8A22YBq5pdEw0=; b=TsiKbeqklirhnOGDuv/tP8hiGpg++bSJwiaptfriPveltxkoiqkdMXd+A8hkecbjkw YhWLrsnjxp9flGywghzKm8wdvph5AVSECsh2ChjEcRhzfM666/hJJoTqoyNZbGPxkOMZ BjE+uqSMqvOmChPW5cUb/cTgVaqKIJebYb3klFrI6a4LRb3oKQ1UFaDAUUcGDcoN/ae7 nUQ7MVKTAYISRYw0rN+UIJxaGlKhjEqyvdmiuXGIQqWDxs8Yrv2yEoAg3TOAYg2EmueQ dM/GEuCHkMGNF7B2ckw3PhJMDbshf10k9JwFYlMnm3bc5ogIyit3zMIFDrG2Qt1DTPIO kWDQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=vLqIrkwR; 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 d20si16930779oic.40.2019.12.29.12.47.04; Sun, 29 Dec 2019 12:47:14 -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=vLqIrkwR; 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 S1731726AbfL2RvW (ORCPT + 99 others); Sun, 29 Dec 2019 12:51:22 -0500 Received: from mail.kernel.org ([198.145.29.99]:36416 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1732051AbfL2RvQ (ORCPT ); Sun, 29 Dec 2019 12:51:16 -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 9F3AE206A4; Sun, 29 Dec 2019 17:51:15 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1577641876; bh=Joys5lt38jKI6ug968+zR1DfCk3GIR5YSnutJEDdiww=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=vLqIrkwRKexP5FjWk+9wwXqnINBr+7N8wyLU/xNHF5hj90EID8xfD5VQjBLQf2ZVv R5yyIXTsLEoL5JUU/SPKqlaqZaJeybmwpJlY2ySRIvCr5snfiIGuSS7GfhUFqF9cv3 G3YT+Roukxnopn4Bq+nqNJXcFsYwL/S8L53qKNSk= 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 249/434] perf probe: Fix to show ranges of variables in functions without entry_pc Date: Sun, 29 Dec 2019 18:25:02 +0100 Message-Id: <20191229172718.427913832@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 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 929b7c0567f4..4b1890204e99 100644 --- a/tools/perf/util/dwarf-aux.c +++ b/tools/perf/util/dwarf-aux.c @@ -997,7 +997,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; @@ -1060,7 +1060,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