From mboxrd@z Thu Jan 1 00:00:00 1970 From: Dario Faggioli Subject: [PATCH 04/14] xen: credit2: pack trace data better for xentrace_format Date: Fri, 05 Feb 2016 19:33:57 +0100 Message-ID: <20160205183357.4543.57665.stgit@Solace.station> References: <20160205183137.4543.56523.stgit@Solace.station> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Return-path: Received: from mail6.bemta3.messagelabs.com ([195.245.230.39]) by lists.xen.org with esmtp (Exim 4.72) (envelope-from ) id 1aRlCj-0003s8-Vd for xen-devel@lists.xenproject.org; Fri, 05 Feb 2016 18:34:02 +0000 Received: by mail-wm0-f68.google.com with SMTP id 128so4175578wmz.3 for ; Fri, 05 Feb 2016 10:34:00 -0800 (PST) In-Reply-To: <20160205183137.4543.56523.stgit@Solace.station> List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Sender: xen-devel-bounces@lists.xen.org Errors-To: xen-devel-bounces@lists.xen.org To: xen-devel@lists.xenproject.org Cc: Olaf Hering , George Dunlap List-Id: xen-devel@lists.xenproject.org when tracing runstate changes, the vcpu and domain IDs are encoded in the lower and higher, respectively, parts of a 32 bits integer. When decoding a trace with xentrace_format, this makes it possible to display such events like this: CPU0 833435853624 (+ 768) running_to_runnable [ dom:vcpu = 0x7fff0000 ] CPU0 833435854416 (+ 792) runnable_to_running [ dom:vcpu = 0x00000007 ] For consistency, we should do the same when displaying the events coming from the Credit2 scheduler (when using the same tool), and to do that, we need to invert the order in which the fields are being put in the trace struct right now. Signed-off-by: Dario Faggioli --- Cc: George Dunlap Cc: Olaf Hering --- xen/common/sched_credit2.c | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/xen/common/sched_credit2.c b/xen/common/sched_credit2.c index 78220a7..cf40f68 100644 --- a/xen/common/sched_credit2.c +++ b/xen/common/sched_credit2.c @@ -382,7 +382,7 @@ __update_svc_load(const struct scheduler *ops, { struct { - unsigned dom:16,vcpu:16; + unsigned vcpu:16, dom:16; unsigned v_avgload:32; } d; d.dom = svc->vcpu->domain->domain_id; @@ -450,7 +450,7 @@ runq_insert(const struct scheduler *ops, unsigned int cpu, struct csched2_vcpu * { struct { - unsigned dom:16,vcpu:16; + unsigned vcpu:16, dom:16; unsigned pos; } d; d.dom = svc->vcpu->domain->domain_id; @@ -536,7 +536,7 @@ runq_tickle(const struct scheduler *ops, unsigned int cpu, struct csched2_vcpu * /* TRACE */ { struct { - unsigned dom:16,vcpu:16; + unsigned vcpu:16, dom:16; unsigned credit; } d; d.dom = cur->vcpu->domain->domain_id; @@ -561,9 +561,9 @@ tickle: /* TRACE */ { struct { - unsigned cpu:8; + unsigned cpu:16, pad:16; } d; - d.cpu = ipid; + d.cpu = ipid; d.pad = 0; trace_var(TRC_CSCHED2_TICKLE, 0, sizeof(d), (unsigned char *)&d); @@ -634,7 +634,7 @@ static void reset_credit(const struct scheduler *ops, int cpu, s_time_t now, /* TRACE */ { struct { - unsigned dom:16,vcpu:16; + unsigned vcpu:16, dom:16; unsigned credit_start, credit_end; unsigned multiplier; } d; @@ -683,7 +683,7 @@ void burn_credits(struct csched2_runqueue_data *rqd, struct csched2_vcpu *svc, s /* TRACE */ { struct { - unsigned dom:16,vcpu:16; + unsigned vcpu:16, dom:16; unsigned credit; int delta; } d; @@ -812,7 +812,7 @@ __runq_assign(struct csched2_vcpu *svc, struct csched2_runqueue_data *rqd) /* TRACE */ { struct { - unsigned dom:16,vcpu:16; + unsigned vcpu:16, dom:16; unsigned rqi:16; } d; d.dom = svc->vcpu->domain->domain_id;