Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1201105

[PATCH 01/12] perf script: No tracepoints? Don't call libtraceevent.

From Arnaldo Carvalho de Melo <acme@kernel.org>
Newsgroups linux.kernel
Subject [PATCH 01/12] perf script: No tracepoints? Don't call libtraceevent.
Date 2015-08-05 22:20 +0200
Message-ID <pUdkn-3qW-35@gated-at.bofh.it> (permalink)
References <pUdkl-3qW-3@gated-at.bofh.it>
Organization linux.* mail to news gateway

Show all headers | View raw


From: Arnaldo Carvalho de Melo <acme@redhat.com>

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 <jolsa@kernel.org>
Tested-by: Jiri Olsa <jolsa@kernel.org>
Cc: Adrian Hunter <adrian.hunter@intel.com>
Cc: Borislav Petkov <bp@suse.de>
Cc: David Ahern <dsahern@gmail.com>
Cc: Frederic Weisbecker <fweisbec@gmail.com>
Cc: Namhyung Kim <namhyung@kernel.org>
Cc: Stephane Eranian <eranian@google.com>
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 <acme@redhat.com>
---
 tools/perf/builtin-script.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

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__);
-- 
2.1.0

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Back to linux.kernel | Previous | Next — Previous in thread | Next in thread | Find similar | Unroll thread


Thread

[GIT PULL 00/12] perf/core improvements and fixes Arnaldo Carvalho de Melo <acme@kernel.org> - 2015-08-05 22:20 +0200
  [PATCH 05/12] perf trace: Deref sys_enter pointer args with contents from probe:vfs_getname Arnaldo Carvalho de Melo <acme@kernel.org> - 2015-08-05 22:20 +0200
  [PATCH 10/12] perf tools: Do not include escape sequences in color_vfprintf return Arnaldo Carvalho de Melo <acme@kernel.org> - 2015-08-05 22:20 +0200
  [PATCH 01/12] perf script: No tracepoints? Don't call libtraceevent. Arnaldo Carvalho de Melo <acme@kernel.org> - 2015-08-05 22:20 +0200
  [PATCH 06/12] perf trace: Use vfs_getname syscall arg beautifier in more syscalls Arnaldo Carvalho de Melo <acme@kernel.org> - 2015-08-05 22:20 +0200
  [PATCH 12/12] perf tools: Fix build errors with mipsel-linux-uclibc compiler Arnaldo Carvalho de Melo <acme@kernel.org> - 2015-08-05 22:20 +0200
  [PATCH 11/12] perf trace: Write to stderr by default Arnaldo Carvalho de Melo <acme@kernel.org> - 2015-08-05 22:20 +0200
  [PATCH 02/12] perf trace: Do not show syscall tracepoint filter in the --no-syscalls case Arnaldo Carvalho de Melo <acme@kernel.org> - 2015-08-05 22:20 +0200
  [PATCH 03/12] perf trace: Remember if the vfs_getname tracepoint/kprobe is in place Arnaldo Carvalho de Melo <acme@kernel.org> - 2015-08-05 22:20 +0200
  [PATCH 09/12] perf tools: Remove trail argument to color vsprintf Arnaldo Carvalho de Melo <acme@kernel.org> - 2015-08-05 22:20 +0200
  [PATCH 07/12] perf tools: Per-event time support Arnaldo Carvalho de Melo <acme@kernel.org> - 2015-08-05 22:20 +0200
  [PATCH 08/12] perf tools: Refine parse/config callchain functions Arnaldo Carvalho de Melo <acme@kernel.org> - 2015-08-05 22:20 +0200

csiph-web