aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--tools/perf/ui/browsers/hists.c19
1 files changed, 19 insertions, 0 deletions
diff --git a/tools/perf/ui/browsers/hists.c b/tools/perf/ui/browsers/hists.c
index ad312d91caed..49eddeb81458 100644
--- a/tools/perf/ui/browsers/hists.c
+++ b/tools/perf/ui/browsers/hists.c
@@ -48,6 +48,24 @@ static bool hist_browser__has_filter(struct hist_browser *hb)
48 return hists__has_filter(hb->hists) || hb->min_pcnt; 48 return hists__has_filter(hb->hists) || hb->min_pcnt;
49} 49}
50 50
51static int hist_browser__get_folding(struct hist_browser *browser)
52{
53 struct rb_node *nd;
54 struct hists *hists = browser->hists;
55 int unfolded_rows = 0;
56
57 for (nd = rb_first(&hists->entries);
58 (nd = hists__filter_entries(nd, browser->min_pcnt)) != NULL;
59 nd = rb_next(nd)) {
60 struct hist_entry *he =
61 rb_entry(nd, struct hist_entry, rb_node);
62
63 if (he->ms.unfolded)
64 unfolded_rows += he->nr_rows;
65 }
66 return unfolded_rows;
67}
68
51static u32 hist_browser__nr_entries(struct hist_browser *hb) 69static u32 hist_browser__nr_entries(struct hist_browser *hb)
52{ 70{
53 u32 nr_entries; 71 u32 nr_entries;
@@ -57,6 +75,7 @@ static u32 hist_browser__nr_entries(struct hist_browser *hb)
57 else 75 else
58 nr_entries = hb->hists->nr_entries; 76 nr_entries = hb->hists->nr_entries;
59 77
78 hb->nr_callchain_rows = hist_browser__get_folding(hb);
60 return nr_entries + hb->nr_callchain_rows; 79 return nr_entries + hb->nr_callchain_rows;
61} 80}
62 81