Browse Source

Merge tag 'perf-urgent-for-mingo' of git://git.kernel.org/pub/scm/linux/kernel/git/jolsa/perf into perf/urgent

Pull perf/urgent fixes from Jiri Olsa:

  * Fix memory leak and backward compatibility macros for pevent
    filter enums in traceevent library (Steven Rostedt)

  * Disable libdw unwind for all but x86 arch (Jiri Olsa)

  * Fix memory leak in sample_ustack (Masanari Iida)

Signed-off-by: Jiri Olsa <jolsa@redhat.com>
Signed-off-by: Ingo Molnar <mingo@kernel.org>
Ingo Molnar 11 years ago
parent
commit
89b90ee37a

+ 1 - 0
tools/lib/traceevent/event-parse.c

@@ -4344,6 +4344,7 @@ static void pretty_print(struct trace_seq *s, void *data, int size, struct event
 					      format, len_arg, arg);
 					      format, len_arg, arg);
 				trace_seq_terminate(&p);
 				trace_seq_terminate(&p);
 				trace_seq_puts(s, p.buffer);
 				trace_seq_puts(s, p.buffer);
+				trace_seq_destroy(&p);
 				arg = arg->next;
 				arg = arg->next;
 				break;
 				break;
 			default:
 			default:

+ 2 - 2
tools/lib/traceevent/event-parse.h

@@ -876,8 +876,8 @@ struct event_filter {
 struct event_filter *pevent_filter_alloc(struct pevent *pevent);
 struct event_filter *pevent_filter_alloc(struct pevent *pevent);
 
 
 /* for backward compatibility */
 /* for backward compatibility */
-#define FILTER_NONE		PEVENT_ERRNO__FILTER_NOT_FOUND
-#define FILTER_NOEXIST		PEVENT_ERRNO__NO_FILTER
+#define FILTER_NONE		PEVENT_ERRNO__NO_FILTER
+#define FILTER_NOEXIST		PEVENT_ERRNO__FILTER_NOT_FOUND
 #define FILTER_MISS		PEVENT_ERRNO__FILTER_MISS
 #define FILTER_MISS		PEVENT_ERRNO__FILTER_MISS
 #define FILTER_MATCH		PEVENT_ERRNO__FILTER_MATCH
 #define FILTER_MATCH		PEVENT_ERRNO__FILTER_MATCH
 
 

+ 1 - 0
tools/perf/arch/x86/tests/dwarf-unwind.c

@@ -26,6 +26,7 @@ static int sample_ustack(struct perf_sample *sample,
 	map = map_groups__find(&thread->mg, MAP__FUNCTION, (u64) sp);
 	map = map_groups__find(&thread->mg, MAP__FUNCTION, (u64) sp);
 	if (!map) {
 	if (!map) {
 		pr_debug("failed to get stack map\n");
 		pr_debug("failed to get stack map\n");
+		free(buf);
 		return -1;
 		return -1;
 	}
 	}
 
 

+ 8 - 0
tools/perf/config/Makefile

@@ -34,6 +34,14 @@ ifeq ($(ARCH),arm)
   LIBUNWIND_LIBS = -lunwind -lunwind-arm
   LIBUNWIND_LIBS = -lunwind -lunwind-arm
 endif
 endif
 
 
+# So far there's only x86 libdw unwind support merged in perf.
+# Disable it on all other architectures in case libdw unwind
+# support is detected in system. Add supported architectures
+# to the check.
+ifneq ($(ARCH),x86)
+  NO_LIBDW_DWARF_UNWIND := 1
+endif
+
 ifeq ($(LIBUNWIND_LIBS),)
 ifeq ($(LIBUNWIND_LIBS),)
   NO_LIBUNWIND := 1
   NO_LIBUNWIND := 1
 else
 else