perf script: Check sample->callchain before using it
tip-bot for Arnaldo Carvalho de Melo
merge botCommit-ID: 922315210b8007a26374e30712813b714af71cac Gitweb: http://git.kernel.org/tip/922315210b8007a26374e30712813b714af71cac Author: Arnaldo Carvalho de Melo <[email protected]> AuthorDate: Mon, 18 Apr 2016 11:31:46 -0300 Committer: Arnaldo Carvalho de Melo <[email protected]> CommitDate: Mon, 18 Apr 2016 11:31:46 -0300
perf script: Check sample->callchain before using it
Found by code inspection, while looking at thread__resolve_callchain() callsites, one had it, the other didn't.
Cc Adrian Hunter <[email protected]>
Cc David Ahern <[email protected]>
Cc Jiri Olsa <[email protected]>
Cc Milian Wolff <[email protected]>
Cc Namhyung Kim <[email protected]>
Cc Wang Nan <[email protected]>
Signed-off-by Arnaldo Carvalho de Melo <[email protected]>
--- tools/perf/builtin-script.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
tools/perf/builtin-script.c +1 -1
@@ -791,7 +791,7 @@ static void process_event(struct perf_script *script,if (PRINT_FIELD (IP )) {struct callchain_cursor *cursor =NULL , cursor_callchain; -if (symbol_conf.use_callchain && +if (symbol_conf.use_callchain && sample->callchain &&thread__resolve_callchain (al->thread, &cursor_callchain, evsel, sample,NULL ,NULL , scripting_max_stack) ==0 ) cursor = &cursor_callchain;