aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorArnaldo Carvalho de Melo <acme@redhat.com>2014-10-23 14:26:17 -0400
committerArnaldo Carvalho de Melo <acme@redhat.com>2014-10-29 08:32:46 -0400
commitcc8b7c2bf553151a579a8009020875faa1d43e29 (patch)
tree77439fb5f4ca15827938a7bcf0557bc8dbe3e0db
parentbb871a9c8d68692ed2513b3f0e1c010c2ac12f44 (diff)
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>
-rw-r--r--tools/perf/util/callchain.c4
-rw-r--r--tools/perf/util/machine.c15
-rw-r--r--tools/perf/util/machine.h13
-rw-r--r--tools/perf/util/scripting-engines/trace-event-python.c6
-rw-r--r--tools/perf/util/session.c6
5 files changed, 21 insertions, 23 deletions
diff --git a/tools/perf/util/callchain.c b/tools/perf/util/callchain.c
index c84d3f8dcb75..00229809a904 100644
--- a/tools/perf/util/callchain.c
+++ b/tools/perf/util/callchain.c
@@ -754,8 +754,8 @@ int sample__resolve_callchain(struct perf_sample *sample, struct symbol **parent
754 754
755 if (symbol_conf.use_callchain || symbol_conf.cumulate_callchain || 755 if (symbol_conf.use_callchain || symbol_conf.cumulate_callchain ||
756 sort__has_parent) { 756 sort__has_parent) {
757 return machine__resolve_callchain(al->machine, evsel, al->thread, 757 return thread__resolve_callchain(al->thread, evsel, sample,
758 sample, parent, al, max_stack); 758 parent, al, max_stack);
759 } 759 }
760 return 0; 760 return 0;
761} 761}
diff --git a/tools/perf/util/machine.c b/tools/perf/util/machine.c
index 08e63fdbd14f..fd192e4885cc 100644
--- a/tools/perf/util/machine.c
+++ b/tools/perf/util/machine.c
@@ -1464,13 +1464,12 @@ static int unwind_entry(struct unwind_entry *entry, void *arg)
1464 entry->map, entry->sym); 1464 entry->map, entry->sym);
1465} 1465}
1466 1466
1467int machine__resolve_callchain(struct machine *machine, 1467int thread__resolve_callchain(struct thread *thread,
1468 struct perf_evsel *evsel, 1468 struct perf_evsel *evsel,
1469 struct thread *thread, 1469 struct perf_sample *sample,
1470 struct perf_sample *sample, 1470 struct symbol **parent,
1471 struct symbol **parent, 1471 struct addr_location *root_al,
1472 struct addr_location *root_al, 1472 int max_stack)
1473 int max_stack)
1474{ 1473{
1475 int ret = thread__resolve_callchain_sample(thread, sample->callchain, 1474 int ret = thread__resolve_callchain_sample(thread, sample->callchain,
1476 parent, root_al, max_stack); 1475 parent, root_al, max_stack);
@@ -1487,7 +1486,7 @@ int machine__resolve_callchain(struct machine *machine,
1487 (!sample->user_stack.size)) 1486 (!sample->user_stack.size))
1488 return 0; 1487 return 0;
1489 1488
1490 return unwind__get_entries(unwind_entry, &callchain_cursor, machine, 1489 return unwind__get_entries(unwind_entry, &callchain_cursor, thread->mg->machine,
1491 thread, sample, max_stack); 1490 thread, sample, max_stack);
1492 1491
1493} 1492}
diff --git a/tools/perf/util/machine.h b/tools/perf/util/machine.h
index 2b651a7f5d0d..88ec74e18cbf 100644
--- a/tools/perf/util/machine.h
+++ b/tools/perf/util/machine.h
@@ -122,13 +122,12 @@ struct branch_info *sample__resolve_bstack(struct perf_sample *sample,
122 struct addr_location *al); 122 struct addr_location *al);
123struct mem_info *sample__resolve_mem(struct perf_sample *sample, 123struct mem_info *sample__resolve_mem(struct perf_sample *sample,
124 struct addr_location *al); 124 struct addr_location *al);
125int machine__resolve_callchain(struct machine *machine, 125int thread__resolve_callchain(struct thread *thread,
126 struct perf_evsel *evsel, 126 struct perf_evsel *evsel,
127 struct thread *thread, 127 struct perf_sample *sample,
128 struct perf_sample *sample, 128 struct symbol **parent,
129 struct symbol **parent, 129 struct addr_location *root_al,
130 struct addr_location *root_al, 130 int max_stack);
131 int max_stack);
132 131
133/* 132/*
134 * Default guest kernel is defined by parameter --guestkallsyms 133 * Default guest kernel is defined by parameter --guestkallsyms
diff --git a/tools/perf/util/scripting-engines/trace-event-python.c b/tools/perf/util/scripting-engines/trace-event-python.c
index 496f21cadd97..25e5a238f1cb 100644
--- a/tools/perf/util/scripting-engines/trace-event-python.c
+++ b/tools/perf/util/scripting-engines/trace-event-python.c
@@ -312,9 +312,9 @@ static PyObject *python_process_callchain(struct perf_sample *sample,
312 if (!symbol_conf.use_callchain || !sample->callchain) 312 if (!symbol_conf.use_callchain || !sample->callchain)
313 goto exit; 313 goto exit;
314 314
315 if (machine__resolve_callchain(al->machine, evsel, al->thread, 315 if (thread__resolve_callchain(al->thread, evsel,
316 sample, NULL, NULL, 316 sample, NULL, NULL,
317 PERF_MAX_STACK_DEPTH) != 0) { 317 PERF_MAX_STACK_DEPTH) != 0) {
318 pr_err("Failed to resolve callchain. Skipping\n"); 318 pr_err("Failed to resolve callchain. Skipping\n");
319 goto exit; 319 goto exit;
320 } 320 }
diff --git a/tools/perf/util/session.c b/tools/perf/util/session.c
index 6702ac28754b..776010844cdc 100644
--- a/tools/perf/util/session.c
+++ b/tools/perf/util/session.c
@@ -1417,9 +1417,9 @@ void perf_evsel__print_ip(struct perf_evsel *evsel, struct perf_sample *sample,
1417 if (symbol_conf.use_callchain && sample->callchain) { 1417 if (symbol_conf.use_callchain && sample->callchain) {
1418 struct addr_location node_al; 1418 struct addr_location node_al;
1419 1419
1420 if (machine__resolve_callchain(al->machine, evsel, al->thread, 1420 if (thread__resolve_callchain(al->thread, evsel,
1421 sample, NULL, NULL, 1421 sample, NULL, NULL,
1422 PERF_MAX_STACK_DEPTH) != 0) { 1422 PERF_MAX_STACK_DEPTH) != 0) {
1423 if (verbose) 1423 if (verbose)
1424 error("Failed to resolve callchain. Skipping\n"); 1424 error("Failed to resolve callchain. Skipping\n");
1425 return; 1425 return;