perf thread: Adopt resolve_callchain method from machine
Shortening function signature lenght too, since a thread's machine can be obtained from thread->mg->machine, no need to pass thread, machine. Cc: Adrian Hunter <adrian.hunter@intel.com> Cc: Borislav Petkov <bp@suse.de> Cc: David Ahern <dsahern@gmail.com> Cc: Don Zickus <dzickus@redhat.com> Cc: Frederic Weisbecker <fweisbec@gmail.com> Cc: Jean Pihet <jean.pihet@linaro.org> Cc: Jiri Olsa <jolsa@redhat.com> Cc: Mike Galbraith <efault@gmx.de> Cc: Namhyung Kim <namhyung@kernel.org> Cc: Paul Mackerras <paulus@samba.org> Cc: Peter Zijlstra <peterz@infradead.org> Cc: Stephane Eranian <eranian@google.com> Link: http://lkml.kernel.org/n/tip-5wb6css280ty0cel5p0zo2b1@git.kernel.org Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
This commit is contained in:
@@ -754,8 +754,8 @@ int sample__resolve_callchain(struct perf_sample *sample, struct symbol **parent
|
|||||||
|
|
||||||
if (symbol_conf.use_callchain || symbol_conf.cumulate_callchain ||
|
if (symbol_conf.use_callchain || symbol_conf.cumulate_callchain ||
|
||||||
sort__has_parent) {
|
sort__has_parent) {
|
||||||
return machine__resolve_callchain(al->machine, evsel, al->thread,
|
return thread__resolve_callchain(al->thread, evsel, sample,
|
||||||
sample, parent, al, max_stack);
|
parent, al, max_stack);
|
||||||
}
|
}
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1464,9 +1464,8 @@ static int unwind_entry(struct unwind_entry *entry, void *arg)
|
|||||||
entry->map, entry->sym);
|
entry->map, entry->sym);
|
||||||
}
|
}
|
||||||
|
|
||||||
int machine__resolve_callchain(struct machine *machine,
|
int thread__resolve_callchain(struct thread *thread,
|
||||||
struct perf_evsel *evsel,
|
struct perf_evsel *evsel,
|
||||||
struct thread *thread,
|
|
||||||
struct perf_sample *sample,
|
struct perf_sample *sample,
|
||||||
struct symbol **parent,
|
struct symbol **parent,
|
||||||
struct addr_location *root_al,
|
struct addr_location *root_al,
|
||||||
@@ -1487,7 +1486,7 @@ int machine__resolve_callchain(struct machine *machine,
|
|||||||
(!sample->user_stack.size))
|
(!sample->user_stack.size))
|
||||||
return 0;
|
return 0;
|
||||||
|
|
||||||
return unwind__get_entries(unwind_entry, &callchain_cursor, machine,
|
return unwind__get_entries(unwind_entry, &callchain_cursor, thread->mg->machine,
|
||||||
thread, sample, max_stack);
|
thread, sample, max_stack);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -122,9 +122,8 @@ struct branch_info *sample__resolve_bstack(struct perf_sample *sample,
|
|||||||
struct addr_location *al);
|
struct addr_location *al);
|
||||||
struct mem_info *sample__resolve_mem(struct perf_sample *sample,
|
struct mem_info *sample__resolve_mem(struct perf_sample *sample,
|
||||||
struct addr_location *al);
|
struct addr_location *al);
|
||||||
int machine__resolve_callchain(struct machine *machine,
|
int thread__resolve_callchain(struct thread *thread,
|
||||||
struct perf_evsel *evsel,
|
struct perf_evsel *evsel,
|
||||||
struct thread *thread,
|
|
||||||
struct perf_sample *sample,
|
struct perf_sample *sample,
|
||||||
struct symbol **parent,
|
struct symbol **parent,
|
||||||
struct addr_location *root_al,
|
struct addr_location *root_al,
|
||||||
|
|||||||
@@ -312,7 +312,7 @@ static PyObject *python_process_callchain(struct perf_sample *sample,
|
|||||||
if (!symbol_conf.use_callchain || !sample->callchain)
|
if (!symbol_conf.use_callchain || !sample->callchain)
|
||||||
goto exit;
|
goto exit;
|
||||||
|
|
||||||
if (machine__resolve_callchain(al->machine, evsel, al->thread,
|
if (thread__resolve_callchain(al->thread, evsel,
|
||||||
sample, NULL, NULL,
|
sample, NULL, NULL,
|
||||||
PERF_MAX_STACK_DEPTH) != 0) {
|
PERF_MAX_STACK_DEPTH) != 0) {
|
||||||
pr_err("Failed to resolve callchain. Skipping\n");
|
pr_err("Failed to resolve callchain. Skipping\n");
|
||||||
|
|||||||
@@ -1417,7 +1417,7 @@ void perf_evsel__print_ip(struct perf_evsel *evsel, struct perf_sample *sample,
|
|||||||
if (symbol_conf.use_callchain && sample->callchain) {
|
if (symbol_conf.use_callchain && sample->callchain) {
|
||||||
struct addr_location node_al;
|
struct addr_location node_al;
|
||||||
|
|
||||||
if (machine__resolve_callchain(al->machine, evsel, al->thread,
|
if (thread__resolve_callchain(al->thread, evsel,
|
||||||
sample, NULL, NULL,
|
sample, NULL, NULL,
|
||||||
PERF_MAX_STACK_DEPTH) != 0) {
|
PERF_MAX_STACK_DEPTH) != 0) {
|
||||||
if (verbose)
|
if (verbose)
|
||||||
|
|||||||
Reference in New Issue
Block a user