diff options
-rw-r--r-- | tools/perf/builtin-report.c | 15 |
1 files changed, 6 insertions, 9 deletions
diff --git a/tools/perf/builtin-report.c b/tools/perf/builtin-report.c index 6b7a0a0b4fda..d882b6f96411 100644 --- a/tools/perf/builtin-report.c +++ b/tools/perf/builtin-report.c | |||
@@ -75,10 +75,9 @@ 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 | ||
78 | static int report__add_mem_hist_entry(struct perf_tool *tool, struct addr_location *al, | 78 | static 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 | { | 80 | { |
81 | struct report *rep = container_of(tool, struct report, tool); | ||
82 | struct symbol *parent = NULL; | 81 | struct symbol *parent = NULL; |
83 | struct hist_entry *he; | 82 | struct hist_entry *he; |
84 | struct mem_info *mi, *mx; | 83 | struct mem_info *mi, *mx; |
@@ -127,10 +126,9 @@ out: | |||
127 | return err; | 126 | return err; |
128 | } | 127 | } |
129 | 128 | ||
130 | static int report__add_branch_hist_entry(struct perf_tool *tool, struct addr_location *al, | 129 | static int report__add_branch_hist_entry(struct report *rep, struct addr_location *al, |
131 | struct perf_sample *sample, struct perf_evsel *evsel) | 130 | struct perf_sample *sample, struct perf_evsel *evsel) |
132 | { | 131 | { |
133 | struct report *rep = container_of(tool, struct report, tool); | ||
134 | struct symbol *parent = NULL; | 132 | struct symbol *parent = NULL; |
135 | unsigned i; | 133 | unsigned i; |
136 | struct hist_entry *he; | 134 | struct hist_entry *he; |
@@ -181,10 +179,9 @@ out: | |||
181 | return err; | 179 | return err; |
182 | } | 180 | } |
183 | 181 | ||
184 | static int report__add_hist_entry(struct perf_tool *tool, struct perf_evsel *evsel, | 182 | static int report__add_hist_entry(struct report *rep, struct perf_evsel *evsel, |
185 | struct addr_location *al, struct perf_sample *sample) | 183 | struct addr_location *al, struct perf_sample *sample) |
186 | { | 184 | { |
187 | struct report *rep = container_of(tool, struct report, tool); | ||
188 | struct symbol *parent = NULL; | 185 | struct symbol *parent = NULL; |
189 | struct hist_entry *he; | 186 | struct hist_entry *he; |
190 | int err = sample__resolve_callchain(sample, &parent, evsel, al, rep->max_stack); | 187 | int err = sample__resolve_callchain(sample, &parent, evsel, al, rep->max_stack); |
@@ -233,18 +230,18 @@ static int process_sample_event(struct perf_tool *tool, | |||
233 | return 0; | 230 | return 0; |
234 | 231 | ||
235 | if (sort__mode == SORT_MODE__BRANCH) { | 232 | if (sort__mode == SORT_MODE__BRANCH) { |
236 | ret = report__add_branch_hist_entry(tool, &al, sample, evsel); | 233 | ret = report__add_branch_hist_entry(rep, &al, sample, evsel); |
237 | if (ret < 0) | 234 | if (ret < 0) |
238 | pr_debug("problem adding lbr entry, skipping event\n"); | 235 | pr_debug("problem adding lbr entry, skipping event\n"); |
239 | } else if (rep->mem_mode == 1) { | 236 | } else if (rep->mem_mode == 1) { |
240 | ret = report__add_mem_hist_entry(tool, &al, sample, evsel); | 237 | ret = report__add_mem_hist_entry(rep, &al, sample, evsel); |
241 | if (ret < 0) | 238 | if (ret < 0) |
242 | pr_debug("problem adding mem entry, skipping event\n"); | 239 | pr_debug("problem adding mem entry, skipping event\n"); |
243 | } else { | 240 | } else { |
244 | if (al.map != NULL) | 241 | if (al.map != NULL) |
245 | al.map->dso->hit = 1; | 242 | al.map->dso->hit = 1; |
246 | 243 | ||
247 | ret = report__add_hist_entry(tool, evsel, &al, sample); | 244 | ret = report__add_hist_entry(rep, evsel, &al, sample); |
248 | if (ret < 0) | 245 | if (ret < 0) |
249 | pr_debug("problem incrementing symbol period, skipping event\n"); | 246 | pr_debug("problem incrementing symbol period, skipping event\n"); |
250 | } | 247 | } |