aboutsummaryrefslogtreecommitdiffstats
path: root/tools/perf/builtin-report.c
diff options
context:
space:
mode:
authorArnaldo Carvalho de Melo <acme@redhat.com>2013-12-19 15:20:06 -0500
committerArnaldo Carvalho de Melo <acme@redhat.com>2013-12-19 15:38:27 -0500
commitcc22e575a6fddbe3183ac14c28e2f792704995c5 (patch)
tree2ab6533499cfc1e12bcadb0eb7c4cbf51d50ecda /tools/perf/builtin-report.c
parent8b640cc4c56cee14bfe5cfb4dbb372ac66d5ec6b (diff)
perf symbols: Add 'machine' member to struct addr_location
The addr_location struct should fully qualify an address, and to do that it should have in it the machine where the thread was found. Thus all functions that receive an addr_location now don't need to also receive a 'machine', those functions just need to access al->machine instead, just like it does with the other parts of an address location: al->thread, al->map, etc. 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-o51iiee7vyq4r3k362uvuylg@git.kernel.org Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
Diffstat (limited to 'tools/perf/builtin-report.c')
-rw-r--r--tools/perf/builtin-report.c28
1 files changed, 13 insertions, 15 deletions
diff --git a/tools/perf/builtin-report.c b/tools/perf/builtin-report.c
index da156a44cb15..ec7399a84872 100644
--- a/tools/perf/builtin-report.c
+++ b/tools/perf/builtin-report.c
@@ -77,10 +77,10 @@ static int report__config(const char *var, const char *value, void *cb)
77 77
78static int report__resolve_callchain(struct report *rep, struct symbol **parent, 78static int report__resolve_callchain(struct report *rep, struct symbol **parent,
79 struct perf_evsel *evsel, struct addr_location *al, 79 struct perf_evsel *evsel, struct addr_location *al,
80 struct perf_sample *sample, struct machine *machine) 80 struct perf_sample *sample)
81{ 81{
82 if ((sort__has_parent || symbol_conf.use_callchain) && sample->callchain) { 82 if ((sort__has_parent || symbol_conf.use_callchain) && sample->callchain) {
83 return machine__resolve_callchain(machine, evsel, al->thread, sample, 83 return machine__resolve_callchain(al->machine, evsel, al->thread, sample,
84 parent, al, rep->max_stack); 84 parent, al, rep->max_stack);
85 } 85 }
86 return 0; 86 return 0;
@@ -95,7 +95,7 @@ static int hist_entry__append_callchain(struct hist_entry *he, struct perf_sampl
95 95
96static int report__add_mem_hist_entry(struct perf_tool *tool, struct addr_location *al, 96static int report__add_mem_hist_entry(struct perf_tool *tool, struct addr_location *al,
97 struct perf_sample *sample, struct perf_evsel *evsel, 97 struct perf_sample *sample, struct perf_evsel *evsel,
98 struct machine *machine, union perf_event *event) 98 union perf_event *event)
99{ 99{
100 struct report *rep = container_of(tool, struct report, tool); 100 struct report *rep = container_of(tool, struct report, tool);
101 struct symbol *parent = NULL; 101 struct symbol *parent = NULL;
@@ -103,12 +103,12 @@ static int report__add_mem_hist_entry(struct perf_tool *tool, struct addr_locati
103 struct hist_entry *he; 103 struct hist_entry *he;
104 struct mem_info *mi, *mx; 104 struct mem_info *mi, *mx;
105 uint64_t cost; 105 uint64_t cost;
106 int err = report__resolve_callchain(rep, &parent, evsel, al, sample, machine); 106 int err = report__resolve_callchain(rep, &parent, evsel, al, sample);
107 107
108 if (err) 108 if (err)
109 return err; 109 return err;
110 110
111 mi = machine__resolve_mem(machine, al->thread, sample, cpumode); 111 mi = machine__resolve_mem(al->machine, al->thread, sample, cpumode);
112 if (!mi) 112 if (!mi)
113 return -ENOMEM; 113 return -ENOMEM;
114 114
@@ -148,20 +148,19 @@ out:
148} 148}
149 149
150static int report__add_branch_hist_entry(struct perf_tool *tool, struct addr_location *al, 150static int report__add_branch_hist_entry(struct perf_tool *tool, struct addr_location *al,
151 struct perf_sample *sample, struct perf_evsel *evsel, 151 struct perf_sample *sample, struct perf_evsel *evsel)
152 struct machine *machine)
153{ 152{
154 struct report *rep = container_of(tool, struct report, tool); 153 struct report *rep = container_of(tool, struct report, tool);
155 struct symbol *parent = NULL; 154 struct symbol *parent = NULL;
156 unsigned i; 155 unsigned i;
157 struct hist_entry *he; 156 struct hist_entry *he;
158 struct branch_info *bi, *bx; 157 struct branch_info *bi, *bx;
159 int err = report__resolve_callchain(rep, &parent, evsel, al, sample, machine); 158 int err = report__resolve_callchain(rep, &parent, evsel, al, sample);
160 159
161 if (err) 160 if (err)
162 return err; 161 return err;
163 162
164 bi = machine__resolve_bstack(machine, al->thread, 163 bi = machine__resolve_bstack(al->machine, al->thread,
165 sample->branch_stack); 164 sample->branch_stack);
166 if (!bi) 165 if (!bi)
167 return -ENOMEM; 166 return -ENOMEM;
@@ -204,13 +203,12 @@ out:
204} 203}
205 204
206static int report__add_hist_entry(struct perf_tool *tool, struct perf_evsel *evsel, 205static int report__add_hist_entry(struct perf_tool *tool, struct perf_evsel *evsel,
207 struct addr_location *al, struct perf_sample *sample, 206 struct addr_location *al, struct perf_sample *sample)
208 struct machine *machine)
209{ 207{
210 struct report *rep = container_of(tool, struct report, tool); 208 struct report *rep = container_of(tool, struct report, tool);
211 struct symbol *parent = NULL; 209 struct symbol *parent = NULL;
212 struct hist_entry *he; 210 struct hist_entry *he;
213 int err = report__resolve_callchain(rep, &parent, evsel, al, sample, machine); 211 int err = report__resolve_callchain(rep, &parent, evsel, al, sample);
214 212
215 if (err) 213 if (err)
216 return err; 214 return err;
@@ -256,18 +254,18 @@ static int process_sample_event(struct perf_tool *tool,
256 return 0; 254 return 0;
257 255
258 if (sort__mode == SORT_MODE__BRANCH) { 256 if (sort__mode == SORT_MODE__BRANCH) {
259 ret = report__add_branch_hist_entry(tool, &al, sample, evsel, machine); 257 ret = report__add_branch_hist_entry(tool, &al, sample, evsel);
260 if (ret < 0) 258 if (ret < 0)
261 pr_debug("problem adding lbr entry, skipping event\n"); 259 pr_debug("problem adding lbr entry, skipping event\n");
262 } else if (rep->mem_mode == 1) { 260 } else if (rep->mem_mode == 1) {
263 ret = report__add_mem_hist_entry(tool, &al, sample, evsel, machine, event); 261 ret = report__add_mem_hist_entry(tool, &al, sample, evsel, event);
264 if (ret < 0) 262 if (ret < 0)
265 pr_debug("problem adding mem entry, skipping event\n"); 263 pr_debug("problem adding mem entry, skipping event\n");
266 } else { 264 } else {
267 if (al.map != NULL) 265 if (al.map != NULL)
268 al.map->dso->hit = 1; 266 al.map->dso->hit = 1;
269 267
270 ret = report__add_hist_entry(tool, evsel, &al, sample, machine); 268 ret = report__add_hist_entry(tool, evsel, &al, sample);
271 if (ret < 0) 269 if (ret < 0)
272 pr_debug("problem incrementing symbol period, skipping event\n"); 270 pr_debug("problem incrementing symbol period, skipping event\n");
273 } 271 }