From: Arnaldo Carvalho de Melo Date: Mon, 3 Aug 2015 19:27:40 +0000 (-0300) Subject: perf script: No tracepoints? Don't call libtraceevent. X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=9ee67421fe3b67a0796d6ea620fd5fcb037d3f89;p=GitHub%2Fmoto-9609%2Fandroid_kernel_motorola_exynos9610.git perf script: No tracepoints? Don't call libtraceevent. The libtraceevent handler (session->tevent) is only initialized when there are tracepoints in a perf.data event list, so do not call pevent_set_function_resolve() in those cases, fixing a segfault. Reported-by: Jiri Olsa Tested-by: Jiri Olsa Cc: Adrian Hunter Cc: Borislav Petkov Cc: David Ahern Cc: Frederic Weisbecker Cc: Namhyung Kim Cc: Stephane Eranian Link: http://lkml.kernel.org/n/tip-xyynkucl5p4bcs13zi4i4b1f@git.kernel.org Report-link: http://lkml.kernel.org/r/20150803174113.GA20282@krava.redhat.com Signed-off-by: Arnaldo Carvalho de Melo --- diff --git a/tools/perf/builtin-script.c b/tools/perf/builtin-script.c index bd31380122f9..7912feb9a024 100644 --- a/tools/perf/builtin-script.c +++ b/tools/perf/builtin-script.c @@ -1861,7 +1861,8 @@ int cmd_script(int argc, const char **argv, const char *prefix __maybe_unused) else symbol_conf.use_callchain = false; - if (pevent_set_function_resolver(session->tevent.pevent, + if (session->tevent.pevent && + pevent_set_function_resolver(session->tevent.pevent, machine__resolve_kernel_addr, &session->machines.host) < 0) { pr_err("%s: failed to set libtraceevent function resolver\n", __func__);