From: Arnaldo Carvalho de Melo Date: Mon, 18 Apr 2016 14:31:46 +0000 (-0300) Subject: perf script: Check sample->callchain before using it X-Git-Tag: v4.7-rc1~191^2~24^2~11 X-Git-Url: https://git.karo-electronics.de/?a=commitdiff_plain;h=922315210b8007a26374e30712813b714af71cac;p=karo-tx-linux.git 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 Cc: David Ahern Cc: Jiri Olsa Cc: Milian Wolff Cc: Namhyung Kim Cc: Wang Nan Link: http://lkml.kernel.org/n/tip-6r8i2afd3523thuuaxl39yhk@git.kernel.org Signed-off-by: Arnaldo Carvalho de Melo --- diff --git a/tools/perf/builtin-script.c b/tools/perf/builtin-script.c index 0e93282b405e..5099740aa50b 100644 --- a/tools/perf/builtin-script.c +++ b/tools/perf/builtin-script.c @@ -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;