aboutsummaryrefslogtreecommitdiffstats
path: root/tools/perf/builtin-report.c
diff options
context:
space:
mode:
Diffstat (limited to 'tools/perf/builtin-report.c')
-rw-r--r--tools/perf/builtin-report.c28
1 files changed, 11 insertions, 17 deletions
diff --git a/tools/perf/builtin-report.c b/tools/perf/builtin-report.c
index 02f985f3a396..c8f21137dfd8 100644
--- a/tools/perf/builtin-report.c
+++ b/tools/perf/builtin-report.c
@@ -75,13 +75,10 @@ static int report__config(const char *var, const char *value, void *cb)
75 return perf_default_config(var, value, cb); 75 return perf_default_config(var, value, cb);
76} 76}
77 77
78static int report__add_mem_hist_entry(struct perf_tool *tool, struct addr_location *al, 78static int report__add_mem_hist_entry(struct report *rep, struct addr_location *al,
79 struct perf_sample *sample, struct perf_evsel *evsel, 79 struct perf_sample *sample, struct perf_evsel *evsel)
80 union perf_event *event)
81{ 80{
82 struct report *rep = container_of(tool, struct report, tool);
83 struct symbol *parent = NULL; 81 struct symbol *parent = NULL;
84 u8 cpumode = event->header.misc & PERF_RECORD_MISC_CPUMODE_MASK;
85 struct hist_entry *he; 82 struct hist_entry *he;
86 struct mem_info *mi, *mx; 83 struct mem_info *mi, *mx;
87 uint64_t cost; 84 uint64_t cost;
@@ -90,7 +87,7 @@ static int report__add_mem_hist_entry(struct perf_tool *tool, struct addr_locati
90 if (err) 87 if (err)
91 return err; 88 return err;
92 89
93 mi = machine__resolve_mem(al->machine, al->thread, sample, cpumode); 90 mi = sample__resolve_mem(sample, al);
94 if (!mi) 91 if (!mi)
95 return -ENOMEM; 92 return -ENOMEM;
96 93
@@ -131,10 +128,9 @@ out:
131 return err; 128 return err;
132} 129}
133 130
134static int report__add_branch_hist_entry(struct perf_tool *tool, struct addr_location *al, 131static int report__add_branch_hist_entry(struct report *rep, struct addr_location *al,
135 struct perf_sample *sample, struct perf_evsel *evsel) 132 struct perf_sample *sample, struct perf_evsel *evsel)
136{ 133{
137 struct report *rep = container_of(tool, struct report, tool);
138 struct symbol *parent = NULL; 134 struct symbol *parent = NULL;
139 unsigned i; 135 unsigned i;
140 struct hist_entry *he; 136 struct hist_entry *he;
@@ -144,8 +140,7 @@ static int report__add_branch_hist_entry(struct perf_tool *tool, struct addr_loc
144 if (err) 140 if (err)
145 return err; 141 return err;
146 142
147 bi = machine__resolve_bstack(al->machine, al->thread, 143 bi = sample__resolve_bstack(sample, al);
148 sample->branch_stack);
149 if (!bi) 144 if (!bi)
150 return -ENOMEM; 145 return -ENOMEM;
151 146
@@ -190,10 +185,9 @@ out:
190 return err; 185 return err;
191} 186}
192 187
193static int report__add_hist_entry(struct perf_tool *tool, struct perf_evsel *evsel, 188static int report__add_hist_entry(struct report *rep, struct perf_evsel *evsel,
194 struct addr_location *al, struct perf_sample *sample) 189 struct addr_location *al, struct perf_sample *sample)
195{ 190{
196 struct report *rep = container_of(tool, struct report, tool);
197 struct symbol *parent = NULL; 191 struct symbol *parent = NULL;
198 struct hist_entry *he; 192 struct hist_entry *he;
199 int err = sample__resolve_callchain(sample, &parent, evsel, al, rep->max_stack); 193 int err = sample__resolve_callchain(sample, &parent, evsel, al, rep->max_stack);
@@ -237,25 +231,25 @@ static int process_sample_event(struct perf_tool *tool,
237 return -1; 231 return -1;
238 } 232 }
239 233
240 if (al.filtered || (rep->hide_unresolved && al.sym == NULL)) 234 if (rep->hide_unresolved && al.sym == NULL)
241 return 0; 235 return 0;
242 236
243 if (rep->cpu_list && !test_bit(sample->cpu, rep->cpu_bitmap)) 237 if (rep->cpu_list && !test_bit(sample->cpu, rep->cpu_bitmap))
244 return 0; 238 return 0;
245 239
246 if (sort__mode == SORT_MODE__BRANCH) { 240 if (sort__mode == SORT_MODE__BRANCH) {
247 ret = report__add_branch_hist_entry(tool, &al, sample, evsel); 241 ret = report__add_branch_hist_entry(rep, &al, sample, evsel);
248 if (ret < 0) 242 if (ret < 0)
249 pr_debug("problem adding lbr entry, skipping event\n"); 243 pr_debug("problem adding lbr entry, skipping event\n");
250 } else if (rep->mem_mode == 1) { 244 } else if (rep->mem_mode == 1) {
251 ret = report__add_mem_hist_entry(tool, &al, sample, evsel, event); 245 ret = report__add_mem_hist_entry(rep, &al, sample, evsel);
252 if (ret < 0) 246 if (ret < 0)
253 pr_debug("problem adding mem entry, skipping event\n"); 247 pr_debug("problem adding mem entry, skipping event\n");
254 } else { 248 } else {
255 if (al.map != NULL) 249 if (al.map != NULL)
256 al.map->dso->hit = 1; 250 al.map->dso->hit = 1;
257 251
258 ret = report__add_hist_entry(tool, evsel, &al, sample); 252 ret = report__add_hist_entry(rep, evsel, &al, sample);
259 if (ret < 0) 253 if (ret < 0)
260 pr_debug("problem incrementing symbol period, skipping event\n"); 254 pr_debug("problem incrementing symbol period, skipping event\n");
261 } 255 }
@@ -934,7 +928,7 @@ repeat:
934 * so don't allocate extra space that won't be used in the stdio 928 * so don't allocate extra space that won't be used in the stdio
935 * implementation. 929 * implementation.
936 */ 930 */
937 if (use_browser == 1 && sort__has_sym) { 931 if (ui__has_annotation()) {
938 symbol_conf.priv_size = sizeof(struct annotation); 932 symbol_conf.priv_size = sizeof(struct annotation);
939 machines__set_symbol_filter(&session->machines, 933 machines__set_symbol_filter(&session->machines,
940 symbol__annotate_init); 934 symbol__annotate_init);