Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S966961AbcKLVRC (ORCPT ); Sat, 12 Nov 2016 16:17:02 -0500 Received: from terminus.zytor.com ([198.137.202.10]:43452 "EHLO terminus.zytor.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S966735AbcKLVRA (ORCPT ); Sat, 12 Nov 2016 16:17:00 -0500 Date: Sat, 12 Nov 2016 02:53:38 -0800 From: tip-bot for Namhyung Kim Message-ID: Cc: namhyung@kernel.org, mingo@kernel.org, jolsa@kernel.org, markus@trippelsdorf.de, acme@redhat.com, hpa@zytor.com, linux-kernel@vger.kernel.org, peterz@infradead.org, tglx@linutronix.de Reply-To: markus@trippelsdorf.de, acme@redhat.com, namhyung@kernel.org, mingo@kernel.org, jolsa@kernel.org, peterz@infradead.org, tglx@linutronix.de, hpa@zytor.com, linux-kernel@vger.kernel.org In-Reply-To: <20161108130833.9263-3-namhyung@kernel.org> References: <20161108130833.9263-3-namhyung@kernel.org> To: linux-tip-commits@vger.kernel.org Subject: [tip:perf/urgent] perf hists browser: Show folded sign properly on --hierarchy Git-Commit-ID: 131d51eb1d17aac3a604cf929fd99ff4dd34f495 X-Mailer: tip-git-log-daemon Robot-ID: Robot-Unsubscribe: Contact to get blacklisted from these emails MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Content-Type: text/plain; charset=UTF-8 Content-Disposition: inline Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1787 Lines: 49 Commit-ID: 131d51eb1d17aac3a604cf929fd99ff4dd34f495 Gitweb: http://git.kernel.org/tip/131d51eb1d17aac3a604cf929fd99ff4dd34f495 Author: Namhyung Kim AuthorDate: Tue, 8 Nov 2016 22:08:31 +0900 Committer: Arnaldo Carvalho de Melo CommitDate: Wed, 9 Nov 2016 11:30:47 -0300 perf hists browser: Show folded sign properly on --hierarchy 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 Tested-by: Arnaldo Carvalho de Melo Tested-by: Markus Trippelsdorf Cc: Jiri Olsa Cc: Peter Zijlstra 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 --- tools/perf/ui/browsers/hists.c | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/tools/perf/ui/browsers/hists.c b/tools/perf/ui/browsers/hists.c index 225ef2a..e767fbd 100644 --- a/tools/perf/ui/browsers/hists.c +++ b/tools/perf/ui/browsers/hists.c @@ -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; /*