From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1946967AbdKRIpg (ORCPT ); Sat, 18 Nov 2017 03:45:36 -0500 Received: from terminus.zytor.com ([65.50.211.136]:56015 "EHLO terminus.zytor.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1946328AbdKRIpV (ORCPT ); Sat, 18 Nov 2017 03:45:21 -0500 Date: Sat, 18 Nov 2017 00:42:39 -0800 From: tip-bot for Jiri Olsa Message-ID: Cc: hpa@zytor.com, adrian.hunter@intel.com, linux-kernel@vger.kernel.org, dsahern@gmail.com, tglx@linutronix.de, wangnan0@huawei.com, namhyung@kernel.org, mingo@kernel.org, ravi.bangoria@linux.vnet.ibm.com, jolsa@kernel.org, andi@firstfloor.org, acme@redhat.com Reply-To: linux-kernel@vger.kernel.org, adrian.hunter@intel.com, hpa@zytor.com, dsahern@gmail.com, tglx@linutronix.de, jolsa@kernel.org, ravi.bangoria@linux.vnet.ibm.com, mingo@kernel.org, namhyung@kernel.org, wangnan0@huawei.com, acme@redhat.com, andi@firstfloor.org To: linux-tip-commits@vger.kernel.org Subject: [tip:perf/core] perf top: Fix crash when annotating symbol Git-Commit-ID: a7eec4c677fe60c8760fa9054b578c743ff6a3ec X-Mailer: tip-git-log-daemon Robot-ID: Robot-Unsubscribe: Contact to get blacklisted from these emails MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Content-Type: text/plain; charset=UTF-8 Content-Disposition: inline Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Commit-ID: a7eec4c677fe60c8760fa9054b578c743ff6a3ec Gitweb: https://git.kernel.org/tip/a7eec4c677fe60c8760fa9054b578c743ff6a3ec Author: Jiri Olsa AuthorDate: Wed, 15 Nov 2017 11:53:21 +0100 Committer: Arnaldo Carvalho de Melo CommitDate: Fri, 17 Nov 2017 12:16:24 -0300 perf top: Fix crash when annotating symbol Ravi reported crash in perf top --stdio when annotating a function [1]. The issue was, that we don't pass evsel pointer into symbol__annotate() function, which got over looked in the last annotation changes. [1] https://marc.info/?l=linux-kernel&m=151060884412702&w=2 Committer note: This fixes the crash, but makes it stumble into another bug, double locking the annotation data structures, that is in turn fixed by the next patch in this series. Signed-off-by: Jiri Olsa Tested-by: Ravi Bangoria Tested-by: Arnaldo Carvalho de Melo Cc: Adrian Hunter Cc: Andi Kleen Cc: David Ahern Cc: Namhyung Kim Cc: Wang Nan Link: http://lkml.kernel.org/n/tip-6eol035redpoqvxqnuiqudtc@git.kernel.org Signed-off-by: Arnaldo Carvalho de Melo --- tools/perf/builtin-top.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/tools/perf/builtin-top.c b/tools/perf/builtin-top.c index a29a983..0077724 100644 --- a/tools/perf/builtin-top.c +++ b/tools/perf/builtin-top.c @@ -99,6 +99,7 @@ static void perf_top__resize(struct perf_top *top) static int perf_top__parse_source(struct perf_top *top, struct hist_entry *he) { + struct perf_evsel *evsel = hists_to_evsel(he->hists); struct symbol *sym; struct annotation *notes; struct map *map; @@ -137,7 +138,7 @@ static int perf_top__parse_source(struct perf_top *top, struct hist_entry *he) return err; } - err = symbol__annotate(sym, map, NULL, 0, NULL, NULL); + err = symbol__annotate(sym, map, evsel, 0, NULL, NULL); if (err == 0) { out_assign: top->sym_filter_entry = he;