From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1755154AbbK0RdU (ORCPT ); Fri, 27 Nov 2015 12:33:20 -0500 Received: from mail-pa0-f47.google.com ([209.85.220.47]:33150 "EHLO mail-pa0-f47.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1755052AbbK0RdO (ORCPT ); Fri, 27 Nov 2015 12:33:14 -0500 From: Namhyung Kim To: Arnaldo Carvalho de Melo Cc: Ingo Molnar , Peter Zijlstra , Jiri Olsa , LKML , David Ahern Subject: [PATCH 3/3] perf hists browser: Update nr entries regardless of min percent Date: Sat, 28 Nov 2015 02:32:39 +0900 Message-Id: <1448645559-31167-3-git-send-email-namhyung@kernel.org> X-Mailer: git-send-email 2.6.2 In-Reply-To: <1448645559-31167-1-git-send-email-namhyung@kernel.org> References: <1448645559-31167-1-git-send-email-namhyung@kernel.org> Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.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 --- 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.6.2