Skip to content

Commit

Permalink
perf top: Fix crash when annotating symbol
Browse files Browse the repository at this point in the history
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@kernel.org>
Tested-by: Ravi Bangoria <ravi.bangoria@linux.vnet.ibm.com>
Tested-by: Arnaldo Carvalho de Melo <acme@redhat.com>
Cc: Adrian Hunter <adrian.hunter@intel.com>
Cc: Andi Kleen <andi@firstfloor.org>
Cc: David Ahern <dsahern@gmail.com>
Cc: Namhyung Kim <namhyung@kernel.org>
Cc: Wang Nan <wangnan0@huawei.com>
Link: http://lkml.kernel.org/n/tip-6eol035redpoqvxqnuiqudtc@git.kernel.org
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
  • Loading branch information
Jiri Olsa authored and Arnaldo Carvalho de Melo committed Nov 17, 2017
1 parent 244a108 commit a7eec4c
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion tools/perf/builtin-top.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -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;
Expand Down

0 comments on commit a7eec4c

Please sign in to comment.