From 5061a49c4e8ab1f6ec81dcb6bb2d5e3ba55a67fd Mon Sep 17 00:00:00 2001 From: Dario Faggioli Date: Tue, 23 Oct 2012 04:17:16 -0700 Subject: xen: sched: generalize scheduling related perfcounter macros Moving some of them from sched_credit.c to generic scheduler code. This also allows the other schedulers to use perf counters equally easy. This change is mainly preparatory work for what stated above. In fact, it mostly does s/CSCHED_STAT/SCHED_STAT/, and, in general, it implies no functional changes. Signed-off-by: Dario Faggioli Acked-by: George Dunlap Committed-by: Keir Fraser --- xen/common/schedule.c | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) (limited to 'xen/common/schedule.c') diff --git a/xen/common/schedule.c b/xen/common/schedule.c index 00812ac5b3..231e097475 100644 --- a/xen/common/schedule.c +++ b/xen/common/schedule.c @@ -312,11 +312,13 @@ void sched_destroy_vcpu(struct vcpu *v) int sched_init_domain(struct domain *d) { + SCHED_STAT_CRANK(dom_init); return SCHED_OP(DOM2OP(d), init_domain, d); } void sched_destroy_domain(struct domain *d) { + SCHED_STAT_CRANK(dom_destroy); SCHED_OP(DOM2OP(d), destroy_domain, d); } @@ -1084,7 +1086,7 @@ static void schedule(void) ASSERT(!in_atomic()); - perfc_incr(sched_run); + SCHED_STAT_CRANK(sched_run); sd = &this_cpu(schedule_data); @@ -1162,7 +1164,7 @@ static void schedule(void) pcpu_schedule_unlock_irq(cpu); - perfc_incr(sched_ctx); + SCHED_STAT_CRANK(sched_ctx); stop_timer(&prev->periodic_timer); @@ -1196,7 +1198,7 @@ void context_saved(struct vcpu *prev) static void s_timer_fn(void *unused) { raise_softirq(SCHEDULE_SOFTIRQ); - perfc_incr(sched_irq); + SCHED_STAT_CRANK(sched_irq); } /* Per-VCPU periodic timer function: sends a virtual timer interrupt. */ -- cgit v1.2.3