Skip to contentSkip to conversation

perf tools: Speed up dwarf callchain post-unwinding for libunwind (v4)

PATCH Applied Namhyung Kim 4 participants 22 messages Oct 6, 2014 – Oct 30, 2014 perf events

lore
Share & tools
lore

Namhyung Kim

author maintainer
#0 lore raw

cover perf tools: Speed up dwarf callchain post-unwinding for libunwind (v4)

Hello,

This is v4 for libunwind callchain post processing speed up. It was able to reduce 50% of processing time by using global cache provided in libunwind. In this version, I decided to use the existing callchain_param.record_mode instead of adding a new field in the symbol_conf.

The patch 4 and 5 are just cleanups so that we can easily find out that which part of code uses the thread->priv.

You can also get it from 'perf/callchain-unwind-v4' branch on my tree:

git://git.kernel.org/pub/scm/linux/kernel/git/namhyung/linux-perf.git

Thanks,
Namhyung

Namhyung Kim (5):
perf report: Set callchain_param.record_mode for future use perf callchain: Create an address space per thread perf callchain: Use global caching provided by libunwind perf kvm: Use thread_{,_set}_priv helpers
perf trace: Use thread_{,_set}_priv helpers

 tools/perf/builtin-kvm.c           |  6 ++---
 tools/perf/builtin-report.c        |  7 ++++++
 tools/perf/builtin-trace.c         | 16 ++++++-------
 tools/perf/tests/dwarf-unwind.c    |  3 +++
 tools/perf/util/callchain.h        |  2 ++
 tools/perf/util/hist.h             |  2 --
 tools/perf/util/thread.c           |  9 +++++++
 tools/perf/util/unwind-libunwind.c | 48 ++++++++++++++++++++++++++++++++++----
 tools/perf/util/unwind.h           | 20 ++++++++++++++++
 9 files changed, 95 insertions(+), 18 deletions(-)
Signature · 1 line
2.1.0
author maintainer
#1 lore raw

PATCH 1/5 perf report: Set callchain_param.record_mode for future use

Normally the callchain_param.record_mode is used only for record path. But as it might need to prepare something for dwarf unwinding, setup this info for perf report too.

Cc Jiri Olsa <[email protected]>
Cc David Ahern <[email protected]>
Cc Jean Pihet <[email protected]>
Cc Frederic Weisbecker <[email protected]>
---
 tools/perf/builtin-report.c     | 7 +++++++
 tools/perf/tests/dwarf-unwind.c | 3 +++
 tools/perf/util/callchain.h     | 2 ++
 tools/perf/util/hist.h          | 2 --
 4 files changed, 12 insertions(+), 2 deletions(-)
tools/perf/builtin-report.c +7 -0
index ac145fae0521..f9a9ee7b2646 100644
@@ -257,6 +257,13 @@ static int report__setup_sample_type(struct report *rep)
 		}
 	}
 
+	if (symbol_conf.use_callchain || symbol_conf.cumulate_callchain) {
+		if ((sample_type & PERF_SAMPLE_REGS_USER) &&
+		    (sample_type & PERF_SAMPLE_STACK_USER))
+			callchain_param.record_mode = CALLCHAIN_DWARF;
+		else
+			callchain_param.record_mode = CALLCHAIN_FP;
+	}
 	return 0;
 }
 
tools/perf/tests/dwarf-unwind.c +3 -0
index 96adb730b744..fc25e57f4a5d 100644
@@ -9,6 +9,7 @@
 #include "perf_regs.h"
 #include "map.h"
 #include "thread.h"
+#include "callchain.h"
 
 static int mmap_handler(struct perf_tool *tool __maybe_unused,
 			union perf_event *event,
@@ -120,6 +121,8 @@ int test__dwarf_unwind(void)
 		return -1;
 	}
 
+	callchain_param.record_mode = CALLCHAIN_DWARF;
+
 	if (init_live_machine(machine)) {
 		pr_err("Could not init machine\n");
 		goto out;
tools/perf/util/callchain.h +2 -0
index 2a1f5a46543a..94cfefddf4db 100644
@@ -65,6 +65,8 @@ struct callchain_param {
 	enum chain_key		key;
 };
 
+extern struct callchain_param callchain_param;
+
 struct callchain_list {
 	u64			ip;
 	struct map_symbol	ms;
tools/perf/util/hist.h +0 -2
index 8c9c70e18cbb..ac1ee82c6c7e 100644
@@ -8,8 +8,6 @@
 #include "color.h"
 #include "ui/progress.h"
 
-extern struct callchain_param callchain_param;
-
 struct hist_entry;
 struct addr_location;
 struct symbol;
Signature · 1 line
2.1.0
#2 lore raw

[tip:perf/urgent] perf report: Set callchain_param.record_mode for future use

perf report: Set callchain_param.record_mode for future use
Commit-ID:  0cdccac6fe4b1316f04f0dbfcc4efab51932014a
Gitweb:     http://git.kernel.org/tip/0cdccac6fe4b1316f04f0dbfcc4efab51932014a
Author:     Namhyung Kim <[email protected]>
AuthorDate: Mon, 6 Oct 2014 09:45:59 +0900
Committer:  Arnaldo Carvalho de Melo <[email protected]>
CommitDate: Wed, 15 Oct 2014 16:20:03 -0300

perf report: Set callchain_param.record_mode for future use

Normally the callchain_param.record_mode is used only for record path. But as it might need to prepare something for dwarf unwinding, setup this info for perf report too.

---
 tools/perf/builtin-report.c     | 7 +++++++
 tools/perf/tests/dwarf-unwind.c | 3 +++
 2 files changed, 10 insertions(+)
tools/perf/builtin-report.c +7 -0
index 2cfc4b93..140a6cd 100644
@@ -257,6 +257,13 @@ static int report__setup_sample_type(struct report *rep)
 		}
 	}
 
+	if (symbol_conf.use_callchain || symbol_conf.cumulate_callchain) {
+		if ((sample_type & PERF_SAMPLE_REGS_USER) &&
+		    (sample_type & PERF_SAMPLE_STACK_USER))
+			callchain_param.record_mode = CALLCHAIN_DWARF;
+		else
+			callchain_param.record_mode = CALLCHAIN_FP;
+	}
 	return 0;
 }
 
tools/perf/tests/dwarf-unwind.c +3 -0
index 96adb73..fc25e57 100644
@@ -9,6 +9,7 @@
 #include "perf_regs.h"
 #include "map.h"
 #include "thread.h"
+#include "callchain.h"
 
 static int mmap_handler(struct perf_tool *tool __maybe_unused,
 			union perf_event *event,
@@ -120,6 +121,8 @@ int test__dwarf_unwind(void)
 		return -1;
 	}
 
