]> git.proxmox.com Git - mirror_ubuntu-zesty-kernel.git/commitdiff
perf hists browser: Show folded sign properly on --hierarchy
authorNamhyung Kim <namhyung@kernel.org>
Tue, 8 Nov 2016 13:08:31 +0000 (22:08 +0900)
committerArnaldo Carvalho de Melo <acme@redhat.com>
Wed, 9 Nov 2016 14:30:47 +0000 (11:30 -0300)
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 <namhyung@kernel.org>
Tested-by: Arnaldo Carvalho de Melo <acme@redhat.com>
Tested-by: Markus Trippelsdorf <markus@trippelsdorf.de>
Cc: Jiri Olsa <jolsa@kernel.org>
Cc: Peter Zijlstra <peterz@infradead.org>
Link: http://lkml.kernel.org/r/20161108130833.9263-3-namhyung@kernel.org
[ Move 'width -= 2' invariant to right after the if/else ]
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
tools/perf/ui/browsers/hists.c

index 225ef2a15a13218d1319b5c4ecc1cbf64ee0766b..e767fbd17ad2c30f8b4be89d1b3f1abdc338f7e5 100644 (file)
@@ -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;
 
                        /*