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.c24
1 files changed, 3 insertions, 21 deletions
diff --git a/tools/perf/builtin-report.c b/tools/perf/builtin-report.c
index 46864dd7eb83..3c53ec268fbc 100644
--- a/tools/perf/builtin-report.c
+++ b/tools/perf/builtin-report.c
@@ -75,24 +75,6 @@ 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__resolve_callchain(struct report *rep, struct symbol **parent,
79 struct perf_evsel *evsel, struct addr_location *al,
80 struct perf_sample *sample)
81{
82 if ((sort__has_parent || symbol_conf.use_callchain) && sample->callchain) {
83 return machine__resolve_callchain(al->machine, evsel, al->thread, sample,
84 parent, al, rep->max_stack);
85 }
86 return 0;
87}
88
89static int hist_entry__append_callchain(struct hist_entry *he, struct perf_sample *sample)
90{
91 if (!symbol_conf.use_callchain)
92 return 0;
93 return callchain_append(he->callchain, &callchain_cursor, sample->period);
94}
95
96static int report__add_mem_hist_entry(struct perf_tool *tool, struct addr_location *al, 78static int report__add_mem_hist_entry(struct perf_tool *tool, struct addr_location *al,
97 struct perf_sample *sample, struct perf_evsel *evsel, 79 struct perf_sample *sample, struct perf_evsel *evsel,
98 union perf_event *event) 80 union perf_event *event)
@@ -103,7 +85,7 @@ static int report__add_mem_hist_entry(struct perf_tool *tool, struct addr_locati
103 struct hist_entry *he; 85 struct hist_entry *he;
104 struct mem_info *mi, *mx; 86 struct mem_info *mi, *mx;
105 uint64_t cost; 87 uint64_t cost;
106 int err = report__resolve_callchain(rep, &parent, evsel, al, sample); 88 int err = sample__resolve_callchain(sample, &parent, evsel, al, rep->max_stack);
107 89
108 if (err) 90 if (err)
109 return err; 91 return err;
@@ -155,7 +137,7 @@ static int report__add_branch_hist_entry(struct perf_tool *tool, struct addr_loc
155 unsigned i; 137 unsigned i;
156 struct hist_entry *he; 138 struct hist_entry *he;
157 struct branch_info *bi, *bx; 139 struct branch_info *bi, *bx;
158 int err = report__resolve_callchain(rep, &parent, evsel, al, sample); 140 int err = sample__resolve_callchain(sample, &parent, evsel, al, rep->max_stack);
159 141
160 if (err) 142 if (err)
161 return err; 143 return err;
@@ -208,7 +190,7 @@ static int report__add_hist_entry(struct perf_tool *tool, struct perf_evsel *evs
208 struct report *rep = container_of(tool, struct report, tool); 190 struct report *rep = container_of(tool, struct report, tool);
209 struct symbol *parent = NULL; 191 struct symbol *parent = NULL;
210 struct hist_entry *he; 192 struct hist_entry *he;
211 int err = report__resolve_callchain(rep, &parent, evsel, al, sample); 193 int err = sample__resolve_callchain(sample, &parent, evsel, al, rep->max_stack);
212 194
213 if (err) 195 if (err)
214 return err; 196 return err;