Skip to content

Commit

Permalink
perf report/tui: Fix a bug when --fields/sort is given
Browse files Browse the repository at this point in the history
The hists__filter_entries() function is called when down arrow key is
pressed for navigating through the entries in TUI.  It has a check for
filtering out entries that have very small overhead (under min_pcnt).

However it just assumed the entries are sorted by the overhead so when
it saw such a small overheaded entry, it just stopped navigating as an
optimization.  But it's not true anymore due to new --fields and
--sort optoin behavior and this case users cannot go down to a next
entry if ther's an entry with small overhead in-between.

Signed-off-by: Namhyung Kim <namhyung@kernel.org>
Link: http://lkml.kernel.org/r/1400480762-22852-14-git-send-email-namhyung@kernel.org
Signed-off-by: Jiri Olsa <jolsa@kernel.org>
  • Loading branch information
Namhyung Kim authored and Jiri Olsa committed May 21, 2014
1 parent 202e7a6 commit c0f1527
Showing 1 changed file with 1 addition and 4 deletions.
5 changes: 1 addition & 4 deletions tools/perf/ui/browsers/hists.c
Original file line number Diff line number Diff line change
Expand Up @@ -812,10 +812,7 @@ static struct rb_node *hists__filter_entries(struct rb_node *nd,
if (total)
percent = h->stat.period * 100.0 / total;

if (percent < min_pcnt)
return NULL;

if (!h->filtered)
if (!h->filtered && percent >= min_pcnt)
return nd;

nd = rb_next(nd);
Expand Down

0 comments on commit c0f1527

Please sign in to comment.