diff options
Diffstat (limited to 'tools/perf')
-rw-r--r-- | tools/perf/ui/browsers/hists.c | 48 | ||||
-rw-r--r-- | tools/perf/util/hist.c | 12 |
2 files changed, 43 insertions, 17 deletions
diff --git a/tools/perf/ui/browsers/hists.c b/tools/perf/ui/browsers/hists.c index 4ffff7be9299..a53fef0c673b 100644 --- a/tools/perf/ui/browsers/hists.c +++ b/tools/perf/ui/browsers/hists.c | |||
@@ -1337,8 +1337,8 @@ static int hist_browser__show_hierarchy_entry(struct hist_browser *browser, | |||
1337 | } | 1337 | } |
1338 | 1338 | ||
1339 | if (first) { | 1339 | if (first) { |
1340 | ui_browser__printf(&browser->b, "%c", folded_sign); | 1340 | ui_browser__printf(&browser->b, "%c ", folded_sign); |
1341 | width--; | 1341 | width -= 2; |
1342 | first = false; | 1342 | first = false; |
1343 | } else { | 1343 | } else { |
1344 | ui_browser__printf(&browser->b, " "); | 1344 | ui_browser__printf(&browser->b, " "); |
@@ -1361,8 +1361,10 @@ static int hist_browser__show_hierarchy_entry(struct hist_browser *browser, | |||
1361 | width -= hpp.buf - s; | 1361 | width -= hpp.buf - s; |
1362 | } | 1362 | } |
1363 | 1363 | ||
1364 | ui_browser__write_nstring(&browser->b, "", hierarchy_indent); | 1364 | if (!first) { |
1365 | width -= hierarchy_indent; | 1365 | ui_browser__write_nstring(&browser->b, "", hierarchy_indent); |
1366 | width -= hierarchy_indent; | ||
1367 | } | ||
1366 | 1368 | ||
1367 | if (column >= browser->b.horiz_scroll) { | 1369 | if (column >= browser->b.horiz_scroll) { |
1368 | char s[2048]; | 1370 | char s[2048]; |
@@ -1381,7 +1383,13 @@ static int hist_browser__show_hierarchy_entry(struct hist_browser *browser, | |||
1381 | } | 1383 | } |
1382 | 1384 | ||
1383 | perf_hpp_list__for_each_format(entry->hpp_list, fmt) { | 1385 | perf_hpp_list__for_each_format(entry->hpp_list, fmt) { |
1384 | ui_browser__write_nstring(&browser->b, "", 2); | 1386 | if (first) { |
1387 | ui_browser__printf(&browser->b, "%c ", folded_sign); | ||
1388 | first = false; | ||
1389 | } else { | ||
1390 | ui_browser__write_nstring(&browser->b, "", 2); | ||
1391 | } | ||
1392 | |||
1385 | width -= 2; | 1393 | width -= 2; |
1386 | 1394 | ||
1387 | /* | 1395 | /* |
@@ -1555,10 +1563,11 @@ static int hists_browser__scnprintf_hierarchy_headers(struct hist_browser *brows | |||
1555 | int indent = hists->nr_hpp_node - 2; | 1563 | int indent = hists->nr_hpp_node - 2; |
1556 | bool first_node, first_col; | 1564 | bool first_node, first_col; |
1557 | 1565 | ||
1558 | ret = scnprintf(buf, size, " "); | 1566 | ret = scnprintf(buf, size, " "); |
1559 | if (advance_hpp_check(&dummy_hpp, ret)) | 1567 | if (advance_hpp_check(&dummy_hpp, ret)) |
1560 | return ret; | 1568 | return ret; |
1561 | 1569 | ||
1570 | first_node = true; | ||
1562 | /* the first hpp_list_node is for overhead columns */ | 1571 | /* the first hpp_list_node is for overhead columns */ |
1563 | fmt_node = list_first_entry(&hists->hpp_formats, | 1572 | fmt_node = list_first_entry(&hists->hpp_formats, |
1564 | struct perf_hpp_list_node, list); | 1573 | struct perf_hpp_list_node, list); |
@@ -1573,12 +1582,16 @@ static int hists_browser__scnprintf_hierarchy_headers(struct hist_browser *brows | |||
1573 | ret = scnprintf(dummy_hpp.buf, dummy_hpp.size, " "); | 1582 | ret = scnprintf(dummy_hpp.buf, dummy_hpp.size, " "); |
1574 | if (advance_hpp_check(&dummy_hpp, ret)) | 1583 | if (advance_hpp_check(&dummy_hpp, ret)) |
1575 | break; | 1584 | break; |
1585 | |||
1586 | first_node = false; | ||
1576 | } | 1587 | } |
1577 | 1588 | ||
1578 | ret = scnprintf(dummy_hpp.buf, dummy_hpp.size, "%*s", | 1589 | if (!first_node) { |
1579 | indent * HIERARCHY_INDENT, ""); | 1590 | ret = scnprintf(dummy_hpp.buf, dummy_hpp.size, "%*s", |
1580 | if (advance_hpp_check(&dummy_hpp, ret)) | 1591 | indent * HIERARCHY_INDENT, ""); |
1581 | return ret; | 1592 | if (advance_hpp_check(&dummy_hpp, ret)) |
1593 | return ret; | ||
1594 | } | ||
1582 | 1595 | ||
1583 | first_node = true; | 1596 | first_node = true; |
1584 | list_for_each_entry_continue(fmt_node, &hists->hpp_formats, list) { | 1597 | list_for_each_entry_continue(fmt_node, &hists->hpp_formats, list) { |
@@ -2076,8 +2089,21 @@ void hist_browser__init(struct hist_browser *browser, | |||
2076 | browser->b.use_navkeypressed = true; | 2089 | browser->b.use_navkeypressed = true; |
2077 | browser->show_headers = symbol_conf.show_hist_headers; | 2090 | browser->show_headers = symbol_conf.show_hist_headers; |
2078 | 2091 | ||
2079 | hists__for_each_format(hists, fmt) | 2092 | if (symbol_conf.report_hierarchy) { |
2093 | struct perf_hpp_list_node *fmt_node; | ||
2094 | |||
2095 | /* count overhead columns (in the first node) */ | ||
2096 | fmt_node = list_first_entry(&hists->hpp_formats, | ||
2097 | struct perf_hpp_list_node, list); | ||
2098 | perf_hpp_list__for_each_format(&fmt_node->hpp, fmt) | ||
2099 | ++browser->b.columns; | ||
2100 | |||
2101 | /* add a single column for whole hierarchy sort keys*/ | ||
2080 | ++browser->b.columns; | 2102 | ++browser->b.columns; |
2103 | } else { | ||
2104 | hists__for_each_format(hists, fmt) | ||
2105 | ++browser->b.columns; | ||
2106 | } | ||
2081 | 2107 | ||
2082 | hists__reset_column_width(hists); | 2108 | hists__reset_column_width(hists); |
2083 | } | 2109 | } |
diff --git a/tools/perf/util/hist.c b/tools/perf/util/hist.c index b02992efb513..a69f027368ef 100644 --- a/tools/perf/util/hist.c +++ b/tools/perf/util/hist.c | |||
@@ -1600,18 +1600,18 @@ static void hists__hierarchy_output_resort(struct hists *hists, | |||
1600 | if (prog) | 1600 | if (prog) |
1601 | ui_progress__update(prog, 1); | 1601 | ui_progress__update(prog, 1); |
1602 | 1602 | ||
1603 | hists->nr_entries++; | ||
1604 | if (!he->filtered) { | ||
1605 | hists->nr_non_filtered_entries++; | ||
1606 | hists__calc_col_len(hists, he); | ||
1607 | } | ||
1608 | |||
1603 | if (!he->leaf) { | 1609 | if (!he->leaf) { |
1604 | hists__hierarchy_output_resort(hists, prog, | 1610 | hists__hierarchy_output_resort(hists, prog, |
1605 | &he->hroot_in, | 1611 | &he->hroot_in, |
1606 | &he->hroot_out, | 1612 | &he->hroot_out, |
1607 | min_callchain_hits, | 1613 | min_callchain_hits, |
1608 | use_callchain); | 1614 | use_callchain); |
1609 | hists->nr_entries++; | ||
1610 | if (!he->filtered) { | ||
1611 | hists->nr_non_filtered_entries++; | ||
1612 | hists__calc_col_len(hists, he); | ||
1613 | } | ||
1614 | |||
1615 | continue; | 1615 | continue; |
1616 | } | 1616 | } |
1617 | 1617 | ||