Skip to contentSkip to conversation

perf report: Use the right symbol for annotation

tip:perf/urgent tip-bot for Arnaldo Carvalho de Melo 1 participant 1 message Jun 6, 2012 perf events

lore
Share & tools
lore
#0 lore raw
Commit-ID:  91557e847dbc715acf2d847a1ffec63f71b00b65
Gitweb:     http://git.kernel.org/tip/91557e847dbc715acf2d847a1ffec63f71b00b65
Author:     Arnaldo Carvalho de Melo <[email protected]>
AuthorDate: Wed, 30 May 2012 12:25:52 -0300
Committer:  Arnaldo Carvalho de Melo <[email protected]>
CommitDate: Wed, 30 May 2012 12:25:52 -0300

perf report: Use the right symbol for annotation

In non symbolic views, i.e. --sort without "symbol", as in:

perf report --sort comm

We're segfaulting in the --tui because we're testing the symbol resolved and then trying to use the symbol on the histogram entry where we're coalescing all hits for a COMM, and the first hist_entry for a comm may have a NULL symbol, i.e. the RIP didn't resolve to any symbol.

In this case we're segfaulting, fix it by testing against the symbol in the histogram entry.

Cc David Ahern <[email protected]>
Cc Frederic Weisbecker <[email protected]>
Cc Jiri Olsa <[email protected]>
Cc Mike Galbraith <[email protected]>
Cc Namhyung Kim <[email protected]>
Cc Paul Mackerras <[email protected]>
Cc Peter Zijlstra <[email protected]>
Cc Stephane Eranian <[email protected]>
---
 tools/perf/builtin-report.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)
tools/perf/builtin-report.c +1 -1
index 8c767c6..2400e00 100644
@@ -162,7 +162,7 @@ static int perf_evsel__add_hist_entry(struct perf_evsel *evsel,
 	 * so we don't allocated the extra space needed because the stdio
 	 * code will not use it.
 	 */
-	if (al->sym != NULL && use_browser > 0) {
+	if (he->ms.sym != NULL && use_browser > 0) {
 		struct annotation *notes = symbol__annotation(he->ms.sym);
 
 		assert(evsel != NULL);