Signed-off-by: Dario Faggioli
---
Cc: George Dunlap
Cc: Anshul Makkar
Cc: David Vrabel
---
xen/common/sched_credit2.c | 114 +++-
1 file changed, 59 insertions(+), 55 deletions(-)
diff --git a/xen/common/sched_credit2.c b/xen/common/sched_credit2.c
index e9f3f13..3fdc91c 100644
--- a/xen/common/sched_credit2.c
+++ b/xen/common/sched_credit2.c
@@ -636,6 +636,7 @@ __update_runq_load(const struct scheduler *ops,
ASSERT(rqd->avgload <= STIME_MAX && rqd->b_avgload <= STIME_MAX);
+if ( unlikely(tb_init_done) )
{
struct {
uint64_t rq_avgload, b_avgload;
@@ -646,9 +647,9 @@ __update_runq_load(const struct scheduler *ops,
d.rq_avgload = rqd->avgload;
d.b_avgload = rqd->b_avgload;
d.shift = P;
-trace_var(TRC_CSCHED2_UPDATE_RUNQ_LOAD, 1,
- sizeof(d),
- (unsigned char *)&d);
+__trace_var(TRC_CSCHED2_UPDATE_RUNQ_LOAD, 1,
+sizeof(d),
+(unsigned char *)&d);
}
}
@@ -691,6 +692,7 @@ __update_svc_load(const struct scheduler *ops,
}
svc->load_last_update = now;
+if ( unlikely(tb_init_done) )
{
struct {
uint64_t v_avgload;
@@ -701,9 +703,9 @@ __update_svc_load(const struct scheduler *ops,
d.vcpu = svc->vcpu->vcpu_id;
d.v_avgload = svc->avgload;
d.shift = P;
-trace_var(TRC_CSCHED2_UPDATE_VCPU_LOAD, 1,
- sizeof(d),
- (unsigned char *)&d);
+__trace_var(TRC_CSCHED2_UPDATE_VCPU_LOAD, 1,
+sizeof(d),
+(unsigned char *)&d);
}
}
@@ -759,6 +761,7 @@ runq_insert(const struct scheduler *ops, struct
csched2_vcpu *svc)
pos = __runq_insert(runq, svc);
+if ( unlikely(tb_init_done) )
{
struct {
unsigned vcpu:16, dom:16;
@@ -767,9 +770,9 @@ runq_insert(const struct scheduler *ops, struct
csched2_vcpu *svc)
d.dom = svc->vcpu->domain->domain_id;
d.vcpu = svc->vcpu->vcpu_id;
d.pos = pos;
-trace_var(TRC_CSCHED2_RUNQ_POS, 1,
- sizeof(d),
- (unsigned char *)&d);
+__trace_var(TRC_CSCHED2_RUNQ_POS, 1,
+sizeof(d),
+(unsigned char *)&d);
}
return;
@@ -812,7 +815,7 @@ runq_tickle(const struct scheduler *ops, struct
csched2_vcpu *new, s_time_t now)
ASSERT(new->rqd == rqd);
-/* TRACE */
+if ( unlikely(tb_init_done) )
{
struct {
unsigned vcpu:16, dom:16;
@@ -822,9 +825,9 @@ runq_tickle(const struct scheduler *ops, struct
csched2_vcpu *new, s_time_t now)
d.vcpu = new->vcpu->vcpu_id;
d.processor = new->vcpu->processor;
d.credit = new->credit;
-trace_var(TRC_CSCHED2_TICKLE_NEW, 1,
- sizeof(d),
- (unsigned char *)&d);
+__trace_var(TRC_CSCHED2_TICKLE_NEW, 1,
+sizeof(d),
+(unsigned char *)&d);
}
/*
@@ -882,7 +885,8 @@ runq_tickle(const struct scheduler *ops, struct
csched2_vcpu *new, s_time_t now)
lowest = cur->credit;
}
-/* TRACE */ {
+if ( unlikely(tb_init_done) )
+{
struct {
unsigned vcpu:16, dom:16;
unsigned credit;
@@ -890,9 +894,9 @@ runq_tickle(const struct scheduler *ops, struct
csched2_vcpu *new, s_time_t now)
d.dom = cur->vcpu->domain->domain_id;
d.vcpu = cur->vcpu->vcpu_id;
d.credit = cur->credit;
-trace_var(TRC_CSCHED2_TICKLE_CHECK, 1,
- sizeof(d),
- (unsigned char *)&d);
+__trace_var(TRC_CSCHED2_TICKLE_CHECK, 1,
+sizeof(d),
+(unsigned char *)&d);
}
}
@@ -910,14 +914,15 @@ runq_tickle(const struct scheduler *ops, struct
csched2_vcpu *new, s_time_t now)
tickle:
BUG_ON(ipid == -1);
-/* TRACE */ {
+if ( unlikely(tb_init_done) )
+{
struct {
unsigned cpu:16, pad:16;
} d;
d.cpu = ipid; d.pad = 0;
-trace_var(TRC_CSCHED2_TICKLE, 1,
- sizeof(d),
- (unsigned char *)&d);
+__trace_var(TRC_CSCHED2_TICKLE, 1,
+sizeof(d),
+(unsigned char *)&d);
}
__cpumask_set_cpu(ipid, &rqd->tickled);
cpu_raise_softirq(ipid, SCHEDULE_SOFTIRQ);
@@ -979,7 +984,8 @@ static void reset_credit(const struct scheduler *ops, int
cpu, s_time_t now,
svc->start_time = now;
-/* TRACE */ {
+if ( unlikely(tb_init_done) )
+{
struct {
unsigned vcpu:16, dom:16;
unsigned credit_start, credit_end;
@@ -990,9 +996,9 @@ static void reset_credit(const struct scheduler *ops, int
cpu, s