perf script: Check if evsel has callchains before trying to use it
authorArnaldo Carvalho de Melo <acme@redhat.com>
Mon, 4 Jun 2018 13:34:20 +0000 (10:34 -0300)
committerArnaldo Carvalho de Melo <acme@redhat.com>
Tue, 5 Jun 2018 13:09:54 +0000 (10:09 -0300)
commitb879833cbaac85b1437f574791b8855d26b0dc80
tree42993f0fa3027c6c0bfbbda0d45d0b34f9560370
parent27de9b2bd996de0ca4079c42c81c85158e10145c
perf script: Check if evsel has callchains before trying to use it

We were checking just if callchain processing was asked for by the
user, not if the evsel itself has callchains, and since we can have
some evsels with callchains and others without, check that.

Cc: Adrian Hunter <adrian.hunter@intel.com>
Cc: David Ahern <dsahern@gmail.com>
Cc: Jiri Olsa <jolsa@kernel.org>
Cc: Namhyung Kim <namhyung@kernel.org>
Cc: Wang Nan <wangnan0@huawei.com>
Link: https://lkml.kernel.org/n/tip-inxl7k49q9f9w1se039fbxuw@git.kernel.org
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
tools/perf/builtin-script.c