[<prev] [next>] [day] [month] [year] [list]
Message-ID: <tip-6eol035redpoqvxqnuiqudtc@git.kernel.org>
Date: Sat, 18 Nov 2017 00:42:39 -0800
From: tip-bot for Jiri Olsa <tipbot@...or.com>
To: linux-tip-commits@...r.kernel.org
Cc: hpa@...or.com, adrian.hunter@...el.com,
linux-kernel@...r.kernel.org, dsahern@...il.com,
tglx@...utronix.de, wangnan0@...wei.com, namhyung@...nel.org,
mingo@...nel.org, ravi.bangoria@...ux.vnet.ibm.com,
jolsa@...nel.org, andi@...stfloor.org, acme@...hat.com
Subject: [tip:perf/core] perf top: Fix crash when annotating symbol
Commit-ID: a7eec4c677fe60c8760fa9054b578c743ff6a3ec
Gitweb: https://git.kernel.org/tip/a7eec4c677fe60c8760fa9054b578c743ff6a3ec
Author: Jiri Olsa <jolsa@...nel.org>
AuthorDate: Wed, 15 Nov 2017 11:53:21 +0100
Committer: Arnaldo Carvalho de Melo <acme@...hat.com>
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 <jolsa@...nel.org>
Tested-by: Ravi Bangoria <ravi.bangoria@...ux.vnet.ibm.com>
Tested-by: Arnaldo Carvalho de Melo <acme@...hat.com>
Cc: Adrian Hunter <adrian.hunter@...el.com>
Cc: Andi Kleen <andi@...stfloor.org>
Cc: David Ahern <dsahern@...il.com>
Cc: Namhyung Kim <namhyung@...nel.org>
Cc: Wang Nan <wangnan0@...wei.com>
Link: http://lkml.kernel.org/n/tip-6eol035redpoqvxqnuiqudtc@git.kernel.org
Signed-off-by: Arnaldo Carvalho de Melo <acme@...hat.com>
---
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;
Powered by blists - more mailing lists