aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorArnaldo Carvalho de Melo <acme@redhat.com>2018-04-06 11:11:11 -0400
committerArnaldo Carvalho de Melo <acme@redhat.com>2018-04-06 11:23:25 -0400
commit94e87a8bd529121ea90219164c65c36ea1d19e56 (patch)
tree77d7c73ab81673ac18b24e35d8b130cee2287f39
parentfdae6400809aa179f8ca04e32f3eb176fb3b3a9d (diff)
perf hists browser: Remove leftover from row returned from refresh
The per-browser screen refresh routine (ui_browser->refresh()) should return the first row that should be cleaned after the rows just printed, in case not all rows available on the screen gets filled. When moving the extra title lines logic from the hists browser to the generic ui_browser class, one piece of that logic remained in the hists browser and then when going back from the annotate browser to the hists browser in a case where fewer lines were displayed in the hists browser, for instance when filtering the entries per substring, one line of the annotate browser would remain on the screen, fix that. Example of the screen artifact: ================================================================================ Samples: 73K of event 'cycles:ppp', 4000 Hz, Event count (approx.): 45172901394 Overhead Shared O Symbol 0.30% [kernel] [k] __indirect_thunk_start 0.09% [kernel] [k] __x86_indirect_thunk_r10 │ lfence ================================================================================ Here from 'perf top' the view was zoomed with '/thunk' to functions having that substring, then the first was annotated and from the annotate browser ESC was pressed, then the first lines were overwritten, but the 'lfence' line remained due to the off by one bug fixed in this cset. Cc: Adrian Hunter <adrian.hunter@intel.com> Cc: Andi Kleen <ak@linux.intel.com> Cc: David Ahern <dsahern@gmail.com> Cc: Jin Yao <yao.jin@linux.intel.com> Cc: Jiri Olsa <jolsa@kernel.org> Cc: Namhyung Kim <namhyung@kernel.org> Cc: Wang Nan <wangnan0@huawei.com> Fixes: ef9ff6017e3c ("perf ui browser: Move the extra title lines from the hists browser") Link: https://lkml.kernel.org/n/tip-odryfso74eaarm0z3e4v9owx@git.kernel.org Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
-rw-r--r--tools/perf/ui/browsers/hists.c10
1 files changed, 2 insertions, 8 deletions
diff --git a/tools/perf/ui/browsers/hists.c b/tools/perf/ui/browsers/hists.c
index de17e59d9952..0eec06c105c6 100644
--- a/tools/perf/ui/browsers/hists.c
+++ b/tools/perf/ui/browsers/hists.c
@@ -1744,17 +1744,11 @@ static void ui_browser__hists_init_top(struct ui_browser *browser)
1744static unsigned int hist_browser__refresh(struct ui_browser *browser) 1744static unsigned int hist_browser__refresh(struct ui_browser *browser)
1745{ 1745{
1746 unsigned row = 0; 1746 unsigned row = 0;
1747 u16 header_offset = 0;
1748 struct rb_node *nd; 1747 struct rb_node *nd;
1749 struct hist_browser *hb = container_of(browser, struct hist_browser, b); 1748 struct hist_browser *hb = container_of(browser, struct hist_browser, b);
1750 struct hists *hists = hb->hists;
1751
1752 if (hb->show_headers) {
1753 struct perf_hpp_list *hpp_list = hists->hpp_list;
1754 1749
1750 if (hb->show_headers)
1755 hist_browser__show_headers(hb); 1751 hist_browser__show_headers(hb);
1756 header_offset = hpp_list->nr_header_lines;
1757 }
1758 1752
1759 ui_browser__hists_init_top(browser); 1753 ui_browser__hists_init_top(browser);
1760 hb->he_selection = NULL; 1754 hb->he_selection = NULL;
@@ -1792,7 +1786,7 @@ static unsigned int hist_browser__refresh(struct ui_browser *browser)
1792 break; 1786 break;
1793 } 1787 }
1794 1788
1795 return row + header_offset; 1789 return row;
1796} 1790}
1797 1791
1798static struct rb_node *hists__filter_entries(struct rb_node *nd, 1792static struct rb_node *hists__filter_entries(struct rb_node *nd,