aboutsummaryrefslogtreecommitdiffstats
path: root/tools/perf/ui/hist.c
diff options
context:
space:
mode:
Diffstat (limited to 'tools/perf/ui/hist.c')
-rw-r--r--tools/perf/ui/hist.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/tools/perf/ui/hist.c b/tools/perf/ui/hist.c
index 0f403b83e9d1..0912805c08f4 100644
--- a/tools/perf/ui/hist.c
+++ b/tools/perf/ui/hist.c
@@ -32,10 +32,10 @@ int __hpp__fmt(struct perf_hpp *hpp, struct hist_entry *he,
32 32
33 if (fmt_percent) { 33 if (fmt_percent) {
34 double percent = 0.0; 34 double percent = 0.0;
35 u64 total = hists__total_period(hists);
35 36
36 if (hists->stats.total_period) 37 if (total)
37 percent = 100.0 * get_field(he) / 38 percent = 100.0 * get_field(he) / total;
38 hists->stats.total_period;
39 39
40 ret += hpp__call_print_fn(hpp, print_fn, fmt, percent); 40 ret += hpp__call_print_fn(hpp, print_fn, fmt, percent);
41 } else 41 } else
@@ -50,7 +50,7 @@ int __hpp__fmt(struct perf_hpp *hpp, struct hist_entry *he,
50 50
51 list_for_each_entry(pair, &he->pairs.head, pairs.node) { 51 list_for_each_entry(pair, &he->pairs.head, pairs.node) {
52 u64 period = get_field(pair); 52 u64 period = get_field(pair);
53 u64 total = pair->hists->stats.total_period; 53 u64 total = hists__total_period(pair->hists);
54 54
55 if (!total) 55 if (!total)
56 continue; 56 continue;