diff options
| author | Jiri Olsa <jolsa@kernel.org> | 2016-06-14 14:19:13 -0400 |
|---|---|---|
| committer | Arnaldo Carvalho de Melo <acme@redhat.com> | 2016-06-15 09:44:22 -0400 |
| commit | 01b4770d5654fcb71645a1ee095759c255048466 (patch) | |
| tree | 38e8059bd56fefbc46f948d2f8701acd8cff1246 /tools/perf/ui | |
| parent | 94c39988995d34f3de1b1763cc32141c67c0340c (diff) | |
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 <jolsa@kernel.org>
Tested-by: Arnaldo 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.org
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
Diffstat (limited to 'tools/perf/ui')
| -rw-r--r-- | tools/perf/ui/browsers/hists.c | 31 |
1 files changed, 24 insertions, 7 deletions
diff --git a/tools/perf/ui/browsers/hists.c b/tools/perf/ui/browsers/hists.c index 538bae880bfe..e21ea52da164 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 | |||
| 1622 | return ret; | 1622 | return ret; |
| 1623 | } | 1623 | } |
| 1624 | 1624 | ||
| 1625 | static void hist_browser__show_headers(struct hist_browser *browser) | 1625 | static void hists_browser__hierarchy_headers(struct hist_browser *browser) |
| 1626 | { | 1626 | { |
| 1627 | char headers[1024]; | 1627 | char headers[1024]; |
| 1628 | 1628 | ||
| 1629 | if (symbol_conf.report_hierarchy) | 1629 | hists_browser__scnprintf_hierarchy_headers(browser, headers, |
| 1630 | hists_browser__scnprintf_hierarchy_headers(browser, headers, | 1630 | sizeof(headers)); |
| 1631 | sizeof(headers)); | 1631 | |
| 1632 | else | ||
| 1633 | hists_browser__scnprintf_headers(browser, headers, | ||
| 1634 | sizeof(headers)); | ||
| 1635 | ui_browser__gotorc(&browser->b, 0, 0); | 1632 | ui_browser__gotorc(&browser->b, 0, 0); |
| 1636 | ui_browser__set_color(&browser->b, HE_COLORSET_ROOT); | 1633 | ui_browser__set_color(&browser->b, HE_COLORSET_ROOT); |
| 1637 | ui_browser__write_nstring(&browser->b, headers, browser->b.width + 1); | 1634 | ui_browser__write_nstring(&browser->b, headers, browser->b.width + 1); |
| 1638 | } | 1635 | } |
| 1639 | 1636 | ||
| 1637 | static void hists_browser__headers(struct hist_browser *browser) | ||
| 1638 | { | ||
| 1639 | char headers[1024]; | ||
| 1640 | |||
| 1641 | hists_browser__scnprintf_headers(browser, headers, | ||
| 1642 | sizeof(headers)); | ||
| 1643 | |||
| 1644 | ui_browser__gotorc(&browser->b, 0, 0); | ||
| 1645 | ui_browser__set_color(&browser->b, HE_COLORSET_ROOT); | ||
| 1646 | ui_browser__write_nstring(&browser->b, headers, browser->b.width + 1); | ||
| 1647 | } | ||
| 1648 | |||
| 1649 | static void hist_browser__show_headers(struct hist_browser *browser) | ||
| 1650 | { | ||
| 1651 | if (symbol_conf.report_hierarchy) | ||
| 1652 | hists_browser__hierarchy_headers(browser); | ||
| 1653 | else | ||
| 1654 | hists_browser__headers(browser); | ||
| 1655 | } | ||
| 1656 | |||
| 1640 | static void ui_browser__hists_init_top(struct ui_browser *browser) | 1657 | static void ui_browser__hists_init_top(struct ui_browser *browser) |
| 1641 | { | 1658 | { |
| 1642 | if (browser->top == NULL) { | 1659 | if (browser->top == NULL) { |
