aboutsummaryrefslogtreecommitdiffstats
path: root/tools/perf/util/hist.c
diff options
context:
space:
mode:
Diffstat (limited to 'tools/perf/util/hist.c')
-rw-r--r--tools/perf/util/hist.c13
1 files changed, 9 insertions, 4 deletions
diff --git a/tools/perf/util/hist.c b/tools/perf/util/hist.c
index 32f4f1f2f6e4..a438a0652d23 100644
--- a/tools/perf/util/hist.c
+++ b/tools/perf/util/hist.c
@@ -211,7 +211,9 @@ void hist_entry__free(struct hist_entry *he)
211 * collapse the histogram 211 * collapse the histogram
212 */ 212 */
213 213
214static bool collapse__insert_entry(struct rb_root *root, struct hist_entry *he) 214static bool hists__collapse_insert_entry(struct hists *self,
215 struct rb_root *root,
216 struct hist_entry *he)
215{ 217{
216 struct rb_node **p = &root->rb_node; 218 struct rb_node **p = &root->rb_node;
217 struct rb_node *parent = NULL; 219 struct rb_node *parent = NULL;
@@ -226,8 +228,11 @@ static bool collapse__insert_entry(struct rb_root *root, struct hist_entry *he)
226 228
227 if (!cmp) { 229 if (!cmp) {
228 iter->period += he->period; 230 iter->period += he->period;
229 if (symbol_conf.use_callchain) 231 if (symbol_conf.use_callchain) {
230 callchain_merge(iter->callchain, he->callchain); 232 callchain_cursor_reset(&self->callchain_cursor);
233 callchain_merge(&self->callchain_cursor, iter->callchain,
234 he->callchain);
235 }
231 hist_entry__free(he); 236 hist_entry__free(he);
232 return false; 237 return false;
233 } 238 }
@@ -262,7 +267,7 @@ void hists__collapse_resort(struct hists *self)
262 next = rb_next(&n->rb_node); 267 next = rb_next(&n->rb_node);
263 268
264 rb_erase(&n->rb_node, &self->entries); 269 rb_erase(&n->rb_node, &self->entries);
265 if (collapse__insert_entry(&tmp, n)) 270 if (hists__collapse_insert_entry(self, &tmp, n))
266 hists__inc_nr_entries(self, n); 271 hists__inc_nr_entries(self, n);
267 } 272 }
268 273