From: Namhyung Kim <>

Markus reported that 'perf top --hierarchy' cannot scroll down after
refresh.  This was because the number of entries are not updated when
hierarchy is enabled.

Unlike normal report view, hierarchy mode needs to keep its own entry
count since it can have non-leaf entries which can expand/collapse.

Reported-and-Tested-by: Markus Trippelsdorf <>
Signed-off-by: Namhyung Kim <>
Tested-by: Arnaldo Carvalho de Melo <>
Cc: Andi Kleen <>
Cc: Jiri Olsa <>
Cc: Peter Zijlstra <>
Fixes: f5b763feebe9 ("perf hists browser: Count number of hierarchy entries")
Signed-off-by: Arnaldo Carvalho de Melo <>
 tools/perf/ui/browsers/hists.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/tools/perf/ui/browsers/hists.c b/tools/perf/ui/browsers/hists.c
index fb8e42c7507a..4ffff7be9299 100644
--- a/tools/perf/ui/browsers/hists.c
+++ b/tools/perf/ui/browsers/hists.c
@@ -601,7 +601,8 @@ int hist_browser__run(struct hist_browser *browser, const 
char *help)
                        u64 nr_entries;
-                       if (hist_browser__has_filter(browser))
+                       if (hist_browser__has_filter(browser) ||
+                           symbol_conf.report_hierarchy)
                        nr_entries = hist_browser__nr_entries(browser);

Reply via email to