+	callchain_param.record_mode = CALLCHAIN_DWARF;
+
 	if (init_live_machine(machine)) {
 		pr_err("Could not init machine\n");
 		goto out;
author maintainer
#3 lore raw

PATCH 2/5 perf callchain: Create an address space per thread

In reply to Namhyung Kim

The unw_addr_space_t in libunwind represents an address space to be used for stack unwinding. It doesn't need to be create/destory everytime to unwind callchain (as in get_entries) and can have a same lifetime as thread (unless exec called).

So move the address space construction/destruction logic to the thread lifetime handling functions. This is a preparation to enable caching in the unwind library.

Note that it saves unw_addr_space_t object using thread__set_priv(). It seems currently only used by perf trace and perf kvm stat commands which don't use callchain.

Cc Jiri Olsa <[email protected]>
Cc Arun Sharma <[email protected]>
Cc David Ahern <[email protected]>
Cc Frederic Weisbecker <[email protected]>
---
 tools/perf/util/thread.c           |  6 ++++++
 tools/perf/util/unwind-libunwind.c | 36 +++++++++++++++++++++++++++++++-----
 tools/perf/util/unwind.h           | 17 +++++++++++++++++
 3 files changed, 54 insertions(+), 5 deletions(-)
tools/perf/util/thread.c +6 -0
index a9df7f2c6dc9..2b7b2d91c016 100644
@@ -7,6 +7,7 @@
 #include "util.h"
 #include "debug.h"
 #include "comm.h"
+#include "unwind.h"
 
 int thread__init_map_groups(struct thread *thread, struct machine *machine)
 {
@@ -37,6 +38,9 @@ struct thread *thread__new(pid_t pid, pid_t tid)
 		thread->cpu = -1;
 		INIT_LIST_HEAD(&thread->comm_list);
 
+		if (unwind__prepare_access(thread) < 0)
+			goto err_thread;
+
 		comm_str = malloc(32);
 		if (!comm_str)
 			goto err_thread;
@@ -48,6 +52,7 @@ struct thread *thread__new(pid_t pid, pid_t tid)
 			goto err_thread;
 
 		list_add(&comm->list, &thread->comm_list);
+
 	}
 
 	return thread;
@@ -69,6 +74,7 @@ void thread__delete(struct thread *thread)
 		list_del(&comm->list);
 		comm__free(comm);
 	}
+	unwind__finish_access(thread);
 
 	free(thread);
 }
tools/perf/util/unwind-libunwind.c +31 -5
index 92b56db52471..d9874465206b 100644
@@ -525,12 +525,12 @@ static unw_accessors_t accessors = {
 	.get_proc_name		= get_proc_name,
 };
 
