aboutsummaryrefslogtreecommitdiffstats
path: root/tools/perf/builtin-report.c
diff options
context:
space:
mode:
authorArnaldo Carvalho de Melo <acme@redhat.com>2014-01-22 11:21:32 -0500
committerArnaldo Carvalho de Melo <acme@redhat.com>2014-02-18 07:34:46 -0500
commit106395dfda0397a6a88cc309bb7beb1fdf2ed798 (patch)
tree6ebcf216d6435e574f8193388636ca29beaf5390 /tools/perf/builtin-report.c
parent644f2df29faf66f408fea2e50f16d3b5302403da (diff)
perf report: Remove some needless container_of usage
Since all it wants is to get the 'struct record' from the received 'struct perf_tool', and this is already done at the callers of these functions, short circuit it. 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-xz8p659sjpad396vye5t24gx@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.c15
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
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{ 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
130static int report__add_branch_hist_entry(struct perf_tool *tool, struct addr_location *al, 129static 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
184static int report__add_hist_entry(struct perf_tool *tool, struct perf_evsel *evsel, 182static 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 }