aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--tools/perf/util/hist.c22
1 files changed, 11 insertions, 11 deletions
diff --git a/tools/perf/util/hist.c b/tools/perf/util/hist.c
index 4ed3e883240d..e4e6249b87d4 100644
--- a/tools/perf/util/hist.c
+++ b/tools/perf/util/hist.c
@@ -181,21 +181,21 @@ void hists__output_recalc_col_len(struct hists *hists, int max_rows)
181 } 181 }
182} 182}
183 183
184static void hist_entry__add_cpumode_period(struct hist_entry *he, 184static void he_stat__add_cpumode_period(struct he_stat *he_stat,
185 unsigned int cpumode, u64 period) 185 unsigned int cpumode, u64 period)
186{ 186{
187 switch (cpumode) { 187 switch (cpumode) {
188 case PERF_RECORD_MISC_KERNEL: 188 case PERF_RECORD_MISC_KERNEL:
189 he->stat.period_sys += period; 189 he_stat->period_sys += period;
190 break; 190 break;
191 case PERF_RECORD_MISC_USER: 191 case PERF_RECORD_MISC_USER:
192 he->stat.period_us += period; 192 he_stat->period_us += period;
193 break; 193 break;
194 case PERF_RECORD_MISC_GUEST_KERNEL: 194 case PERF_RECORD_MISC_GUEST_KERNEL:
195 he->stat.period_guest_sys += period; 195 he_stat->period_guest_sys += period;
196 break; 196 break;
197 case PERF_RECORD_MISC_GUEST_USER: 197 case PERF_RECORD_MISC_GUEST_USER:
198 he->stat.period_guest_us += period; 198 he_stat->period_guest_us += period;
199 break; 199 break;
200 default: 200 default:
201 break; 201 break;
@@ -222,10 +222,10 @@ static void he_stat__add_stat(struct he_stat *dest, struct he_stat *src)
222 dest->weight += src->weight; 222 dest->weight += src->weight;
223} 223}
224 224
225static void hist_entry__decay(struct hist_entry *he) 225static void he_stat__decay(struct he_stat *he_stat)
226{ 226{
227 he->stat.period = (he->stat.period * 7) / 8; 227 he_stat->period = (he_stat->period * 7) / 8;
228 he->stat.nr_events = (he->stat.nr_events * 7) / 8; 228 he_stat->nr_events = (he_stat->nr_events * 7) / 8;
229 /* XXX need decay for weight too? */ 229 /* XXX need decay for weight too? */
230} 230}
231 231
@@ -236,7 +236,7 @@ static bool hists__decay_entry(struct hists *hists, struct hist_entry *he)
236 if (prev_period == 0) 236 if (prev_period == 0)
237 return true; 237 return true;
238 238
239 hist_entry__decay(he); 239 he_stat__decay(&he->stat);
240 240
241 if (!he->filtered) 241 if (!he->filtered)
242 hists->stats.total_period -= prev_period - he->stat.period; 242 hists->stats.total_period -= prev_period - he->stat.period;
@@ -402,7 +402,7 @@ static struct hist_entry *add_hist_entry(struct hists *hists,
402 rb_link_node(&he->rb_node_in, parent, p); 402 rb_link_node(&he->rb_node_in, parent, p);
403 rb_insert_color(&he->rb_node_in, hists->entries_in); 403 rb_insert_color(&he->rb_node_in, hists->entries_in);
404out: 404out:
405 hist_entry__add_cpumode_period(he, al->cpumode, period); 405 he_stat__add_cpumode_period(&he->stat, al->cpumode, period);
406 return he; 406 return he;
407} 407}
408 408