Skip to contentSkip to conversation

perf top: Fix refreshing hierarchy entries on TUI

PATCH New Namhyung Kim 2 participants 2 messages Oct 7, 2016 – Oct 17, 2016 perf events

lore
Share & tools
lore

Namhyung Kim

author maintainer
#0 lore raw

PATCH 1/1 perf top: Fix refreshing hierarchy entries on TUI

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.

Fixes f5b763feebe9 ("perf hists browser: Count number of hierarchy entries")
---
 tools/perf/ui/browsers/hists.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)
tools/perf/ui/browsers/hists.c +2 -1
index fb8e42c7507a..4ffff7be9299 100644
@@ -601,7 +601,8 @@ int hist_browser__run(struct hist_browser *browser, const char *help)
 			u64 nr_entries;
 			hbt->timer(hbt->arg);
 
-			if (hist_browser__has_filter(browser))
+			if (hist_browser__has_filter(browser) ||
+			    symbol_conf.report_hierarchy)
 				hist_browser__update_nr_entries(browser);
 
 			nr_entries = hist_browser__nr_entries(browser);
Signature · 1 line
2.9.3
#1 lore raw
perf top: Fix refreshing hierarchy entries on TUI
Commit-ID:  c611152373e84a7677cd7d496e849de4debdab66
Gitweb:     http://git.kernel.org/tip/c611152373e84a7677cd7d496e849de4debdab66
Author:     Namhyung Kim <[email protected]>
AuthorDate: Fri, 7 Oct 2016 14:04:12 +0900
Committer:  Arnaldo Carvalho de Melo <[email protected]>
CommitDate: Thu, 13 Oct 2016 11:10:14 -0300

perf top: Fix refreshing hierarchy entries on TUI

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.

Cc Andi Kleen <[email protected]>
Cc Jiri Olsa <[email protected]>
Cc Peter Zijlstra <[email protected]>
Fixes f5b763feebe9 ("perf hists browser: Count number of hierarchy entries")
---
 tools/perf/ui/browsers/hists.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)
tools/perf/ui/browsers/hists.c +2 -1
index fb8e42c..4ffff7b 100644
@@ -601,7 +601,8 @@ int hist_browser__run(struct hist_browser *browser, const char *help)
 			u64 nr_entries;
 			hbt->timer(hbt->arg);
 
-			if (hist_browser__has_filter(browser))
+			if (hist_browser__has_filter(browser) ||
+			    symbol_conf.report_hierarchy)
 				hist_browser__update_nr_entries(browser);
 
 			nr_entries = hist_browser__nr_entries(browser);