]> git.karo-electronics.de Git - karo-tx-linux.git/commitdiff
perf callchains: Use thread->mg->machine
authorArnaldo Carvalho de Melo <acme@redhat.com>
Thu, 23 Oct 2014 19:42:19 +0000 (16:42 -0300)
committerArnaldo Carvalho de Melo <acme@redhat.com>
Wed, 29 Oct 2014 12:32:46 +0000 (10:32 -0200)
The unwind__get_entries() already receives the thread parameter, from where it can
obtain the matching machine structure, shorten the signature.

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-isjc6bm8mv4612mhi6af64go@git.kernel.org
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
tools/perf/tests/dwarf-unwind.c
tools/perf/util/machine.c
tools/perf/util/unwind-libdw.c
tools/perf/util/unwind-libunwind.c
tools/perf/util/unwind.h

index fc25e57f4a5d2bdf5455c9db75298b4700b34c04..ab28cca2cb97ad436dd7c419ee4ee7fa37ecb0b9 100644 (file)
@@ -59,7 +59,7 @@ static int unwind_entry(struct unwind_entry *entry, void *arg)
 }
 
 __attribute__ ((noinline))
-static int unwind_thread(struct thread *thread, struct machine *machine)
+static int unwind_thread(struct thread *thread)
 {
        struct perf_sample sample;
        unsigned long cnt = 0;
@@ -72,7 +72,7 @@ static int unwind_thread(struct thread *thread, struct machine *machine)
                goto out;
        }
 
-       err = unwind__get_entries(unwind_entry, &cnt, machine, thread,
+       err = unwind__get_entries(unwind_entry, &cnt, thread,
                                  &sample, MAX_STACK);
        if (err)
                pr_debug("unwind failed\n");
@@ -89,21 +89,21 @@ static int unwind_thread(struct thread *thread, struct machine *machine)
 }
 
 __attribute__ ((noinline))
-static int krava_3(struct thread *thread, struct machine *machine)
+static int krava_3(struct thread *thread)
 {
-       return unwind_thread(thread, machine);
+       return unwind_thread(thread);
 }
 
 __attribute__ ((noinline))
-static int krava_2(struct thread *thread, struct machine *machine)
+static int krava_2(struct thread *thread)
 {
-       return krava_3(thread, machine);
+       return krava_3(thread);
 }
 
 __attribute__ ((noinline))
-static int krava_1(struct thread *thread, struct machine *machine)
+static int krava_1(struct thread *thread)
 {
-       return krava_2(thread, machine);
+       return krava_2(thread);
 }
 
 int test__dwarf_unwind(void)
@@ -137,7 +137,7 @@ int test__dwarf_unwind(void)
                goto out;
        }
 
-       err = krava_1(thread, machine);
+       err = krava_1(thread);
 
  out:
        machine__delete_threads(machine);
index fd192e4885cc4887e400d226794a7c1fb5e24dbc..51a630301afa17f2c28ac118fe00d7da866067be 100644 (file)
@@ -1486,7 +1486,7 @@ int thread__resolve_callchain(struct thread *thread,
            (!sample->user_stack.size))
                return 0;
 
-       return unwind__get_entries(unwind_entry, &callchain_cursor, thread->mg->machine,
+       return unwind__get_entries(unwind_entry, &callchain_cursor,
                                   thread, sample, max_stack);
 
 }
index f24b350ab192fa39332ee4d19ed54daabb05dc5c..2dcfe9a7c8d085b62d66acd574930ea2e5f327a7 100644 (file)
@@ -164,14 +164,14 @@ frame_callback(Dwfl_Frame *state, void *arg)
 }
 
 int unwind__get_entries(unwind_entry_cb_t cb, void *arg,
-                       struct machine *machine, struct thread *thread,
+                       struct thread *thread,
                        struct perf_sample *data,
                        int max_stack)
 {
        struct unwind_info ui = {
                .sample         = data,
                .thread         = thread,
-               .machine        = machine,
+               .machine        = thread->mg->machine,
                .cb             = cb,
                .arg            = arg,
                .max_stack      = max_stack,
index 29acc8cccb5643d962ef42e05734516adedf466f..371219a6daf1cd8209687115bca9a67f7ffc3209 100644 (file)
@@ -592,14 +592,14 @@ static int get_entries(struct unwind_info *ui, unwind_entry_cb_t cb,
 }
 
 int unwind__get_entries(unwind_entry_cb_t cb, void *arg,
-                       struct machine *machine, struct thread *thread,
+                       struct thread *thread,
                        struct perf_sample *data, int max_stack)
 {
        u64 ip;
        struct unwind_info ui = {
                .sample       = data,
                .thread       = thread,
-               .machine      = machine,
+               .machine      = thread->mg->machine,
        };
        int ret;
 
index f50b737235eb82eaabb44778c33cb4646f091459..12790cf94618eddb9cdcec8607792f57e75a73c8 100644 (file)
@@ -16,7 +16,6 @@ typedef int (*unwind_entry_cb_t)(struct unwind_entry *entry, void *arg);
 
 #ifdef HAVE_DWARF_UNWIND_SUPPORT
 int unwind__get_entries(unwind_entry_cb_t cb, void *arg,
-                       struct machine *machine,
                        struct thread *thread,
                        struct perf_sample *data, int max_stack);
 /* libunwind specific */
@@ -38,7 +37,6 @@ static inline void unwind__finish_access(struct thread *thread __maybe_unused) {
 static inline int
 unwind__get_entries(unwind_entry_cb_t cb __maybe_unused,
                    void *arg __maybe_unused,
-                   struct machine *machine __maybe_unused,
                    struct thread *thread __maybe_unused,
                    struct perf_sample *data __maybe_unused,
                    int max_stack __maybe_unused)