diff options
-rw-r--r-- | tools/perf/ui/hist.c | 20 |
1 files changed, 16 insertions, 4 deletions
diff --git a/tools/perf/ui/hist.c b/tools/perf/ui/hist.c index 78f4c92e9b73..6094562c9523 100644 --- a/tools/perf/ui/hist.c +++ b/tools/perf/ui/hist.c | |||
@@ -52,8 +52,15 @@ static int __hpp__fmt(struct perf_hpp *hpp, struct hist_entry *he, | |||
52 | * zero-fill group members in the middle which | 52 | * zero-fill group members in the middle which |
53 | * have no sample | 53 | * have no sample |
54 | */ | 54 | */ |
55 | ret += print_fn(hpp->buf + ret, hpp->size - ret, | 55 | if (fmt_percent) { |
56 | fmt, 0); | 56 | ret += print_fn(hpp->buf + ret, |
57 | hpp->size - ret, | ||
58 | fmt, 0.0); | ||
59 | } else { | ||
60 | ret += print_fn(hpp->buf + ret, | ||
61 | hpp->size - ret, | ||
62 | fmt, 0ULL); | ||
63 | } | ||
57 | } | 64 | } |
58 | 65 | ||
59 | if (fmt_percent) | 66 | if (fmt_percent) |
@@ -72,8 +79,13 @@ static int __hpp__fmt(struct perf_hpp *hpp, struct hist_entry *he, | |||
72 | /* | 79 | /* |
73 | * zero-fill group members at last which have no sample | 80 | * zero-fill group members at last which have no sample |
74 | */ | 81 | */ |
75 | ret += print_fn(hpp->buf + ret, hpp->size - ret, | 82 | if (fmt_percent) { |
76 | fmt, 0); | 83 | ret += print_fn(hpp->buf + ret, hpp->size - ret, |
84 | fmt, 0.0); | ||
85 | } else { | ||
86 | ret += print_fn(hpp->buf + ret, hpp->size - ret, | ||
87 | fmt, 0ULL); | ||
88 | } | ||
77 | } | 89 | } |
78 | } | 90 | } |
79 | return ret; | 91 | return ret; |