Skip to content

Commit

Permalink
perf tests: Use thread->mg->machine
Browse files Browse the repository at this point in the history
Instead of passing both thread and 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-y2nl2v7p7of0dzuyc3tppxoo@git.kernel.org
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
  • Loading branch information
Arnaldo Carvalho de Melo committed Oct 29, 2014
1 parent f498784 commit 29f9e52
Showing 1 changed file with 4 additions and 6 deletions.
10 changes: 4 additions & 6 deletions tools/perf/tests/code-reading.c
Original file line number Diff line number Diff line change
Expand Up @@ -133,8 +133,7 @@ static int read_via_objdump(const char *filename, u64 addr, void *buf,
}

static int read_object_code(u64 addr, size_t len, u8 cpumode,
struct thread *thread, struct machine *machine,
struct state *state)
struct thread *thread, struct state *state)
{
struct addr_location al;
unsigned char buf1[BUFSZ];
Expand Down Expand Up @@ -169,8 +168,8 @@ static int read_object_code(u64 addr, size_t len, u8 cpumode,
len = al.map->end - addr;

/* Read the object code using perf */
ret_len = dso__data_read_offset(al.map->dso, machine, al.addr, buf1,
len);
ret_len = dso__data_read_offset(al.map->dso, thread->mg->machine,
al.addr, buf1, len);
if (ret_len != len) {
pr_debug("dso__data_read_offset failed\n");
return -1;
Expand Down Expand Up @@ -263,8 +262,7 @@ static int process_sample_event(struct machine *machine,

cpumode = event->header.misc & PERF_RECORD_MISC_CPUMODE_MASK;

return read_object_code(sample.ip, READLEN, cpumode, thread, machine,
state);
return read_object_code(sample.ip, READLEN, cpumode, thread, state);
}

static int process_event(struct machine *machine, struct perf_evlist *evlist,
Expand Down

0 comments on commit 29f9e52

Please sign in to comment.