aboutsummaryrefslogtreecommitdiffstats
path: root/tools
diff options
context:
space:
mode:
authorArnaldo Carvalho de Melo <acme@redhat.com>2014-01-22 11:15:36 -0500
committerArnaldo Carvalho de Melo <acme@redhat.com>2014-02-18 07:34:46 -0500
commit644f2df29faf66f408fea2e50f16d3b5302403da (patch)
tree408d616d1f54e26e706b4b408abeb0c10cd9d9d3 /tools
parente80faac0460f178a5be576b4260897f997109e73 (diff)
perf tools: Shorten sample symbol resolving function signature
Since two of the parameters come from the same 'struct addr_location', rename machine__resolve_bstack() to sample__resolve_bstack() and pass the that addr_location instead. This is also for consistency with the same change that resulted in the sample__resolve_mem() function. 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-99ecqt8jiyyksiyx3se7l5ia@git.kernel.org Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
Diffstat (limited to 'tools')
-rw-r--r--tools/perf/builtin-report.c3
-rw-r--r--tools/perf/util/hist.c2
-rw-r--r--tools/perf/util/machine.c13
-rw-r--r--tools/perf/util/machine.h5
4 files changed, 10 insertions, 13 deletions
diff --git a/tools/perf/builtin-report.c b/tools/perf/builtin-report.c
index 0d381dc0e261..6b7a0a0b4fda 100644
--- a/tools/perf/builtin-report.c
+++ b/tools/perf/builtin-report.c
@@ -140,8 +140,7 @@ static int report__add_branch_hist_entry(struct perf_tool *tool, struct addr_loc
140 if (err) 140 if (err)
141 return err; 141 return err;
142 142
143 bi = machine__resolve_bstack(al->machine, al->thread, 143 bi = sample__resolve_bstack(sample, al);
144 sample->branch_stack);
145 if (!bi) 144 if (!bi)
146 return -ENOMEM; 145 return -ENOMEM;
147 146
diff --git a/tools/perf/util/hist.c b/tools/perf/util/hist.c
index 6240ca42abf4..0466efa71140 100644
--- a/tools/perf/util/hist.c
+++ b/tools/perf/util/hist.c
@@ -290,7 +290,7 @@ static struct hist_entry *hist_entry__new(struct hist_entry *template)
290 if (he->branch_info) { 290 if (he->branch_info) {
291 /* 291 /*
292 * This branch info is (a part of) allocated from 292 * This branch info is (a part of) allocated from
293 * machine__resolve_bstack() and will be freed after 293 * sample__resolve_bstack() and will be freed after
294 * adding new entries. So we need to save a copy. 294 * adding new entries. So we need to save a copy.
295 */ 295 */
296 he->branch_info = malloc(sizeof(*he->branch_info)); 296 he->branch_info = malloc(sizeof(*he->branch_info));
diff --git a/tools/perf/util/machine.c b/tools/perf/util/machine.c
index 0d304d84afb4..6c08ab03a697 100644
--- a/tools/perf/util/machine.c
+++ b/tools/perf/util/machine.c
@@ -1254,20 +1254,19 @@ struct mem_info *sample__resolve_mem(struct perf_sample *sample,
1254 return mi; 1254 return mi;
1255} 1255}
1256 1256
1257struct branch_info *machine__resolve_bstack(struct machine *machine, 1257struct branch_info *sample__resolve_bstack(struct perf_sample *sample,
1258 struct thread *thr, 1258 struct addr_location *al)
1259 struct branch_stack *bs)
1260{ 1259{
1261 struct branch_info *bi;
1262 unsigned int i; 1260 unsigned int i;
1261 const struct branch_stack *bs = sample->branch_stack;
1262 struct branch_info *bi = calloc(bs->nr, sizeof(struct branch_info));
1263 1263
1264 bi = calloc(bs->nr, sizeof(struct branch_info));
1265 if (!bi) 1264 if (!bi)
1266 return NULL; 1265 return NULL;
1267 1266
1268 for (i = 0; i < bs->nr; i++) { 1267 for (i = 0; i < bs->nr; i++) {
1269 ip__resolve_ams(machine, thr, &bi[i].to, bs->entries[i].to); 1268 ip__resolve_ams(al->machine, al->thread, &bi[i].to, bs->entries[i].to);
1270 ip__resolve_ams(machine, thr, &bi[i].from, bs->entries[i].from); 1269 ip__resolve_ams(al->machine, al->thread, &bi[i].from, bs->entries[i].from);
1271 bi[i].flags = bs->entries[i].flags; 1270 bi[i].flags = bs->entries[i].flags;
1272 } 1271 }
1273 return bi; 1272 return bi;
diff --git a/tools/perf/util/machine.h b/tools/perf/util/machine.h
index 9ddacd9b3595..2e6c248c870f 100644
--- a/tools/perf/util/machine.h
+++ b/tools/perf/util/machine.h
@@ -91,9 +91,8 @@ void machine__delete_dead_threads(struct machine *machine);
91void machine__delete_threads(struct machine *machine); 91void machine__delete_threads(struct machine *machine);
92void machine__delete(struct machine *machine); 92void machine__delete(struct machine *machine);
93 93
94struct branch_info *machine__resolve_bstack(struct machine *machine, 94struct branch_info *sample__resolve_bstack(struct perf_sample *sample,
95 struct thread *thread, 95 struct addr_location *al);
96 struct branch_stack *bs);
97struct mem_info *sample__resolve_mem(struct perf_sample *sample, 96struct mem_info *sample__resolve_mem(struct perf_sample *sample,
98 struct addr_location *al); 97 struct addr_location *al);
99int machine__resolve_callchain(struct machine *machine, 98int machine__resolve_callchain(struct machine *machine,