perf tools: Shorten sample symbol resolving function signature

Since three of the parameters come from the same 'struct addr_location',
rename machine__resolve_mem() to sample__resolve_mem() and pass the
that addr_location instead.

Cc: Adrian Hunter <adrian.hunter@intel.com>
Cc: David Ahern <dsahern@gmail.com>
Cc: Frederic Weisbecker <fweisbec@gmail.com>
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-3f5otpssefh9l5hi1t259h8n@git.kernel.orgSigned-off-by: default avatarArnaldo Carvalho de Melo <acme@redhat.com>
parent 17f22a3f
...@@ -88,7 +88,7 @@ static int report__add_mem_hist_entry(struct perf_tool *tool, struct addr_locati ...@@ -88,7 +88,7 @@ static int report__add_mem_hist_entry(struct perf_tool *tool, struct addr_locati
if (err) if (err)
return err; return err;
mi = machine__resolve_mem(al->machine, al->thread, sample, al->cpumode); mi = sample__resolve_mem(sample, al);
if (!mi) if (!mi)
return -ENOMEM; return -ENOMEM;
......
...@@ -369,7 +369,7 @@ static struct hist_entry *add_hist_entry(struct hists *hists, ...@@ -369,7 +369,7 @@ static struct hist_entry *add_hist_entry(struct hists *hists,
he_stat__add_period(&he->stat, period, weight); he_stat__add_period(&he->stat, period, weight);
/* /*
* This mem info was allocated from machine__resolve_mem * This mem info was allocated from sample__resolve_mem
* and will not be used anymore. * and will not be used anymore.
*/ */
zfree(&entry->mem_info); zfree(&entry->mem_info);
......
...@@ -1238,18 +1238,17 @@ static void ip__resolve_data(struct machine *machine, struct thread *thread, ...@@ -1238,18 +1238,17 @@ static void ip__resolve_data(struct machine *machine, struct thread *thread,
ams->map = al.map; ams->map = al.map;
} }
struct mem_info *machine__resolve_mem(struct machine *machine, struct mem_info *sample__resolve_mem(struct perf_sample *sample,
struct thread *thr, struct addr_location *al)
struct perf_sample *sample,
u8 cpumode)
{ {
struct mem_info *mi = zalloc(sizeof(*mi)); struct mem_info *mi = zalloc(sizeof(*mi));
if (!mi) if (!mi)
return NULL; return NULL;
ip__resolve_ams(machine, thr, &mi->iaddr, sample->ip); ip__resolve_ams(al->machine, al->thread, &mi->iaddr, sample->ip);
ip__resolve_data(machine, thr, cpumode, &mi->daddr, sample->addr); ip__resolve_data(al->machine, al->thread, al->cpumode,
&mi->daddr, sample->addr);
mi->data_src.val = sample->data_src; mi->data_src.val = sample->data_src;
return mi; return mi;
......
...@@ -94,9 +94,8 @@ void machine__delete(struct machine *machine); ...@@ -94,9 +94,8 @@ void machine__delete(struct machine *machine);
struct branch_info *machine__resolve_bstack(struct machine *machine, struct branch_info *machine__resolve_bstack(struct machine *machine,
struct thread *thread, struct thread *thread,
struct branch_stack *bs); struct branch_stack *bs);
struct mem_info *machine__resolve_mem(struct machine *machine, struct mem_info *sample__resolve_mem(struct perf_sample *sample,
struct thread *thread, struct addr_location *al);
struct perf_sample *sample, u8 cpumode);
int machine__resolve_callchain(struct machine *machine, int machine__resolve_callchain(struct machine *machine,
struct perf_evsel *evsel, struct perf_evsel *evsel,
struct thread *thread, struct thread *thread,
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment