提交 01b4770d 编写于 作者: J Jiri Olsa 提交者: Arnaldo Carvalho de Melo

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: NJiri Olsa <jolsa@kernel.org>
Tested-by: NArnaldo Carvalho de Melo <acme@redhat.com>
Cc: David Ahern <dsahern@gmail.com>
Cc: Namhyung Kim <namhyung@kernel.org>
Cc: Peter Zijlstra <a.p.zijlstra@chello.nl>
Link: http://lkml.kernel.org/r/1465928361-2442-4-git-send-email-jolsa@kernel.orgSigned-off-by: NArnaldo Carvalho de Melo <acme@redhat.com>
上级 94c39988
...@@ -1622,21 +1622,38 @@ static int hists_browser__scnprintf_hierarchy_headers(struct hist_browser *brows ...@@ -1622,21 +1622,38 @@ static int hists_browser__scnprintf_hierarchy_headers(struct hist_browser *brows
return ret; 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]; char headers[1024];
if (symbol_conf.report_hierarchy) hists_browser__scnprintf_hierarchy_headers(browser, headers,
hists_browser__scnprintf_hierarchy_headers(browser, headers, sizeof(headers));
sizeof(headers));
else
hists_browser__scnprintf_headers(browser, headers,
sizeof(headers));
ui_browser__gotorc(&browser->b, 0, 0); ui_browser__gotorc(&browser->b, 0, 0);
ui_browser__set_color(&browser->b, HE_COLORSET_ROOT); ui_browser__set_color(&browser->b, HE_COLORSET_ROOT);
ui_browser__write_nstring(&browser->b, headers, browser->b.width + 1); 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) static void ui_browser__hists_init_top(struct ui_browser *browser)
{ {
if (browser->top == NULL) { if (browser->top == NULL) {
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册