Skip to content

Commit

Permalink
perf hists browser: Show folded sign properly on --hierarchy
Browse files Browse the repository at this point in the history
When horizontal scrolling is used in hierarchy mode, the folded signed
disappears at the right most column.

Committer note:

To test it, run 'perf top --hierarchy, see the '+' symbol at the first
column, then press the right arrow key, the '+' symbol will disappear,
this patch fixes that.

Signed-off-by: Namhyung Kim <[email protected]>
Tested-by: Arnaldo Carvalho de Melo <[email protected]>
Tested-by: Markus Trippelsdorf <[email protected]>
Cc: Jiri Olsa <[email protected]>
Cc: Peter Zijlstra <[email protected]>
Link: http://lkml.kernel.org/r/[email protected]
[ Move 'width -= 2' invariant to right after the if/else ]
Signed-off-by: Arnaldo Carvalho de Melo <[email protected]>
  • Loading branch information
namhyung authored and acmel committed Nov 9, 2016
1 parent 3d9f468 commit 131d51e
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion tools/perf/ui/browsers/hists.c
Original file line number Diff line number Diff line change
Expand Up @@ -1381,7 +1381,13 @@ static int hist_browser__show_hierarchy_entry(struct hist_browser *browser,
}

perf_hpp_list__for_each_format(entry->hpp_list, fmt) {
ui_browser__write_nstring(&browser->b, "", 2);
if (first) {
ui_browser__printf(&browser->b, "%c ", folded_sign);
first = false;
} else {
ui_browser__write_nstring(&browser->b, "", 2);
}

width -= 2;

/*
Expand Down

0 comments on commit 131d51e

Please sign in to comment.