From mboxrd@z Thu Jan 1 00:00:00 1970 From: George Dunlap Subject: Re: [PATCH v2 04/16] xen: credit2: pack trace data better for xentrace_format Date: Thu, 18 Feb 2016 11:10:14 +0000 Message-ID: <56C5A696.1060109@citrix.com> References: <20160216180550.27876.22680.stgit@Solace.station> <20160216181136.27876.29825.stgit@Solace.station> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Return-path: Received: from mail6.bemta5.messagelabs.com ([195.245.231.135]) by lists.xen.org with esmtp (Exim 4.72) (envelope-from ) id 1aWMTT-0002fT-1n for xen-devel@lists.xenproject.org; Thu, 18 Feb 2016 11:10:19 +0000 In-Reply-To: <20160216181136.27876.29825.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: Dario Faggioli , xen-devel@lists.xenproject.org Cc: Olaf Hering List-Id: xen-devel@lists.xenproject.org On 16/02/16 18:11, Dario Faggioli wrote: > 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 > Reviewed-by: Konrad Rzeszutek Wilk I was going to say, "We should change xentrace_format and xenalyze in lockstep", but it turns out that they don't support these trace records yet! I must have some patches to xenalyze in a local branch somewhere that I never upstreamed properly. So, all is well: Acked-by: George Dunlap > --- > 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; >