From: Arnaldo Carvalho de Melo Date: Mon, 4 Jun 2018 13:34:20 +0000 (-0300) Subject: perf script: Check if evsel has callchains before trying to use it X-Git-Tag: v4.19~830^2^2~21 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=b879833cbaac85b1437f574791b8855d26b0dc80;p=platform%2Fkernel%2Flinux-rpi.git 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 Cc: David Ahern Cc: Jiri Olsa Cc: Namhyung Kim Cc: Wang Nan Link: https://lkml.kernel.org/n/tip-inxl7k49q9f9w1se039fbxuw@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 48e940e..b3bf355 100644 --- a/tools/perf/builtin-script.c +++ b/tools/perf/builtin-script.c @@ -606,7 +606,7 @@ static int perf_sample__fprintf_start(struct perf_sample *sample, if (PRINT_FIELD(COMM)) { if (latency_format) printed += fprintf(fp, "%8.8s ", thread__comm_str(thread)); - else if (PRINT_FIELD(IP) && symbol_conf.use_callchain) + else if (PRINT_FIELD(IP) && evsel__has_callchain(evsel) && symbol_conf.use_callchain) printed += fprintf(fp, "%s ", thread__comm_str(thread)); else printed += fprintf(fp, "%16s ", thread__comm_str(thread));