aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--tools/perf/util/hist.c11
1 files changed, 8 insertions, 3 deletions
diff --git a/tools/perf/util/hist.c b/tools/perf/util/hist.c
index 75526d123eb2..1f269fd48944 100644
--- a/tools/perf/util/hist.c
+++ b/tools/perf/util/hist.c
@@ -105,11 +105,16 @@ static void hist_entry__decay(struct hist_entry *he)
105 105
106static bool hists__decay_entry(struct hists *hists, struct hist_entry *he) 106static bool hists__decay_entry(struct hists *hists, struct hist_entry *he)
107{ 107{
108 if (he->period == 0) 108 u64 prev_period = he->period;
109
110 if (prev_period == 0)
109 return true; 111 return true;
110 hists->stats.total_period -= he->period; 112
111 hist_entry__decay(he); 113 hist_entry__decay(he);
112 hists->stats.total_period += he->period; 114
115 if (!he->filtered)
116 hists->stats.total_period -= prev_period - he->period;
117
113 return he->period == 0; 118 return he->period == 0;
114} 119}
115 120