lkml.org 
[lkml]   [2015]   [Nov]   [27]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
From
Subject[PATCH 07/10] perf hists browser: Update nr entries regardless of min percent
Date
From: Namhyung Kim <namhyung@kernel.org>

When perf report on TUI was called with -S symbol filter, it should
update nr entries even if min_pcnt is 0. IIRC the reason was to update
nr entries after applying minimum percent threshold. But if symbol
filter was given on command line (with -S option), it should use
hists->nr_non_filtered_entries instead of hists->nr_entries.

So this patch fixes a bug of navigating hists browser that the cursor
goes beyond the number of entries when -S (or similar) option is used.

Signed-off-by: Namhyung Kim <namhyung@kernel.org>
Tested-by: Arnaldo Carvalho de Melo <acme@redhat.com>
Cc: David Ahern <dsahern@gmail.com>
Cc: Jiri Olsa <jolsa@redhat.com>
Cc: Peter Zijlstra <a.p.zijlstra@chello.nl>
Link: http://lkml.kernel.org/r/1448645559-31167-3-git-send-email-namhyung@kernel.org
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
---
tools/perf/ui/browsers/hists.c | 5 ++---
1 file changed, 2 insertions(+), 3 deletions(-)

diff --git a/tools/perf/ui/browsers/hists.c b/tools/perf/ui/browsers/hists.c
index a211b7b6a81e..dcdcbafb078b 100644
--- a/tools/perf/ui/browsers/hists.c
+++ b/tools/perf/ui/browsers/hists.c
@@ -2055,10 +2055,9 @@ static int perf_evsel__hists_browse(struct perf_evsel *evsel, int nr_events,
SLang_reset_tty();
SLang_init_tty(0, 0, 0);

- if (min_pcnt) {
+ if (min_pcnt)
browser->min_pcnt = min_pcnt;
- hist_browser__update_nr_entries(browser);
- }
+ hist_browser__update_nr_entries(browser);

browser->pstack = pstack__new(3);
if (browser->pstack == NULL)
--
2.1.0


\
 
 \ /
  Last update: 2015-11-28 02:41    [W:0.082 / U:0.228 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site