aboutsummaryrefslogtreecommitdiffstats
path: root/tools/perf/ui/browsers/hists.c
diff options
context:
space:
mode:
Diffstat (limited to 'tools/perf/ui/browsers/hists.c')
-rw-r--r--tools/perf/ui/browsers/hists.c45
1 files changed, 25 insertions, 20 deletions
diff --git a/tools/perf/ui/browsers/hists.c b/tools/perf/ui/browsers/hists.c
index 5ffffcb1e3c5..928b4825b752 100644
--- a/tools/perf/ui/browsers/hists.c
+++ b/tools/perf/ui/browsers/hists.c
@@ -1388,25 +1388,26 @@ static int hist_browser__show_hierarchy_entry(struct hist_browser *browser,
1388 HE_COLORSET_NORMAL); 1388 HE_COLORSET_NORMAL);
1389 } 1389 }
1390 1390
1391 ui_browser__write_nstring(&browser->b, "", 2); 1391 perf_hpp_list__for_each_format(entry->hpp_list, fmt) {
1392 width -= 2; 1392 ui_browser__write_nstring(&browser->b, "", 2);
1393 width -= 2;
1393 1394
1394 /* 1395 /*
1395 * No need to call hist_entry__snprintf_alignment() 1396 * No need to call hist_entry__snprintf_alignment()
1396 * since this fmt is always the last column in the 1397 * since this fmt is always the last column in the
1397 * hierarchy mode. 1398 * hierarchy mode.
1398 */ 1399 */
1399 fmt = entry->fmt; 1400 if (fmt->color) {
1400 if (fmt->color) { 1401 width -= fmt->color(fmt, &hpp, entry);
1401 width -= fmt->color(fmt, &hpp, entry); 1402 } else {
1402 } else { 1403 int i = 0;
1403 int i = 0;
1404 1404
1405 width -= fmt->entry(fmt, &hpp, entry); 1405 width -= fmt->entry(fmt, &hpp, entry);
1406 ui_browser__printf(&browser->b, "%s", ltrim(s)); 1406 ui_browser__printf(&browser->b, "%s", ltrim(s));
1407 1407
1408 while (isspace(s[i++])) 1408 while (isspace(s[i++]))
1409 width++; 1409 width++;
1410 }
1410 } 1411 }
1411 } 1412 }
1412 1413
@@ -1934,7 +1935,7 @@ static int hist_browser__fprintf_hierarchy_entry(struct hist_browser *browser,
1934 struct perf_hpp_fmt *fmt; 1935 struct perf_hpp_fmt *fmt;
1935 bool first = true; 1936 bool first = true;
1936 int ret; 1937 int ret;
1937 int hierarchy_indent = (nr_sort_keys + 1) * HIERARCHY_INDENT; 1938 int hierarchy_indent = nr_sort_keys * HIERARCHY_INDENT;
1938 1939
1939 printed = fprintf(fp, "%*s", level * HIERARCHY_INDENT, ""); 1940 printed = fprintf(fp, "%*s", level * HIERARCHY_INDENT, "");
1940 1941
@@ -1962,9 +1963,13 @@ static int hist_browser__fprintf_hierarchy_entry(struct hist_browser *browser,
1962 ret = scnprintf(hpp.buf, hpp.size, "%*s", hierarchy_indent, ""); 1963 ret = scnprintf(hpp.buf, hpp.size, "%*s", hierarchy_indent, "");
1963 advance_hpp(&hpp, ret); 1964 advance_hpp(&hpp, ret);
1964 1965
1965 fmt = he->fmt; 1966 perf_hpp_list__for_each_format(he->hpp_list, fmt) {
1966 ret = fmt->entry(fmt, &hpp, he); 1967 ret = scnprintf(hpp.buf, hpp.size, " ");
1967 advance_hpp(&hpp, ret); 1968 advance_hpp(&hpp, ret);
1969
1970 ret = fmt->entry(fmt, &hpp, he);
1971 advance_hpp(&hpp, ret);
1972 }
1968 1973
1969 printed += fprintf(fp, "%s\n", rtrim(s)); 1974 printed += fprintf(fp, "%s\n", rtrim(s));
1970 1975