* [PATCHSET 0/5] perf tools: Speed up dwarf callchain post-unwinding for libunwind (v3)
@ 2014-10-02 3:08 Namhyung Kim
2014-10-02 3:08 ` [PATCH 1/5] perf report: Set callchain_param.record_mode for future use Namhyung Kim
` (4 more replies)
0 siblings, 5 replies; 8+ messages in thread
From: Namhyung Kim @ 2014-10-02 3:08 UTC (permalink / raw)
To: Arnaldo Carvalho de Melo
Cc: Peter Zijlstra, Ingo Molnar, Paul Mackerras, Namhyung Kim,
Namhyung Kim, LKML, Jiri Olsa, David Ahern, Frederic Weisbecker
Hello,
This is v3 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-v3' 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 | 6 +++++
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, 94 insertions(+), 18 deletions(-)
--
2.1.0
^ permalink raw reply [flat|nested] 8+ messages in thread
* [PATCH 1/5] perf report: Set callchain_param.record_mode for future use
2014-10-02 3:08 [PATCHSET 0/5] perf tools: Speed up dwarf callchain post-unwinding for libunwind (v3) Namhyung Kim
@ 2014-10-02 3:08 ` Namhyung Kim
2014-10-02 3:12 ` [PATCH v3.1 " Namhyung Kim
2014-10-02 3:08 ` [PATCH 2/5] perf callchain: Create an address space per thread Namhyung Kim
` (3 subsequent siblings)
4 siblings, 1 reply; 8+ messages in thread
From: Namhyung Kim @ 2014-10-02 3:08 UTC (permalink / raw)
To: Arnaldo Carvalho de Melo
Cc: Peter Zijlstra, Ingo Molnar, Paul Mackerras, Namhyung Kim,
Namhyung Kim, LKML, Jiri Olsa, David Ahern, Frederic Weisbecker,
Jean Pihet
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 <jolsa@redhat.com>
Cc: David Ahern <dsahern@gmail.com>
Cc: Jean Pihet <jean.pihet@linaro.org>
Cc: Frederic Weisbecker <fweisbec@gmail.com>
Signed-off-by: Namhyung Kim <namhyung@kernel.org>
---
tools/perf/builtin-report.c | 6 ++++++
1 file changed, 6 insertions(+)
diff --git a/tools/perf/builtin-report.c b/tools/perf/builtin-report.c
index ac145fae0521..495168e73d4a 100644
--- a/tools/perf/builtin-report.c
+++ b/tools/perf/builtin-report.c
@@ -257,6 +257,12 @@ 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)
+ callchain_param.record_mode = CALLCHAIN_DWARF;
+ else
+ callchain_param.record_mode = CALLCHAIN_FP;
+ }
return 0;
}
--
2.1.0
^ permalink raw reply [flat|nested] 8+ messages in thread
* [PATCH 2/5] perf callchain: Create an address space per thread
2014-10-02 3:08 [PATCHSET 0/5] perf tools: Speed up dwarf callchain post-unwinding for libunwind (v3) Namhyung Kim
2014-10-02 3:08 ` [PATCH 1/5] perf report: Set callchain_param.record_mode for future use Namhyung Kim
@ 2014-10-02 3:08 ` Namhyung Kim
2014-10-02 3:08 ` [PATCH 3/5] perf callchain: Use global caching provided by libunwind Namhyung Kim
` (2 subsequent siblings)
4 siblings, 0 replies; 8+ messages in thread
From: Namhyung Kim @ 2014-10-02 3:08 UTC (permalink / raw)
To: Arnaldo Carvalho de Melo
Cc: Peter Zijlstra, Ingo Molnar, Paul Mackerras, Namhyung Kim,
Namhyung Kim, LKML, Jiri Olsa, David Ahern, Frederic Weisbecker,
Arun Sharma, Jean Pihet
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.
Acked-by: Jean Pihet <jean.pihet@linaro.org>
Cc: Jiri Olsa <jolsa@redhat.com>
Cc: Arun Sharma <asharma@fb.com>
Cc: David Ahern <dsahern@gmail.com>
Cc: Frederic Weisbecker <fweisbec@gmail.com>
Signed-off-by: Namhyung Kim <namhyung@kernel.org>
---
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(-)
diff --git a/tools/perf/util/thread.c b/tools/perf/util/thread.c
index a9df7f2c6dc9..2b7b2d91c016 100644
--- a/tools/perf/util/thread.c
+++ b/tools/perf/util/thread.c
@@ -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);
}
diff --git a/tools/perf/util/unwind-libunwind.c b/tools/perf/util/unwind-libunwind.c
index 92b56db52471..d9874465206b 100644
--- a/tools/perf/util/unwind-libunwind.c
+++ b/tools/perf/util/unwind-libunwind.c
@@ -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;
}
diff --git a/tools/perf/util/unwind.h b/tools/perf/util/unwind.h
index f03061260b4e..4b99c6280c2a 100644
--- a/tools/perf/util/unwind.h
+++ b/tools/perf/util/unwind.h
@@ -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 */
--
2.1.0
^ permalink raw reply [flat|nested] 8+ messages in thread
* [PATCH 3/5] perf callchain: Use global caching provided by libunwind
2014-10-02 3:08 [PATCHSET 0/5] perf tools: Speed up dwarf callchain post-unwinding for libunwind (v3) Namhyung Kim
2014-10-02 3:08 ` [PATCH 1/5] perf report: Set callchain_param.record_mode for future use Namhyung Kim
2014-10-02 3:08 ` [PATCH 2/5] perf callchain: Create an address space per thread Namhyung Kim
@ 2014-10-02 3:08 ` Namhyung Kim
2014-10-02 3:08 ` [PATCH 4/5] perf kvm: Use thread_{,_set}_priv helpers Namhyung Kim
2014-10-02 3:08 ` [PATCH 5/5] perf trace: " Namhyung Kim
4 siblings, 0 replies; 8+ messages in thread
From: Namhyung Kim @ 2014-10-02 3:08 UTC (permalink / raw)
To: Arnaldo Carvalho de Melo
Cc: Peter Zijlstra, Ingo Molnar, Paul Mackerras, Namhyung Kim,
Namhyung Kim, LKML, Jiri Olsa, David Ahern, Frederic Weisbecker,
Arun Sharma, Jean Pihet
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.
Acked-by: Jean Pihet <jean.pihet@linaro.org>
Cc: Jiri Olsa <jolsa@redhat.com>
Cc: Arun Sharma <asharma@fb.com>
Cc: David Ahern <dsahern@gmail.com>
Cc: Frederic Weisbecker <fweisbec@gmail.com>
Signed-off-by: Namhyung Kim <namhyung@kernel.org>
---
tools/perf/util/thread.c | 3 +++
tools/perf/util/unwind-libunwind.c | 12 ++++++++++++
tools/perf/util/unwind.h | 3 +++
3 files changed, 18 insertions(+)
diff --git a/tools/perf/util/thread.c b/tools/perf/util/thread.c
index 2b7b2d91c016..c41411726c7a 100644
--- a/tools/perf/util/thread.c
+++ b/tools/perf/util/thread.c
@@ -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;
diff --git a/tools/perf/util/unwind-libunwind.c b/tools/perf/util/unwind-libunwind.c
index d9874465206b..2d52af98bc8d 100644
--- a/tools/perf/util/unwind-libunwind.c
+++ b/tools/perf/util/unwind-libunwind.c
@@ -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;
diff --git a/tools/perf/util/unwind.h b/tools/perf/util/unwind.h
index 4b99c6280c2a..d68f24d4f01b 100644
--- a/tools/perf/util/unwind.h
+++ b/tools/perf/util/unwind.h
@@ -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 */
--
2.1.0
^ permalink raw reply [flat|nested] 8+ messages in thread
* [PATCH 4/5] perf kvm: Use thread_{,_set}_priv helpers
2014-10-02 3:08 [PATCHSET 0/5] perf tools: Speed up dwarf callchain post-unwinding for libunwind (v3) Namhyung Kim
` (2 preceding siblings ...)
2014-10-02 3:08 ` [PATCH 3/5] perf callchain: Use global caching provided by libunwind Namhyung Kim
@ 2014-10-02 3:08 ` Namhyung Kim
2014-10-02 3:08 ` [PATCH 5/5] perf trace: " Namhyung Kim
4 siblings, 0 replies; 8+ messages in thread
From: Namhyung Kim @ 2014-10-02 3:08 UTC (permalink / raw)
To: Arnaldo Carvalho de Melo
Cc: Peter Zijlstra, Ingo Molnar, Paul Mackerras, Namhyung Kim,
Namhyung Kim, LKML, Jiri Olsa, David Ahern, Frederic Weisbecker
This is mechanical changes only for accounting access to thread->priv
properly in the source level.
Cc: David Ahern <dsahern@gmail.com>
Signed-off-by: Namhyung Kim <namhyung@kernel.org>
---
tools/perf/builtin-kvm.c | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)
diff --git a/tools/perf/builtin-kvm.c b/tools/perf/builtin-kvm.c
index d8bf2271f4ea..d9b0743180db 100644
--- a/tools/perf/builtin-kvm.c
+++ b/tools/perf/builtin-kvm.c
@@ -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,
--
2.1.0
^ permalink raw reply [flat|nested] 8+ messages in thread
* [PATCH 5/5] perf trace: Use thread_{,_set}_priv helpers
2014-10-02 3:08 [PATCHSET 0/5] perf tools: Speed up dwarf callchain post-unwinding for libunwind (v3) Namhyung Kim
` (3 preceding siblings ...)
2014-10-02 3:08 ` [PATCH 4/5] perf kvm: Use thread_{,_set}_priv helpers Namhyung Kim
@ 2014-10-02 3:08 ` Namhyung Kim
4 siblings, 0 replies; 8+ messages in thread
From: Namhyung Kim @ 2014-10-02 3:08 UTC (permalink / raw)
To: Arnaldo Carvalho de Melo
Cc: Peter Zijlstra, Ingo Molnar, Paul Mackerras, Namhyung Kim,
Namhyung Kim, LKML, Jiri Olsa, David Ahern, Frederic Weisbecker
This is mechanical changes only for accounting access to thread->priv
properly in the source level.
Cc: David Ahern <dsahern@gmail.com>
Signed-off-by: Namhyung Kim <namhyung@kernel.org>
---
tools/perf/builtin-trace.c | 16 ++++++++--------
1 file changed, 8 insertions(+), 8 deletions(-)
diff --git a/tools/perf/builtin-trace.c b/tools/perf/builtin-trace.c
index 09bcf2393910..fb126459b134 100644
--- a/tools/perf/builtin-trace.c
+++ b/tools/perf/builtin-trace.c
@@ -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)
--
2.1.0
^ permalink raw reply [flat|nested] 8+ messages in thread
* [PATCH v3.1 1/5] perf report: Set callchain_param.record_mode for future use
2014-10-02 3:08 ` [PATCH 1/5] perf report: Set callchain_param.record_mode for future use Namhyung Kim
@ 2014-10-02 3:12 ` Namhyung Kim
2014-10-02 13:46 ` Jiri Olsa
0 siblings, 1 reply; 8+ messages in thread
From: Namhyung Kim @ 2014-10-02 3:12 UTC (permalink / raw)
To: Arnaldo Carvalho de Melo
Cc: Peter Zijlstra, Ingo Molnar, Paul Mackerras, Namhyung Kim,
Namhyung Kim, LKML, Jiri Olsa, David Ahern, Jean Pihet,
Frederic Weisbecker
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 <jolsa@redhat.com>
Cc: David Ahern <dsahern@gmail.com>
Cc: Jean Pihet <jean.pihet@linaro.org>
Cc: Frederic Weisbecker <fweisbec@gmail.com>
Signed-off-by: Namhyung Kim <namhyung@kernel.org>
---
tools/perf/builtin-report.c | 6 ++++++
tools/perf/tests/dwarf-unwind.c | 3 +++
tools/perf/util/callchain.h | 2 ++
tools/perf/util/hist.h | 2 --
4 files changed, 11 insertions(+), 2 deletions(-)
diff --git a/tools/perf/builtin-report.c b/tools/perf/builtin-report.c
index ac145fae0521..495168e73d4a 100644
--- a/tools/perf/builtin-report.c
+++ b/tools/perf/builtin-report.c
@@ -257,6 +257,12 @@ 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)
+ callchain_param.record_mode = CALLCHAIN_DWARF;
+ else
+ callchain_param.record_mode = CALLCHAIN_FP;
+ }
return 0;
}
diff --git a/tools/perf/tests/dwarf-unwind.c b/tools/perf/tests/dwarf-unwind.c
index 96adb730b744..fc25e57f4a5d 100644
--- a/tools/perf/tests/dwarf-unwind.c
+++ b/tools/perf/tests/dwarf-unwind.c
@@ -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;
diff --git a/tools/perf/util/callchain.h b/tools/perf/util/callchain.h
index 2a1f5a46543a..94cfefddf4db 100644
--- a/tools/perf/util/callchain.h
+++ b/tools/perf/util/callchain.h
@@ -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;
diff --git a/tools/perf/util/hist.h b/tools/perf/util/hist.h
index 8c9c70e18cbb..ac1ee82c6c7e 100644
--- a/tools/perf/util/hist.h
+++ b/tools/perf/util/hist.h
@@ -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;
--
2.1.0
^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: [PATCH v3.1 1/5] perf report: Set callchain_param.record_mode for future use
2014-10-02 3:12 ` [PATCH v3.1 " Namhyung Kim
@ 2014-10-02 13:46 ` Jiri Olsa
0 siblings, 0 replies; 8+ messages in thread
From: Jiri Olsa @ 2014-10-02 13:46 UTC (permalink / raw)
To: Namhyung Kim
Cc: Arnaldo Carvalho de Melo, Peter Zijlstra, Ingo Molnar,
Paul Mackerras, Namhyung Kim, LKML, David Ahern, Jean Pihet,
Frederic Weisbecker
On Thu, Oct 02, 2014 at 12:12:14PM +0900, Namhyung Kim wrote:
> 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 <jolsa@redhat.com>
> Cc: David Ahern <dsahern@gmail.com>
> Cc: Jean Pihet <jean.pihet@linaro.org>
> Cc: Frederic Weisbecker <fweisbec@gmail.com>
> Signed-off-by: Namhyung Kim <namhyung@kernel.org>
> ---
> tools/perf/builtin-report.c | 6 ++++++
> tools/perf/tests/dwarf-unwind.c | 3 +++
> tools/perf/util/callchain.h | 2 ++
> tools/perf/util/hist.h | 2 --
> 4 files changed, 11 insertions(+), 2 deletions(-)
>
> diff --git a/tools/perf/builtin-report.c b/tools/perf/builtin-report.c
> index ac145fae0521..495168e73d4a 100644
> --- a/tools/perf/builtin-report.c
> +++ b/tools/perf/builtin-report.c
> @@ -257,6 +257,12 @@ 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)
should we check also for PERF_SAMPLE_STACK_USER?
as in machine__resolve_callchain
thanks,
jirka
^ permalink raw reply [flat|nested] 8+ messages in thread
end of thread, other threads:[~2014-10-02 13:48 UTC | newest]
Thread overview: 8+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2014-10-02 3:08 [PATCHSET 0/5] perf tools: Speed up dwarf callchain post-unwinding for libunwind (v3) Namhyung Kim
2014-10-02 3:08 ` [PATCH 1/5] perf report: Set callchain_param.record_mode for future use Namhyung Kim
2014-10-02 3:12 ` [PATCH v3.1 " Namhyung Kim
2014-10-02 13:46 ` Jiri Olsa
2014-10-02 3:08 ` [PATCH 2/5] perf callchain: Create an address space per thread Namhyung Kim
2014-10-02 3:08 ` [PATCH 3/5] perf callchain: Use global caching provided by libunwind Namhyung Kim
2014-10-02 3:08 ` [PATCH 4/5] perf kvm: Use thread_{,_set}_priv helpers Namhyung Kim
2014-10-02 3:08 ` [PATCH 5/5] perf trace: " Namhyung Kim
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®