summaryrefslogtreecommitdiffstats
path: root/tools/perf/builtin-script.c
diff options
context:
space:
mode:
authorArnaldo Carvalho de Melo <acme@redhat.com>2016-04-18 16:31:46 +0200
committerArnaldo Carvalho de Melo <acme@redhat.com>2016-04-18 16:31:46 +0200
commit922315210b8007a26374e30712813b714af71cac (patch)
tree8f80a4df7cfc0e437d4c9c859512ec712cf58aa1 /tools/perf/builtin-script.c
parentperf evsel: Add missign class prefix to has_branch_stack method (diff)
downloadlinux-922315210b8007a26374e30712813b714af71cac.tar.xz
linux-922315210b8007a26374e30712813b714af71cac.zip
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 <adrian.hunter@intel.com> Cc: David Ahern <dsahern@gmail.com> Cc: Jiri Olsa <jolsa@kernel.org> Cc: Milian Wolff <milian.wolff@kdab.com> Cc: Namhyung Kim <namhyung@kernel.org> Cc: Wang Nan <wangnan0@huawei.com> Link: http://lkml.kernel.org/n/tip-6r8i2afd3523thuuaxl39yhk@git.kernel.org Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
Diffstat (limited to 'tools/perf/builtin-script.c')
-rw-r--r--tools/perf/builtin-script.c2
1 files changed, 1 insertions, 1 deletions
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;