From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754012AbcFPIfh (ORCPT ); Thu, 16 Jun 2016 04:35:37 -0400 Received: from terminus.zytor.com ([198.137.202.10]:33374 "EHLO terminus.zytor.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751276AbcFPIfc (ORCPT ); Thu, 16 Jun 2016 04:35:32 -0400 Date: Thu, 16 Jun 2016 01:35:22 -0700 From: tip-bot for Jiri Olsa Message-ID: Cc: mingo@kernel.org, hpa@zytor.com, acme@redhat.com, namhyung@kernel.org, dsahern@gmail.com, tglx@linutronix.de, a.p.zijlstra@chello.nl, jolsa@kernel.org, linux-kernel@vger.kernel.org Reply-To: jolsa@kernel.org, linux-kernel@vger.kernel.org, a.p.zijlstra@chello.nl, tglx@linutronix.de, dsahern@gmail.com, namhyung@kernel.org, hpa@zytor.com, acme@redhat.com, mingo@kernel.org In-Reply-To: <1465928361-2442-4-git-send-email-jolsa@kernel.org> References: <1465928361-2442-4-git-send-email-jolsa@kernel.org> To: linux-tip-commits@vger.kernel.org Subject: [tip:perf/core] perf tui: Separate hierarchy and standard headers output Git-Commit-ID: 01b4770d5654fcb71645a1ee095759c255048466 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 Commit-ID: 01b4770d5654fcb71645a1ee095759c255048466 Gitweb: http://git.kernel.org/tip/01b4770d5654fcb71645a1ee095759c255048466 Author: Jiri Olsa AuthorDate: Tue, 14 Jun 2016 20:19:13 +0200 Committer: Arnaldo Carvalho de Melo CommitDate: Wed, 15 Jun 2016 10:44:22 -0300 perf tui: Separate hierarchy and standard headers output It will be useful for future changes that enhance headers with multiple lines and span columns, which don't affect hierarchy headers. Signed-off-by: Jiri Olsa Tested-by: Arnaldo Carvalho de Melo Cc: David Ahern Cc: Namhyung Kim Cc: Peter Zijlstra Link: http://lkml.kernel.org/r/1465928361-2442-4-git-send-email-jolsa@kernel.org Signed-off-by: Arnaldo Carvalho de Melo --- tools/perf/ui/browsers/hists.c | 31 ++++++++++++++++++++++++------- 1 file changed, 24 insertions(+), 7 deletions(-) diff --git a/tools/perf/ui/browsers/hists.c b/tools/perf/ui/browsers/hists.c index 538bae8..e21ea52 100644 --- a/tools/perf/ui/browsers/hists.c +++ b/tools/perf/ui/browsers/hists.c @@ -1622,21 +1622,38 @@ static int hists_browser__scnprintf_hierarchy_headers(struct hist_browser *brows return ret; } -static void hist_browser__show_headers(struct hist_browser *browser) +static void hists_browser__hierarchy_headers(struct hist_browser *browser) { char headers[1024]; - if (symbol_conf.report_hierarchy) - hists_browser__scnprintf_hierarchy_headers(browser, headers, - sizeof(headers)); - else - hists_browser__scnprintf_headers(browser, headers, - sizeof(headers)); + hists_browser__scnprintf_hierarchy_headers(browser, headers, + sizeof(headers)); + ui_browser__gotorc(&browser->b, 0, 0); ui_browser__set_color(&browser->b, HE_COLORSET_ROOT); ui_browser__write_nstring(&browser->b, headers, browser->b.width + 1); } +static void hists_browser__headers(struct hist_browser *browser) +{ + char headers[1024]; + + hists_browser__scnprintf_headers(browser, headers, + sizeof(headers)); + + ui_browser__gotorc(&browser->b, 0, 0); + ui_browser__set_color(&browser->b, HE_COLORSET_ROOT); + ui_browser__write_nstring(&browser->b, headers, browser->b.width + 1); +} + +static void hist_browser__show_headers(struct hist_browser *browser) +{ + if (symbol_conf.report_hierarchy) + hists_browser__hierarchy_headers(browser); + else + hists_browser__headers(browser); +} + static void ui_browser__hists_init_top(struct ui_browser *browser) { if (browser->top == NULL) {