diff --git a/tools/perf/builtin-report.c b/tools/perf/builtin-report.c index 8f9d6edb4674e334b35e49ad652a3b198248c55f..0d381dc0e261b6ea358d572dcba8859ead5eeb8c 100644 --- a/tools/perf/builtin-report.c +++ b/tools/perf/builtin-report.c @@ -88,7 +88,7 @@ static int report__add_mem_hist_entry(struct perf_tool *tool, struct addr_locati if (err) return err; - mi = machine__resolve_mem(al->machine, al->thread, sample, al->cpumode); + mi = sample__resolve_mem(sample, al); if (!mi) return -ENOMEM; diff --git a/tools/perf/util/hist.c b/tools/perf/util/hist.c index e4e6249b87d4eef1cd89d3df1aa3da022b550f84..6240ca42abf4c89c81d20c7dea3aecb634503386 100644 --- a/tools/perf/util/hist.c +++ b/tools/perf/util/hist.c @@ -369,7 +369,7 @@ static struct hist_entry *add_hist_entry(struct hists *hists, 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. */ zfree(&entry->mem_info); diff --git a/tools/perf/util/machine.c b/tools/perf/util/machine.c index c872991e0f655ba581443f0f413d81a5b910842f..0d304d84afb4b7ac89e38529b7ec0ce48d1be93b 100644 --- a/tools/perf/util/machine.c +++ b/tools/perf/util/machine.c @@ -1238,18 +1238,17 @@ static void ip__resolve_data(struct machine *machine, struct thread *thread, ams->map = al.map; } -struct mem_info *machine__resolve_mem(struct machine *machine, - struct thread *thr, - struct perf_sample *sample, - u8 cpumode) +struct mem_info *sample__resolve_mem(struct perf_sample *sample, + struct addr_location *al) { struct mem_info *mi = zalloc(sizeof(*mi)); if (!mi) return NULL; - ip__resolve_ams(machine, thr, &mi->iaddr, sample->ip); - ip__resolve_data(machine, thr, cpumode, &mi->daddr, sample->addr); + ip__resolve_ams(al->machine, al->thread, &mi->iaddr, sample->ip); + ip__resolve_data(al->machine, al->thread, al->cpumode, + &mi->daddr, sample->addr); mi->data_src.val = sample->data_src; return mi; diff --git a/tools/perf/util/machine.h b/tools/perf/util/machine.h index f77e91e483dcf769597bfe6c18c7c106436398bf..9ddacd9b35953556a130cebfedd44071e26d8294 100644 --- a/tools/perf/util/machine.h +++ b/tools/perf/util/machine.h @@ -94,9 +94,8 @@ void machine__delete(struct machine *machine); struct branch_info *machine__resolve_bstack(struct machine *machine, struct thread *thread, struct branch_stack *bs); -struct mem_info *machine__resolve_mem(struct machine *machine, - struct thread *thread, - struct perf_sample *sample, u8 cpumode); +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,