perf thread: Adopt resolve_callchain method from machine
authorArnaldo Carvalho de Melo <acme@redhat.com>
Thu, 23 Oct 2014 18:26:17 +0000 (15:26 -0300)
committerArnaldo Carvalho de Melo <acme@redhat.com>
Wed, 29 Oct 2014 12:32:46 +0000 (10:32 -0200)
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>
tools/perf/util/callchain.c
tools/perf/util/machine.c
tools/perf/util/machine.h
tools/perf/util/scripting-engines/trace-event-python.c
tools/perf/util/session.c

index c84d3f8dcb7594602c4664c4926eaf050d26247e..00229809a90473ab170953d4c02636bba01835c7 100644 (file)
@@ -754,8 +754,8 @@ int sample__resolve_callchain(struct perf_sample *sample, struct symbol **parent
 
        if (symbol_conf.use_callchain || symbol_conf.cumulate_callchain ||
            sort__has_parent) {
-               return machine__resolve_callchain(al->machine, evsel, al->thread,
-                                                 sample, parent, al, max_stack);
+               return thread__resolve_callchain(al->thread, evsel, sample,
+                                                parent, al, max_stack);
        }
        return 0;
 }
index 08e63fdbd14fb6cb04128173c9346119640487cb..fd192e4885cc4887e400d226794a7c1fb5e24dbc 100644 (file)
@@ -1464,13 +1464,12 @@ static int unwind_entry(struct unwind_entry *entry, void *arg)
                                       entry->map, entry->sym);
 }
 
-int machine__resolve_callchain(struct machine *machine,
-                              struct perf_evsel *evsel,
-                              struct thread *thread,
-                              struct perf_sample *sample,
-                              struct symbol **parent,
-                              struct addr_location *root_al,
-                              int max_stack)
+int thread__resolve_callchain(struct thread *thread,
+                             struct perf_evsel *evsel,
+                             struct perf_sample *sample,
+                             struct symbol **parent,
+                             struct addr_location *root_al,
+                             int max_stack)
 {
        int ret = thread__resolve_callchain_sample(thread, sample->callchain,
                                                   parent, root_al, max_stack);
@@ -1487,7 +1486,7 @@ int machine__resolve_callchain(struct machine *machine,
            (!sample->user_stack.size))
                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);
 
 }
index 2b651a7f5d0d113c59461f4badbd35c9ad870a45..88ec74e18cbf1fc7fab752d12a9907230790242a 100644 (file)
@@ -122,13 +122,12 @@ struct branch_info *sample__resolve_bstack(struct perf_sample *sample,
                                           struct addr_location *al);
 struct mem_info *sample__resolve_mem(struct perf_sample *sample,
                                     struct addr_location *al);
-int machine__resolve_callchain(struct machine *machine,
-                              struct perf_evsel *evsel,
-                              struct thread *thread,
-                              struct perf_sample *sample,
-                              struct symbol **parent,
-                              struct addr_location *root_al,
-                              int max_stack);
+int thread__resolve_callchain(struct thread *thread,
+                             struct perf_evsel *evsel,
+                             struct perf_sample *sample,
+                             struct symbol **parent,
+                             struct addr_location *root_al,
+                             int max_stack);
 
 /*
  * Default guest kernel is defined by parameter --guestkallsyms
index 496f21cadd97098751c22e054ec89311a29417f9..25e5a238f1cb3d4bb1a233cf5c7d2263da1c07a7 100644 (file)
@@ -312,9 +312,9 @@ static PyObject *python_process_callchain(struct perf_sample *sample,
        if (!symbol_conf.use_callchain || !sample->callchain)
                goto exit;
 
-       if (machine__resolve_callchain(al->machine, evsel, al->thread,
-                                          sample, NULL, NULL,
-                                          PERF_MAX_STACK_DEPTH) != 0) {
+       if (thread__resolve_callchain(al->thread, evsel,
+                                     sample, NULL, NULL,
+                                     PERF_MAX_STACK_DEPTH) != 0) {
                pr_err("Failed to resolve callchain. Skipping\n");
                goto exit;
        }
index 6702ac28754b903d5d682ad433d70af9909970d8..776010844cdc4b89755c7c91840ad2ca03d2db6f 100644 (file)
@@ -1417,9 +1417,9 @@ void perf_evsel__print_ip(struct perf_evsel *evsel, struct perf_sample *sample,
        if (symbol_conf.use_callchain && sample->callchain) {
                struct addr_location node_al;
 
-               if (machine__resolve_callchain(al->machine, evsel, al->thread,
-                                              sample, NULL, NULL,
-                                              PERF_MAX_STACK_DEPTH) != 0) {
+               if (thread__resolve_callchain(al->thread, evsel,
+                                             sample, NULL, NULL,
+                                             PERF_MAX_STACK_DEPTH) != 0) {
                        if (verbose)
                                error("Failed to resolve callchain. Skipping\n");
                        return;