From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1161103AbbCLV30 (ORCPT ); Thu, 12 Mar 2015 17:29:26 -0400 Received: from mail.kernel.org ([198.145.29.136]:42213 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1161076AbbCLV3W (ORCPT ); Thu, 12 Mar 2015 17:29:22 -0400 From: Arnaldo Carvalho de Melo To: Ingo Molnar Cc: linux-kernel@vger.kernel.org, He Kuang , Jiri Olsa , Namhyung Kim , Paul Mackerras , Peter Zijlstra , Wang Nan , Arnaldo Carvalho de Melo Subject: [PATCH 15/24] perf hists browser: Fix UI bug after zoom into thread/dso/symbol Date: Thu, 12 Mar 2015 18:27:55 -0300 Message-Id: <1426195684-20046-16-git-send-email-acme@kernel.org> X-Mailer: git-send-email 1.9.3 In-Reply-To: <1426195684-20046-1-git-send-email-acme@kernel.org> References: <1426195684-20046-1-git-send-email-acme@kernel.org> Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: He Kuang When zoom into thread/dso/symbol, the fold/unfold stat is cleared in hists__filter_by_thread/dso/symbol(), but h->nr_rows is not cleared. So if we toggle fold stat on the unfold entires, nr_entries got a wrong value. This bug can be reproduced as follows: $ perf record -g -e syscalls:sys_enter_open ls $ perf report Children Self Command Shared Object Symbol ================================================================ + 50.00% 0.00% ls ld64.so [.] _dl_get_ready_to_run - 50.00% 0.00% ls ld64.so [.] _dl_load_shared_library _dl_load_shared_library <= [Zoom into thread/dso] _dl_get_ready_to_run _start ... In the new thread hists, all entries reset to fold, if we unfold the same entry as we previously unfolded, nr_entries got wrong value, and we can't move down cursor to bottom row. Thread: ls Children Self Command Shared Object Symbol ================================================================ + 50.00% 0.00% ls ld64.so [.] _dl_get_ready_to_run - 50.00% 0.00% ls ld64.so [.] _dl_load_shared_library _dl_load_shared_library _dl_get_ready_to_run <= [cursor may stop here, can't move down] _start ... This patch clear h->nr_rows to fix this bug. Signed-off-by: He Kuang Cc: Jiri Olsa Cc: Namhyung Kim Cc: Paul Mackerras Cc: Peter Zijlstra Cc: Wang Nan Link: http://lkml.kernel.org/r/1426077363-855-2-git-send-email-hekuang@huawei.com Signed-off-by: Arnaldo Carvalho de Melo --- tools/perf/util/hist.c | 1 + 1 file changed, 1 insertion(+) diff --git a/tools/perf/util/hist.c b/tools/perf/util/hist.c index 95f5ab707b74..d9a6d35eda17 100644 --- a/tools/perf/util/hist.c +++ b/tools/perf/util/hist.c @@ -1171,6 +1171,7 @@ static void hists__remove_entry_filter(struct hists *hists, struct hist_entry *h /* force fold unfiltered entry for simplicity */ h->ms.unfolded = false; h->row_offset = 0; + h->nr_rows = 0; hists->stats.nr_non_filtered_samples += h->stat.nr_events; -- 1.9.3