perf script: No tracepoints? Don' t call libtraceevent.
tip-bot for Arnaldo Carvalho de Melo
merge botCommit-ID: 9ee67421fe3b67a0796d6ea620fd5fcb037d3f89 Gitweb: http://git.kernel.org/tip/9ee67421fe3b67a0796d6ea620fd5fcb037d3f89 Author: Arnaldo Carvalho de Melo <[email protected]> AuthorDate: Mon, 3 Aug 2015 16:27:40 -0300 Committer: Arnaldo Carvalho de Melo <[email protected]> CommitDate: Tue, 4 Aug 2015 12:28:10 -0300
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 <[email protected]>
Tested-by Jiri Olsa <[email protected]>
Cc Adrian Hunter <[email protected]>
Cc Borislav Petkov <[email protected]>
Cc David Ahern <[email protected]>
Cc Frederic Weisbecker <[email protected]>
Cc Namhyung Kim <[email protected]>
Cc Stephane Eranian <[email protected]>
Report-link: http://lkml.kernel.org/r/[email protected]
Signed-off-by Arnaldo Carvalho de Melo <[email protected]>
--- tools/perf/builtin-script.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-)
tools/perf/builtin-script.c +2 -1
@@ -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__);