-static int get_entries(struct unwind_info *ui, unwind_entry_cb_t cb,
-		       void *arg, int max_stack)
+int unwind__prepare_access(struct thread *thread)
 {
 	unw_addr_space_t addr_space;
-	unw_cursor_t c;
-	int ret;
+
+	if (callchain_param.record_mode != CALLCHAIN_DWARF)
+		return 0;
 
 	addr_space = unw_create_addr_space(&accessors, 0);
 	if (!addr_space) {
@@ -538,6 +538,33 @@ static int get_entries(struct unwind_info *ui, unwind_entry_cb_t cb,
 		return -ENOMEM;
 	}
 
+	thread__set_priv(thread, addr_space);
+
+	return 0;
+}
+
+void unwind__finish_access(struct thread *thread)
+{
+	unw_addr_space_t addr_space;
+
+	if (callchain_param.record_mode != CALLCHAIN_DWARF)
+		return;
+
+	addr_space = thread__priv(thread);
+	unw_destroy_addr_space(addr_space);
+}
+
+static int get_entries(struct unwind_info *ui, unwind_entry_cb_t cb,
+		       void *arg, int max_stack)
+{
+	unw_addr_space_t addr_space;
+	unw_cursor_t c;
+	int ret;
+
+	addr_space = thread__priv(ui->thread);
+	if (addr_space == NULL)
+		return -1;
+
 	ret = unw_init_remote(&c, addr_space, ui);
 	if (ret)
 		display_error(ret);
@@ -549,7 +576,6 @@ static int get_entries(struct unwind_info *ui, unwind_entry_cb_t cb,
 		ret = ip ? entry(ip, ui->thread, ui->machine, cb, arg) : 0;
 	}
 
-	unw_destroy_addr_space(addr_space);
 	return ret;
 }
 
tools/perf/util/unwind.h +17 -0
index f03061260b4e..4b99c6280c2a 100644
@@ -4,6 +4,7 @@
 #include <linux/types.h>
 #include "event.h"
 #include "symbol.h"
+#include "thread.h"
 
 struct unwind_entry {
 	struct map	*map;
@@ -21,6 +22,15 @@ int unwind__get_entries(unwind_entry_cb_t cb, void *arg,
 /* libunwind specific */
 #ifdef HAVE_LIBUNWIND_SUPPORT
 int libunwind__arch_reg_id(int regnum);
+int unwind__prepare_access(struct thread *thread);
+void unwind__finish_access(struct thread *thread);
+#else
+static inline int unwind__prepare_access(struct thread *thread)
+{
+	return 0;
+}
+
+static inline void unwind__finish_access(struct thread *thread) {}
 #endif
 #else
 static inline int
@@ -33,5 +43,12 @@ unwind__get_entries(unwind_entry_cb_t cb __maybe_unused,
 {
 	return 0;
 }
+
+static inline int unwind__prepare_access(struct thread *thread)
+{
+	return 0;
+}
+
+static inline void unwind__finish_access(struct thread *thread) {}
 #endif /* HAVE_DWARF_UNWIND_SUPPORT */
 #endif /* __UNWIND_H */
Signature · 1 line
2.1.0
#4 lore raw

[tip:perf/urgent] perf callchain: Create an address space per thread

perf callchain: Create an address space per thread
Commit-ID:  66f066d8994bd146304bab72fa09c1e644c4b3ff
Gitweb:     http://git.kernel.org/tip/66f066d8994bd146304bab72fa09c1e644c4b3ff
Author:     Namhyung Kim <[email protected]>
AuthorDate: Mon, 6 Oct 2014 09:46:00 +0900
Committer:  Arnaldo Carvalho de Melo <[email protected]>
CommitDate: Wed, 15 Oct 2014 17:38:23 -0300

perf callchain: Create an address space per thread

The unw_addr_space_t in libunwind represents an address space to be used for stack unwinding. It doesn't need to be create/destory everytime to unwind callchain (as in get_entries) and can have a same lifetime as thread (unless exec called).

So move the address space construction/destruction logic to the thread lifetime handling functions. This is a preparation to enable caching in the unwind library.

Note that it saves unw_addr_space_t object using thread__set_priv(). It seems currently only used by perf trace and perf kvm stat commands which don't use callchain.

[ Fixup unwind-libunwind.c missing CALLCHAIN_DWARF definition, added
missing __maybe_unused on unused parameters in stubs at util/unwind.h ]

---
 tools/perf/util/thread.c           |  6 ++++++
 tools/perf/util/unwind-libunwind.c | 37 ++++++++++++++++++++++++++++++++-----
 tools/perf/util/unwind.h           | 17 +++++++++++++++++
 3 files changed, 55 insertions(+), 5 deletions(-)
tools/perf/util/thread.c +6 -0
index a9df7f2..2b7b2d9 100644
@@ -7,6 +7,7 @@
 #include "util.h"
 #include "debug.h"
 #include "comm.h"
+#include "unwind.h"
 
 int thread__init_map_groups(struct thread *thread, struct machine *machine)
 {
@@ -37,6 +38,9 @@ struct thread *thread__new(pid_t pid, pid_t tid)
 		thread->cpu = -1;
 		INIT_LIST_HEAD(&thread->comm_list);
 
+		if (unwind__prepare_access(thread) < 0)
+			goto err_thread;
+
 		comm_str = malloc(32);
 		if (!comm_str)
 			goto err_thread;
@@ -48,6 +52,7 @@ struct thread *thread__new(pid_t pid, pid_t tid)
 			goto err_thread;
 
 		list_add(&comm->list, &thread->comm_list);
+
 	}
 
 	return thread;
@@ -69,6 +74,7 @@ void thread__delete(struct thread *thread)
 		list_del(&comm->list);
 		comm__free(comm);
 	}
+	unwind__finish_access(thread);
 
 	free(thread);
 }
tools/perf/util/unwind-libunwind.c +32 -5
index 92b56db..e060386 100644
@@ -24,6 +24,7 @@
 #include <linux/list.h>
 #include <libunwind.h>
 #include <libunwind-ptrace.h>
+#include "callchain.h"
 #include "thread.h"
 #include "session.h"
 #include "perf_regs.h"
@@ -525,12 +526,12 @@ static unw_accessors_t accessors = {
 	.get_proc_name		= get_proc_name,
 };
 
-static int get_entries(struct unwind_info *ui, unwind_entry_cb_t cb,
-		       void *arg, int max_stack)
+int unwind__prepare_access(struct thread *thread)
 {
 	unw_addr_space_t addr_space;
-	unw_cursor_t c;
-	int ret;
+
+	if (callchain_param.record_mode != CALLCHAIN_DWARF)
+		return 0;
 
 	addr_space = unw_create_addr_space(&accessors, 0);
 	if (!addr_space) {
@@ -538,6 +539,33 @@ static int get_entries(struct unwind_info *ui, unwind_entry_cb_t cb,
 		return -ENOMEM;
 	}
 
+	thread__set_priv(thread, addr_space);
+
+	return 0;
+}
+
+void unwind__finish_access(struct thread *thread)
+{
+	unw_addr_space_t addr_space;
+
+	if (callchain_param.record_mode != CALLCHAIN_DWARF)
+		return;
+
+	addr_space = thread__priv(thread);
+	unw_destroy_addr_space(addr_space);
+}
+
+static int get_entries(struct unwind_info *ui, unwind_entry_cb_t cb,
+		       void *arg, int max_stack)
+{
+	unw_addr_space_t addr_space;
+	unw_cursor_t c;
+	int ret;
+
+	addr_space = thread__priv(ui->thread);
+	if (addr_space == NULL)
+		return -1;
+
 	ret = unw_init_remote(&c, addr_space, ui);
 	if (ret)
 		display_error(ret);
@@ -549,7 +577,6 @@ static int get_entries(struct unwind_info *ui, unwind_entry_cb_t cb,
 		ret = ip ? entry(ip, ui->thread, ui->machine, cb, arg) : 0;
 	}
 
-	unw_destroy_addr_space(addr_space);
 	return ret;
 }
 
tools/perf/util/unwind.h +17 -0
index f030612..c17c485 100644
@@ -4,6 +4,7 @@
 #include <linux/types.h>
 #include "event.h"
 #include "symbol.h"
+#include "thread.h"
 
 struct unwind_entry {
 	struct map	*map;
@@ -21,6 +22,15 @@ int unwind__get_entries(unwind_entry_cb_t cb, void *arg,
 /* libunwind specific */
 #ifdef HAVE_LIBUNWIND_SUPPORT
 int libunwind__arch_reg_id(int regnum);
+int unwind__prepare_access(struct thread *thread);
+void unwind__finish_access(struct thread *thread);
+#else
+static inline int unwind__prepare_access(struct thread *thread __maybe_unused)
+{
+	return 0;
+}
+
+static inline void unwind__finish_access(struct thread *thread __maybe_unused) {}
 #endif
 #else
 static inline int
@@ -33,5 +43,12 @@ unwind__get_entries(unwind_entry_cb_t cb __maybe_unused,
 {
 	return 0;
 }
+
+static inline int unwind__prepare_access(struct thread *thread __maybe_unused)
+{
+	return 0;
+}
+
+static inline void unwind__finish_access(struct thread *thread __maybe_unused) {}
 #endif /* HAVE_DWARF_UNWIND_SUPPORT */
 #endif /* __UNWIND_H */
author maintainer
#5 lore raw

PATCH 3/5 perf callchain: Use global caching provided by libunwind

In reply to Namhyung Kim

The libunwind provides two caching policy which are global and per-thread. As perf unwinds callchains in a single thread, it'd sufficient to use global caching.

This speeds up my perf report from 14s to 7s on a ~260MB data file. Although the output sometimes contains a slight difference (~0.01% in terms of number of lines printed) on callchains which were not resolved.

Cc Jiri Olsa <[email protected]>
Cc Arun Sharma <[email protected]>
Cc David Ahern <[email protected]>
Cc Frederic Weisbecker <[email protected]>
---
 tools/perf/util/thread.c           |  3 +++
 tools/perf/util/unwind-libunwind.c | 12 ++++++++++++
 tools/perf/util/unwind.h           |  3 +++
 3 files changed, 18 insertions(+)
tools/perf/util/thread.c +3 -0
index 2b7b2d91c016..c41411726c7a 100644
@@ -117,6 +117,9 @@ int __thread__set_comm(struct thread *thread, const char *str, u64 timestamp,
 		if (!new)
 			return -ENOMEM;
 		list_add(&new->list, &thread->comm_list);
+
+		if (exec)
+			unwind__flush_access(thread);
 	}
 
 	thread->comm_set = true;
tools/perf/util/unwind-libunwind.c +12 -0
index d9874465206b..2d52af98bc8d 100644
@@ -538,11 +538,23 @@ int unwind__prepare_access(struct thread *thread)
 		return -ENOMEM;
 	}
 
+	unw_set_caching_policy(addr_space, UNW_CACHE_GLOBAL);
 	thread__set_priv(thread, addr_space);
 
 	return 0;
 }
 
+void unwind__flush_access(struct thread *thread)
+{
+	unw_addr_space_t addr_space;
+
+	if (callchain_param.record_mode != CALLCHAIN_DWARF)
+		return;
+
+	addr_space = thread__priv(thread);
+	unw_flush_cache(addr_space, 0, 0);
+}
+
 void unwind__finish_access(struct thread *thread)
 {
 	unw_addr_space_t addr_space;
tools/perf/util/unwind.h +3 -0
index 4b99c6280c2a..d68f24d4f01b 100644
@@ -23,6 +23,7 @@ int unwind__get_entries(unwind_entry_cb_t cb, void *arg,
 #ifdef HAVE_LIBUNWIND_SUPPORT
 int libunwind__arch_reg_id(int regnum);
 int unwind__prepare_access(struct thread *thread);
+void unwind__flush_access(struct thread *thread);
 void unwind__finish_access(struct thread *thread);
 #else
 static inline int unwind__prepare_access(struct thread *thread)
@@ -30,6 +31,7 @@ static inline int unwind__prepare_access(struct thread *thread)
 	return 0;
 }
 
+static inline void unwind__flush_access(struct thread *thread) {}
 static inline void unwind__finish_access(struct thread *thread) {}
 #endif
 #else
@@ -49,6 +51,7 @@ static inline int unwind__prepare_access(struct thread *thread)
 	return 0;
 }
 
+static inline void unwind__flush_access(struct thread *thread) {}
 static inline void unwind__finish_access(struct thread *thread) {}
 #endif /* HAVE_DWARF_UNWIND_SUPPORT */
 #endif /* __UNWIND_H */
Signature · 1 line
2.1.0
#6 lore raw

[tip:perf/core] perf callchain: Use global caching provided by libunwind

perf callchain: Use global caching provided by libunwind
Commit-ID:  380b5143ab76de71572c7a30e68c8e22b94bee52
Gitweb:     http://git.kernel.org/tip/380b5143ab76de71572c7a30e68c8e22b94bee52
Author:     Namhyung Kim <[email protected]>
AuthorDate: Mon, 6 Oct 2014 09:46:01 +0900
Committer:  Arnaldo Carvalho de Melo <[email protected]>
CommitDate: Wed, 29 Oct 2014 10:25:22 -0200

perf callchain: Use global caching provided by libunwind

The libunwind provides two caching policy which are global and per-thread. As perf unwinds callchains in a single thread, it'd sufficient to use global caching.

This speeds up my perf report from 14s to 7s on a ~260MB data file. Although the output sometimes contains a slight difference (~0.01% in terms of number of lines printed) on callchains which were not resolved.

---
 tools/perf/util/thread.c           |  3 +++
 tools/perf/util/unwind-libunwind.c | 12 ++++++++++++
 tools/perf/util/unwind.h           |  3 +++
 3 files changed, 18 insertions(+)
tools/perf/util/thread.c +3 -0
index 2b7b2d9..c414117 100644
@@ -117,6 +117,9 @@ int __thread__set_comm(struct thread *thread, const char *str, u64 timestamp,
 		if (!new)
 			return -ENOMEM;
 		list_add(&new->list, &thread->comm_list);
+
+		if (exec)
+			unwind__flush_access(thread);
 	}
 
 	thread->comm_set = true;
tools/perf/util/unwind-libunwind.c +12 -0
index e060386..4d45c0d 100644
@@ -539,11 +539,23 @@ int unwind__prepare_access(struct thread *thread)
 		return -ENOMEM;
 	}
 
+	unw_set_caching_policy(addr_space, UNW_CACHE_GLOBAL);
 	thread__set_priv(thread, addr_space);
 
 	return 0;
 }
 
+void unwind__flush_access(struct thread *thread)
+{
+	unw_addr_space_t addr_space;
+
+	if (callchain_param.record_mode != CALLCHAIN_DWARF)
+		return;
+
+	addr_space = thread__priv(thread);
+	unw_flush_cache(addr_space, 0, 0);
+}
+
 void unwind__finish_access(struct thread *thread)
 {
 	unw_addr_space_t addr_space;
tools/perf/util/unwind.h +3 -0
index c17c485..f50b737 100644
@@ -23,6 +23,7 @@ int unwind__get_entries(unwind_entry_cb_t cb, void *arg,
 #ifdef HAVE_LIBUNWIND_SUPPORT
 int libunwind__arch_reg_id(int regnum);
 int unwind__prepare_access(struct thread *thread);
+void unwind__flush_access(struct thread *thread);
 void unwind__finish_access(struct thread *thread);
 #else
 static inline int unwind__prepare_access(struct thread *thread __maybe_unused)
@@ -30,6 +31,7 @@ static inline int unwind__prepare_access(struct thread *thread __maybe_unused)
 	return 0;
 }
 
+static inline void unwind__flush_access(struct thread *thread __maybe_unused) {}
 static inline void unwind__finish_access(struct thread *thread __maybe_unused) {}
 #endif
 #else
@@ -49,6 +51,7 @@ static inline int unwind__prepare_access(struct thread *thread __maybe_unused)
 	return 0;
 }
 
+static inline void unwind__flush_access(struct thread *thread __maybe_unused) {}
 static inline void unwind__finish_access(struct thread *thread __maybe_unused) {}
 #endif /* HAVE_DWARF_UNWIND_SUPPORT */
 #endif /* __UNWIND_H */
author maintainer
#7 lore raw

PATCH 4/5 perf kvm: Use thread_{,_set}_priv helpers

In reply to Namhyung Kim

This is mechanical changes only for accounting access to thread->priv properly in the source level.

---
 tools/perf/builtin-kvm.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)
tools/perf/builtin-kvm.c +3 -3
index d8bf2271f4ea..d9b0743180db 100644
@@ -376,7 +376,7 @@ struct vcpu_event_record *per_vcpu_record(struct thread *thread,
 					  struct perf_sample *sample)
 {
 	/* Only kvm_entry records vcpu id. */
-	if (!thread->priv && kvm_entry_event(evsel)) {
+	if (!thread__priv(thread) && kvm_entry_event(evsel)) {
 		struct vcpu_event_record *vcpu_record;
 
 		vcpu_record = zalloc(sizeof(*vcpu_record));
@@ -386,10 +386,10 @@ struct vcpu_event_record *per_vcpu_record(struct thread *thread,
 		}
 
 		vcpu_record->vcpu_id = perf_evsel__intval(evsel, sample, VCPU_ID);
-		thread->priv = vcpu_record;
+		thread__set_priv(thread, vcpu_record);
 	}
 
-	return thread->priv;
+	return thread__priv(thread);
 }
 
 static bool handle_kvm_event(struct perf_kvm_stat *kvm,
Signature · 1 line
2.1.0
#8 lore raw

[tip:perf/urgent] perf kvm: Use thread_{,_set}_priv helpers

perf kvm: Use thread_{,_set}_priv helpers
Commit-ID:  69e865c353b226dbedf319ae6d1ab8fb3510fa25
Gitweb:     http://git.kernel.org/tip/69e865c353b226dbedf319ae6d1ab8fb3510fa25
Author:     Namhyung Kim <[email protected]>
AuthorDate: Mon, 6 Oct 2014 09:46:02 +0900
Committer:  Arnaldo Carvalho de Melo <[email protected]>
CommitDate: Wed, 15 Oct 2014 17:39:01 -0300

perf kvm: Use thread_{,_set}_priv helpers

This is mechanical changes only for accounting access to thread->priv properly in the source level.

---
 tools/perf/builtin-kvm.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)
tools/perf/builtin-kvm.c +3 -3
index 460a4ce..ef9fc15 100644
@@ -376,7 +376,7 @@ struct vcpu_event_record *per_vcpu_record(struct thread *thread,
 					  struct perf_sample *sample)
 {
 	/* Only kvm_entry records vcpu id. */
-	if (!thread->priv && kvm_entry_event(evsel)) {
+	if (!thread__priv(thread) && kvm_entry_event(evsel)) {
 		struct vcpu_event_record *vcpu_record;
 
 		vcpu_record = zalloc(sizeof(*vcpu_record));
@@ -386,10 +386,10 @@ struct vcpu_event_record *per_vcpu_record(struct thread *thread,
 		}
 
 		vcpu_record->vcpu_id = perf_evsel__intval(evsel, sample, VCPU_ID);
-		thread->priv = vcpu_record;
+		thread__set_priv(thread, vcpu_record);
 	}
 
-	return thread->priv;
+	return thread__priv(thread);
 }
 
 static bool handle_kvm_event(struct perf_kvm_stat *kvm,
author maintainer
#9 lore raw

PATCH 5/5 perf trace: Use thread_{,_set}_priv helpers

In reply to Namhyung Kim

This is mechanical changes only for accounting access to thread->priv properly in the source level.

---
 tools/perf/builtin-trace.c | 16 ++++++++--------
 1 file changed, 8 insertions(+), 8 deletions(-)
tools/perf/builtin-trace.c +8 -8
index 09bcf2393910..fb126459b134 100644
@@ -1189,13 +1189,13 @@ static struct thread_trace *thread__trace(struct thread *thread, FILE *fp)
 	if (thread == NULL)
 		goto fail;
 
-	if (thread->priv == NULL)
-		thread->priv = thread_trace__new();
+	if (thread__priv(thread) == NULL)
+		thread__set_priv(thread, thread_trace__new());
 		
-	if (thread->priv == NULL)
+	if (thread__priv(thread) == NULL)
 		goto fail;
 
-	ttrace = thread->priv;
+	ttrace = thread__priv(thread);
 	++ttrace->nr_events;
 
 	return ttrace;
@@ -1248,7 +1248,7 @@ struct trace {
 
 static int trace__set_fd_pathname(struct thread *thread, int fd, const char *pathname)
 {
-	struct thread_trace *ttrace = thread->priv;
+	struct thread_trace *ttrace = thread__priv(thread);
 
 	if (fd > ttrace->paths.max) {
 		char **npath = realloc(ttrace->paths.table, (fd + 1) * sizeof(char *));
@@ -1301,7 +1301,7 @@ static int thread__read_fd_path(struct thread *thread, int fd)
 static const char *thread__fd_path(struct thread *thread, int fd,
 				   struct trace *trace)
 {
-	struct thread_trace *ttrace = thread->priv;
+	struct thread_trace *ttrace = thread__priv(thread);
 
 	if (ttrace == NULL)
 		return NULL;
@@ -1338,7 +1338,7 @@ static size_t syscall_arg__scnprintf_close_fd(char *bf, size_t size,
 {
 	int fd = arg->val;
 	size_t printed = syscall_arg__scnprintf_fd(bf, size, arg);
-	struct thread_trace *ttrace = arg->thread->priv;
+	struct thread_trace *ttrace = thread__priv(arg->thread);
 
 	if (ttrace && fd >= 0 && fd <= ttrace->paths.max)
 		zfree(&ttrace->paths.table[fd]);
@@ -2381,7 +2381,7 @@ static int trace__fprintf_one_thread(struct thread *thread, void *priv)
 	FILE *fp = data->fp;
 	size_t printed = data->printed;
 	struct trace *trace = data->trace;
-	struct thread_trace *ttrace = thread->priv;
+	struct thread_trace *ttrace = thread__priv(thread);
 	double ratio;
 
 	if (ttrace == NULL)
Signature · 1 line
2.1.0
#10 lore raw

[tip:perf/urgent] perf trace: Use thread_{,_set}_priv helpers

perf trace: Use thread_{,_set}_priv helpers
Commit-ID:  89dceb22c098bd6afa9f3054aedddb9e1349392b
Gitweb:     http://git.kernel.org/tip/89dceb22c098bd6afa9f3054aedddb9e1349392b
Author:     Namhyung Kim <[email protected]>
AuthorDate: Mon, 6 Oct 2014 09:46:03 +0900
Committer:  Arnaldo Carvalho de Melo <[email protected]>
CommitDate: Wed, 15 Oct 2014 17:39:02 -0300

perf trace: Use thread_{,_set}_priv helpers

This is mechanical changes only for accounting access to thread->priv properly in the source level.

---
 tools/perf/builtin-trace.c | 16 ++++++++--------
 1 file changed, 8 insertions(+), 8 deletions(-)
tools/perf/builtin-trace.c +8 -8
index 09bcf23..fb12645 100644
@@ -1189,13 +1189,13 @@ static struct thread_trace *thread__trace(struct thread *thread, FILE *fp)
 	if (thread == NULL)
 		goto fail;
 
-	if (thread->priv == NULL)
-		thread->priv = thread_trace__new();
+	if (thread__priv(thread) == NULL)
+		thread__set_priv(thread, thread_trace__new());
 		
-	if (thread->priv == NULL)
+	if (thread__priv(thread) == NULL)
 		goto fail;
 
-	ttrace = thread->priv;
+	ttrace = thread__priv(thread);
 	++ttrace->nr_events;
 
 	return ttrace;
@@ -1248,7 +1248,7 @@ struct trace {
 
 static int trace__set_fd_pathname(struct thread *thread, int fd, const char *pathname)
 {
-	struct thread_trace *ttrace = thread->priv;
+	struct thread_trace *ttrace = thread__priv(thread);
 
 	if (fd > ttrace->paths.max) {
 		char **npath = realloc(ttrace->paths.table, (fd + 1) * sizeof(char *));
@@ -1301,7 +1301,7 @@ static int thread__read_fd_path(struct thread *thread, int fd)
 static const char *thread__fd_path(struct thread *thread, int fd,
 				   struct trace *trace)
 {
-	struct thread_trace *ttrace = thread->priv;
+	struct thread_trace *ttrace = thread__priv(thread);
 
 	if (ttrace == NULL)
 		return NULL;
@@ -1338,7 +1338,7 @@ static size_t syscall_arg__scnprintf_close_fd(char *bf, size_t size,
 {
 	int fd = arg->val;
 	size_t printed = syscall_arg__scnprintf_fd(bf, size, arg);
-	struct thread_trace *ttrace = arg->thread->priv;
+	struct thread_trace *ttrace = thread__priv(arg->thread);
 
 	if (ttrace && fd >= 0 && fd <= ttrace->paths.max)
 		zfree(&ttrace->paths.table[fd]);
@@ -2381,7 +2381,7 @@ static int trace__fprintf_one_thread(struct thread *thread, void *priv)
 	FILE *fp = data->fp;
 	size_t printed = data->printed;
 	struct trace *trace = data->trace;
-	struct thread_trace *ttrace = thread->priv;
+	struct thread_trace *ttrace = thread__priv(thread);
 	double ratio;
 
 	if (ttrace == NULL)
Acked-by on the v1 series
#11 lore raw
In reply to Namhyung Kim
Quoted 19 lines · Namhyung Kim

Hello,

This is v4 for libunwind callchain post processing speed up. It was able to reduce 50% of processing time by using global cache provided in libunwind. In this version, I decided to use the existing callchain_param.record_mode instead of adding a new field in the symbol_conf.

The patch 4 and 5 are just cleanups so that we can easily find out that which part of code uses the thread->priv.

You can also get it from 'perf/callchain-unwind-v4' branch on my tree:

git://git.kernel.org/pub/scm/linux/kernel/git/namhyung/linux-perf.git

Thanks,
Namhyung

Quoted 6 lines

Namhyung Kim (5):
perf report: Set callchain_param.record_mode for future use perf callchain: Create an address space per thread perf callchain: Use global caching provided by libunwind perf kvm: Use thread_{,_set}_priv helpers
perf trace: Use thread_{,_set}_priv helpers

thanks,
jirka

#12 lore raw

Em Mon, Oct 13, 2014 at 08:11:58PM +0200, Jiri Olsa escreveu:

Quoted 9 lines · Namhyung Kim
Quoted 6 lines

Namhyung Kim (5):
perf report: Set callchain_param.record_mode for future use perf callchain: Create an address space per thread perf callchain: Use global caching provided by libunwind perf kvm: Use thread_{,_set}_priv helpers
perf trace: Use thread_{,_set}_priv helpers

Ok, will merge/test/put it in my next patchkit,

- Arnaldo

maintainer Applied
#13 lore raw
In reply to Jiri Olsa

Em Mon, Oct 13, 2014 at 08:11:58PM +0200, Jiri Olsa escreveu:

Quoted 20 lines · Namhyung Kim
Quoted 19 lines

Hello,

This is v4 for libunwind callchain post processing speed up. It was able to reduce 50% of processing time by using global cache provided in libunwind. In this version, I decided to use the existing callchain_param.record_mode instead of adding a new field in the symbol_conf.

The patch 4 and 5 are just cleanups so that we can easily find out that which part of code uses the thread->priv.

You can also get it from 'perf/callchain-unwind-v4' branch on my tree:

git://git.kernel.org/pub/scm/linux/kernel/git/namhyung/linux-perf.git

Thanks,
Namhyung

Quoted 8 lines
Quoted 6 lines

Namhyung Kim (5):
perf report: Set callchain_param.record_mode for future use perf callchain: Create an address space per thread perf callchain: Use global caching provided by libunwind perf kvm: Use thread_{,_set}_priv helpers
perf trace: Use thread_{,_set}_priv helpers

Thanks, applied.

- Arnaldo

#14 lore raw

Em Wed, Oct 15, 2014 at 04:24:41PM -0300, Arnaldo Carvalho de Melo escreveu:

Quoted 28 lines

Em Mon, Oct 13, 2014 at 08:11:58PM +0200, Jiri Olsa escreveu:

Quoted 27 lines · Namhyung Kim
Quoted 25 lines

Hello,

This is v4 for libunwind callchain post processing speed up. It was able to reduce 50% of processing time by using global cache provided in libunwind. In this version, I decided to use the existing callchain_param.record_mode instead of adding a new field in the symbol_conf.

The patch 4 and 5 are just cleanups so that we can easily find out that which part of code uses the thread->priv.

You can also get it from 'perf/callchain-unwind-v4' branch on my tree:

git://git.kernel.org/pub/scm/linux/kernel/git/namhyung/linux-perf.git

Thanks,
Namhyung

Namhyung Kim (5):
perf report: Set callchain_param.record_mode for future use perf callchain: Create an address space per thread perf callchain: Use global caching provided by libunwind perf kvm: Use thread_{,_set}_priv helpers
perf trace: Use thread_{,_set}_priv helpers

Quoted 3 lines
Quoted 1 line

Thanks, applied.

Next time please run: (I'm fixing this up this time)

[acme@zoo linux]$ time make -C tools/perf build-test
make: Entering directory `/home/git/linux/tools/perf'
- make_pure: cd . && make -f Makefile DESTDIR=/tmp/tmp.RXWD6DlpLb
- make_clean_all: cd . && make -f Makefile DESTDIR=/tmp/tmp.Xb83Au0dtp clean all
- make_python_perf_so: cd . && make -f Makefile DESTDIR=/tmp/tmp.JjiHtvNXGP python/perf.so
- make_debug: cd . && make -f Makefile DESTDIR=/tmp/tmp.4mbBkoB1Jz DEBUG=1
- make_no_libperl: cd . && make -f Makefile DESTDIR=/tmp/tmp.2I0aglyOsB NO_LIBPERL=1
- make_no_libpython: cd . && make -f Makefile DESTDIR=/tmp/tmp.NDG6pNk8J0 NO_LIBPYTHON=1
- make_no_scripts: cd . && make -f Makefile DESTDIR=/tmp/tmp.00jcSmJ2uP NO_LIBPYTHON=1 NO_LIBPERL=1
- make_no_newt: cd . && make -f Makefile DESTDIR=/tmp/tmp.rpiHSaU8sm NO_NEWT=1
- make_no_slang: cd . && make -f Makefile DESTDIR=/tmp/tmp.eq62JNazPt NO_SLANG=1
- make_no_gtk2: cd . && make -f Makefile DESTDIR=/tmp/tmp.D3uwXogwqj NO_GTK2=1
- make_no_ui: cd . && make -f Makefile DESTDIR=/tmp/tmp.0Dw4cAw1RZ NO_NEWT=1 NO_SLANG=1 NO_GTK2=1
- make_no_demangle: cd . && make -f Makefile DESTDIR=/tmp/tmp.6kFBIeDeSB NO_DEMANGLE=1
- make_no_libelf: cd . && make -f Makefile DESTDIR=/tmp/tmp.KTyAsiNqK5 NO_LIBELF=1
cd . && make -f Makefile DESTDIR=/tmp/tmp.KTyAsiNqK5 NO_LIBELF=1
BUILD: Doing 'make -j4' parallel build
config/Makefile:396: Disabling post unwind, no support found.

Auto-detecting system features:

...                         dwarf: [ on  ]
...                         glibc: [ on  ]
...                          gtk2: [ on  ]
...                      libaudit: [ on  ]
...                        libbfd: [ on  ]
...                        libelf: [ on  ]
...                       libnuma: [ on  ]
...                       libperl: [ on  ]
...                     libpython: [ on  ]
...                      libslang: [ on  ]
...                     libunwind: [ on  ]
...            libdw-dwarf-unwind: [ on  ]
  GEN      common-cmds.h
  BISON    util/pmu-bison.c
  FLAGS:   * new build flags or prefix
  BISON    util/parse-events-bison.c
  CC       util/path.o
  CC       util/rbtree.o
  CC       util/bitmap.o
  CC       util/hweight.o
  CC       util/run-command.o
  CC       util/quote.o
  CC       util/strbuf.o
  CC       util/strlist.o
  CC       util/string.o
  CC       util/strfilter.o
  CC       util/top.o
  CC       util/usage.o
  CC       util/wrapper.o
  CC       util/sigchain.o
  CC       util/dso.o
  CC       util/symbol.o
  CC       util/color.o
  CC       util/pager.o
  CC       util/header.o
  CC       util/callchain.o
  CC       util/values.o
  CC       util/debug.o
  CC       util/machine.o

PERF_VERSION = 3.17.ga3a146
CC util/map.o
In file included from util/machine.c:14:0:
util/unwind.h: In function ‘unwind__prepare_access’:
util/unwind.h:47:57: error: unused parameter ‘thread’ [-Werror=unused-parameter]
static inline int unwind__prepare_access(struct thread *thread)

                                                         ^

util/unwind.h: In function ‘unwind__finish_access’:
util/unwind.h:52:57: error: unused parameter ‘thread’ [-Werror=unused-parameter]
static inline void unwind__finish_access(struct thread *thread) {}

                                                         ^

cc1: all warnings being treated as errors make[3]: *** [util/machine.o] Error 1 make[3]: *** Waiting for unfinished jobs.... make[2]: *** [all] Error 2
test: test -x ./perf
make[1]: *** [make_no_libelf] Error 1
make: *** [build-test] Error 2
make: Leaving directory `/home/git/linux/tools/perf'

real 4m40.869s
user 8m57.124s
sys 1m12.853s
[acme@zoo linux]$

author maintainer
#15 lore raw

Hi Arnaldo,

Quoted 29 lines · Arnaldo Carvalho de Melo

Em Wed, Oct 15, 2014 at 04:24:41PM -0300, Arnaldo Carvalho de Melo escreveu:

Quoted 28 lines

Em Mon, Oct 13, 2014 at 08:11:58PM +0200, Jiri Olsa escreveu:

Quoted 27 lines · Namhyung Kim
Quoted 25 lines

Hello,

This is v4 for libunwind callchain post processing speed up. It was able to reduce 50% of processing time by using global cache provided in libunwind. In this version, I decided to use the existing callchain_param.record_mode instead of adding a new field in the symbol_conf.

The patch 4 and 5 are just cleanups so that we can easily find out that which part of code uses the thread->priv.

You can also get it from 'perf/callchain-unwind-v4' branch on my tree:

git://git.kernel.org/pub/scm/linux/kernel/git/namhyung/linux-perf.git

Thanks,
Namhyung

Namhyung Kim (5):
perf report: Set callchain_param.record_mode for future use perf callchain: Create an address space per thread perf callchain: Use global caching provided by libunwind perf kvm: Use thread_{,_set}_priv helpers
perf trace: Use thread_{,_set}_priv helpers

Quoted 5 lines
Quoted 3 lines
Quoted 1 line

Thanks, applied.

Next time please run: (I'm fixing this up this time)

Sorry about that. I'll check it next time.

Thanks,
Namhyung

Quoted 100 lines

[acme@zoo linux]$ time make -C tools/perf build-test
make: Entering directory `/home/git/linux/tools/perf'
- make_pure: cd . && make -f Makefile DESTDIR=/tmp/tmp.RXWD6DlpLb
- make_clean_all: cd . && make -f Makefile DESTDIR=/tmp/tmp.Xb83Au0dtp clean all
- make_python_perf_so: cd . && make -f Makefile DESTDIR=/tmp/tmp.JjiHtvNXGP python/perf.so
- make_debug: cd . && make -f Makefile DESTDIR=/tmp/tmp.4mbBkoB1Jz DEBUG=1
- make_no_libperl: cd . && make -f Makefile DESTDIR=/tmp/tmp.2I0aglyOsB NO_LIBPERL=1
- make_no_libpython: cd . && make -f Makefile DESTDIR=/tmp/tmp.NDG6pNk8J0 NO_LIBPYTHON=1
- make_no_scripts: cd . && make -f Makefile DESTDIR=/tmp/tmp.00jcSmJ2uP NO_LIBPYTHON=1 NO_LIBPERL=1
- make_no_newt: cd . && make -f Makefile DESTDIR=/tmp/tmp.rpiHSaU8sm NO_NEWT=1
- make_no_slang: cd . && make -f Makefile DESTDIR=/tmp/tmp.eq62JNazPt NO_SLANG=1
- make_no_gtk2: cd . && make -f Makefile DESTDIR=/tmp/tmp.D3uwXogwqj NO_GTK2=1
- make_no_ui: cd . && make -f Makefile DESTDIR=/tmp/tmp.0Dw4cAw1RZ NO_NEWT=1 NO_SLANG=1 NO_GTK2=1
- make_no_demangle: cd . && make -f Makefile DESTDIR=/tmp/tmp.6kFBIeDeSB NO_DEMANGLE=1
- make_no_libelf: cd . && make -f Makefile DESTDIR=/tmp/tmp.KTyAsiNqK5 NO_LIBELF=1
cd . && make -f Makefile DESTDIR=/tmp/tmp.KTyAsiNqK5 NO_LIBELF=1
BUILD: Doing 'make -j4' parallel build
config/Makefile:396: Disabling post unwind, no support found.

Auto-detecting system features:

...                         dwarf: [ on  ]
...                         glibc: [ on  ]
...                          gtk2: [ on  ]
...                      libaudit: [ on  ]
...                        libbfd: [ on  ]
...                        libelf: [ on  ]
...                       libnuma: [ on  ]
...                       libperl: [ on  ]
...                     libpython: [ on  ]
...                      libslang: [ on  ]
...                     libunwind: [ on  ]
...            libdw-dwarf-unwind: [ on  ]
  GEN      common-cmds.h
  BISON    util/pmu-bison.c
  FLAGS:   * new build flags or prefix
  BISON    util/parse-events-bison.c
  CC       util/path.o
  CC       util/rbtree.o
  CC       util/bitmap.o
  CC       util/hweight.o
  CC       util/run-command.o
  CC       util/quote.o
  CC       util/strbuf.o
  CC       util/strlist.o
  CC       util/string.o
  CC       util/strfilter.o
  CC       util/top.o
  CC       util/usage.o
  CC       util/wrapper.o
  CC       util/sigchain.o
  CC       util/dso.o
  CC       util/symbol.o
  CC       util/color.o
  CC       util/pager.o
  CC       util/header.o
  CC       util/callchain.o
  CC       util/values.o
  CC       util/debug.o
  CC       util/machine.o

PERF_VERSION = 3.17.ga3a146
CC util/map.o
In file included from util/machine.c:14:0:
util/unwind.h: In function ‘unwind__prepare_access’:
util/unwind.h:47:57: error: unused parameter ‘thread’ [-Werror=unused-parameter]
static inline int unwind__prepare_access(struct thread *thread)

                                                         ^

util/unwind.h: In function ‘unwind__finish_access’:
util/unwind.h:52:57: error: unused parameter ‘thread’ [-Werror=unused-parameter]
static inline void unwind__finish_access(struct thread *thread) {}

                                                         ^

cc1: all warnings being treated as errors make[3]: *** [util/machine.o] Error 1 make[3]: *** Waiting for unfinished jobs.... make[2]: *** [all] Error 2
test: test -x ./perf
make[1]: *** [make_no_libelf] Error 1
make: *** [build-test] Error 2
make: Leaving directory `/home/git/linux/tools/perf'

real    4m40.869s
user    8m57.124s
sys     1m12.853s

[acme@zoo linux]$

Signature · 2 lines
Thanks,
Namhyung
author maintainer
#16 lore raw
In reply to Arnaldo Carvalho de Melo

Hi Arnaldo,

Quoted 3 lines · Arnaldo Carvalho de Melo

Next time please run: (I'm fixing this up this time)

[acme@zoo linux]$ time make -C tools/perf build-test

...

Quoted 11 lines

In file included from util/machine.c:14:0:
util/unwind.h: In function ‘unwind__prepare_access’:
util/unwind.h:47:57: error: unused parameter ‘thread’ [-Werror=unused-parameter]
static inline int unwind__prepare_access(struct thread *thread)

                                                         ^

util/unwind.h: In function ‘unwind__finish_access’:
util/unwind.h:52:57: error: unused parameter ‘thread’ [-Werror=unused-parameter]
static inline void unwind__finish_access(struct thread *thread) {}

                                                         ^
Quoted 8 lines

cc1: all warnings being treated as errors make[3]: *** [util/machine.o] Error 1 make[3]: *** Waiting for unfinished jobs.... make[2]: *** [all] Error 2
test: test -x ./perf
make[1]: *** [make_no_libelf] Error 1
make: *** [build-test] Error 2
make: Leaving directory `/home/git/linux/tools/perf'

So it seems you didn't include the patch 3/5 which is the key of this series.. Could you please check it again?

Thanks,
Namhyung

#17 lore raw

Em Wed, Oct 22, 2014 at 10:34:27AM +0900, Namhyung Kim escreveu:

Quoted 27 lines

Hi Arnaldo,

Quoted 3 lines · Arnaldo Carvalho de Melo

Next time please run: (I'm fixing this up this time)

[acme@zoo linux]$ time make -C tools/perf build-test

...

Quoted 11 lines

In file included from util/machine.c:14:0:
util/unwind.h: In function ‘unwind__prepare_access’:
util/unwind.h:47:57: error: unused parameter ‘thread’ [-Werror=unused-parameter]
static inline int unwind__prepare_access(struct thread *thread)

                                                         ^

util/unwind.h: In function ‘unwind__finish_access’:
util/unwind.h:52:57: error: unused parameter ‘thread’ [-Werror=unused-parameter]
static inline void unwind__finish_access(struct thread *thread) {}

                                                         ^
Quoted 8 lines

cc1: all warnings being treated as errors make[3]: *** [util/machine.o] Error 1 make[3]: *** Waiting for unfinished jobs.... make[2]: *** [all] Error 2
test: test -x ./perf
make[1]: *** [make_no_libelf] Error 1
make: *** [build-test] Error 2
make: Leaving directory `/home/git/linux/tools/perf'

Quoted 2 lines

So it seems you didn't include the patch 3/5 which is the key of this series.. Could you please check it again?

I'll check it tomorrow.

- Arnaldo

#18 lore raw
In reply to Namhyung Kim

Em Wed, Oct 22, 2014 at 10:34:27AM +0900, Namhyung Kim escreveu:

Quoted 27 lines

Hi Arnaldo,

Quoted 3 lines · Arnaldo Carvalho de Melo

Next time please run: (I'm fixing this up this time)

[acme@zoo linux]$ time make -C tools/perf build-test

...

Quoted 11 lines

In file included from util/machine.c:14:0:
util/unwind.h: In function ‘unwind__prepare_access’:
util/unwind.h:47:57: error: unused parameter ‘thread’ [-Werror=unused-parameter]
static inline int unwind__prepare_access(struct thread *thread)

                                                         ^

util/unwind.h: In function ‘unwind__finish_access’:
util/unwind.h:52:57: error: unused parameter ‘thread’ [-Werror=unused-parameter]
static inline void unwind__finish_access(struct thread *thread) {}

                                                         ^
Quoted 8 lines

cc1: all warnings being treated as errors make[3]: *** [util/machine.o] Error 1 make[3]: *** Waiting for unfinished jobs.... make[2]: *** [all] Error 2
test: test -x ./perf
make[1]: *** [make_no_libelf] Error 1
make: *** [build-test] Error 2
make: Leaving directory `/home/git/linux/tools/perf'

Quoted 2 lines

So it seems you didn't include the patch 3/5 which is the key of this series.. Could you please check it again?

Yeah, I'm adding it now, and in this case as well the __maybe_unused was missing, added.

I'll push later and will drop you a note, so that you can, please, check if the end result is sane.

Sorry for the slip up,

- Arnaldo

author maintainer
#19 lore raw
Quoted 28 lines · Arnaldo Carvalho de Melo

Em Wed, Oct 22, 2014 at 10:34:27AM +0900, Namhyung Kim escreveu:

Quoted 27 lines

Hi Arnaldo,

Quoted 3 lines · Arnaldo Carvalho de Melo

Next time please run: (I'm fixing this up this time)

[acme@zoo linux]$ time make -C tools/perf build-test

...

Quoted 19 lines

In file included from util/machine.c:14:0:
util/unwind.h: In function ‘unwind__prepare_access’:
util/unwind.h:47:57: error: unused parameter ‘thread’ [-Werror=unused-parameter]
static inline int unwind__prepare_access(struct thread *thread)

                                                         ^

util/unwind.h: In function ‘unwind__finish_access’:
util/unwind.h:52:57: error: unused parameter ‘thread’ [-Werror=unused-parameter]
static inline void unwind__finish_access(struct thread *thread) {}

                                                         ^

cc1: all warnings being treated as errors make[3]: *** [util/machine.o] Error 1 make[3]: *** Waiting for unfinished jobs.... make[2]: *** [all] Error 2
test: test -x ./perf
make[1]: *** [make_no_libelf] Error 1
make: *** [build-test] Error 2
make: Leaving directory `/home/git/linux/tools/perf'

Quoted 5 lines
Quoted 2 lines

So it seems you didn't include the patch 3/5 which is the key of this series.. Could you please check it again?

Yeah, I'm adding it now, and in this case as well the __maybe_unused was missing, added.

It was my bad to miss the annotation, sorry.

Quoted 3 lines

I'll push later and will drop you a note, so that you can, please, check if the end result is sane.

Thank you!

Quoted 1 line

Sorry for the slip up,

No problem. :)

Thanks,
Namhyung

#20 lore raw

Em Fri, Oct 24, 2014 at 09:44:17AM +0900, Namhyung Kim escreveu:

Quoted 5 lines · Arnaldo Carvalho de Melo
Quoted 2 lines

I'll push later and will drop you a note, so that you can, please, check if the end result is sane.

Thank you!

It should be on my perf/core branch by now.

Quoted 3 lines
Quoted 1 line

Sorry for the slip up,

No problem. :)

:-)

- Arnaldo

author maintainer
#21 lore raw
Quoted 8 lines · Arnaldo Carvalho de Melo

Em Fri, Oct 24, 2014 at 09:44:17AM +0900, Namhyung Kim escreveu:

Quoted 5 lines · Arnaldo Carvalho de Melo
Quoted 2 lines

I'll push later and will drop you a note, so that you can, please, check if the end result is sane.

Thank you!

It should be on my perf/core branch by now.

Looks ok to me.

Thanks,
Namhyung