[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20140423142915.GA27585@krava.brq.redhat.com>
Date: Wed, 23 Apr 2014 16:29:16 +0200
From: Jiri Olsa <jolsa@...hat.com>
To: Namhyung Kim <namhyung@...nel.org>
Cc: Arnaldo Carvalho de Melo <acme@...nel.org>,
Peter Zijlstra <a.p.zijlstra@...llo.nl>,
Ingo Molnar <mingo@...nel.org>,
Paul Mackerras <paulus@...ba.org>,
Namhyung Kim <namhyung.kim@....com>,
LKML <linux-kernel@...r.kernel.org>,
David Ahern <dsahern@...il.com>,
Andi Kleen <andi@...stfloor.org>
Subject: Re: [PATCH 7/7] perf hists/tui: Count callchain rows separately
On Wed, Apr 23, 2014 at 04:00:08PM +0900, Namhyung Kim wrote:
> When TUI hist browser expands/collapses callchains it accounted number
> of callchain nodes into total entries to show. However this code
> ignores filtering so that it can make the cursor go to out of screen.
SNIP
hi,
I needed following patch, otherwise following test case would segfault
- record with -g
- report - unfold one symbol
- search for nonsense
the reason is that after unfolding the symbol the nr_callchain_rows
will get some number, which will cause the hist_browser__nr_entries
function return (entries != 0) actually (entries == nr_callchain_rows)
even if there's no entry passing the filter
fixing that by unfolding everything after the filter and reseting
the nr_callchain_rows number
feel free to merge this with your change if you agree ;-)
thanks,
jirka
---
diff --git a/tools/perf/ui/browsers/hists.c b/tools/perf/ui/browsers/hists.c
index 5b81c0d..1cf5f45 100644
--- a/tools/perf/ui/browsers/hists.c
+++ b/tools/perf/ui/browsers/hists.c
@@ -312,6 +312,8 @@ __hist_browser__set_folding(struct hist_browser *browser, bool unfold)
struct rb_node *nd;
struct hists *hists = browser->hists;
+ browser->nr_callchain_rows = 0;
+
for (nd = rb_first(&hists->entries);
(nd = hists__filter_entries(nd, hists, browser->min_pcnt)) != NULL;
nd = rb_next(nd)) {
@@ -323,7 +325,6 @@ __hist_browser__set_folding(struct hist_browser *browser, bool unfold)
static void hist_browser__set_folding(struct hist_browser *browser, bool unfold)
{
- browser->nr_callchain_rows = 0;
__hist_browser__set_folding(browser, unfold);
browser->b.nr_entries = hist_browser__nr_entries(browser);
@@ -1507,6 +1508,7 @@ static int perf_evsel__hists_browse(struct perf_evsel *evsel, int nr_events,
delay_secs * 2) == K_ENTER) {
hists->symbol_filter_str = *buf ? buf : NULL;
hists__filter_by_symbol(hists);
+ __hist_browser__set_folding(browser, false);
hist_browser__reset(browser);
}
continue;
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists