Message ID | 20160216181257.27876.13452.stgit@Solace.station (mailing list archive) |
---|---|
State | New, archived |
Headers | show |
On 16/02/16 18:12, Dario Faggioli wrote: > so the trace will show properly decoded info, > rather than just a bunch of hex codes. > > Signed-off-by: Dario Faggioli <dario.faggioli@citrix.com> > Reviewed-by: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com> Acked-by: George Dunlap <george.dunlap@citrix.com> > --- > Cc: George Dunlap <george.dunlap@eu.citrix.com> > Cc: Ian Jackson <ian.jackson@eu.citrix.com> > Cc: Ian Campbell <ian.campbell@citrix.com> > Cc: Wei Liu <wei.liu2@citrix.com> > Cc: Olaf Hering <olaf@aepfle.de> > --- > Changes from v1: > * '} * r =' turned into '} *r =', as requested > during review. > --- > tools/xentrace/xenalyze.c | 57 +++++++++++++++++++++++++++++++++++++++++++++ > 1 file changed, 57 insertions(+) > > diff --git a/tools/xentrace/xenalyze.c b/tools/xentrace/xenalyze.c > index 17021f1..4ab2dba 100644 > --- a/tools/xentrace/xenalyze.c > +++ b/tools/xentrace/xenalyze.c > @@ -7673,6 +7673,63 @@ void sched_process(struct pcpu_info *p) > default: > process_generic(&p->ri); > } > + } else if(ri->evt.sub == 2) { > + /* TRC_SCHED_CLASS */ > + switch(ri->event) > + { > + /* CREDIT (TRC_CSCHED_xxx) */ > + case TRC_SCHED_CLASS_EVT(CSCHED, 1): /* SCHED_TASKLET */ > + if(opt.dump_all) > + printf(" %s csched:sched_tasklet\n", ri->dump_header); > + break; > + case TRC_SCHED_CLASS_EVT(CSCHED, 2): /* ACCOUNT_START */ > + case TRC_SCHED_CLASS_EVT(CSCHED, 3): /* ACCOUNT_STOP */ > + if(opt.dump_all) { > + struct { > + unsigned int domid, vcpuid, actv_cnt; > + } *r = (typeof(r))ri->d; > + > + printf(" %s csched:acct_%s d%uv%u, active_vcpus %u\n", > + ri->dump_header, > + ri->event == TRC_SCHED_CLASS_EVT(CSCHED, 2) ? > + "start" : "stop", > + r->domid, r->vcpuid, > + r->actv_cnt); > + } > + break; > + case TRC_SCHED_CLASS_EVT(CSCHED, 4): /* STOLEN_VCPU */ > + if(opt.dump_all) { > + struct { > + unsigned int peer_cpu, domid, vcpuid; > + } *r = (typeof(r))ri->d; > + > + printf(" %s csched:stolen_vcpu d%uv%u from cpu %u\n", > + ri->dump_header, r->domid, r->vcpuid, r->peer_cpu); > + } > + break; > + case TRC_SCHED_CLASS_EVT(CSCHED, 5): /* PICKED_CPU */ > + if(opt.dump_all) { > + struct { > + unsigned int domid, vcpuid, cpu; > + } *r = (typeof(r))ri->d; > + > + printf(" %s csched:pick_cpu %u for d%uv%u\n", > + ri->dump_header, r->cpu, r->domid, r->vcpuid); > + } > + break; > + case TRC_SCHED_CLASS_EVT(CSCHED, 6): /* TICKLE */ > + if(opt.dump_all) { > + struct { > + unsigned int cpu; > + } *r = (typeof(r))ri->d; > + > + printf(" %s csched:runq_tickle, cpu %u\n", > + ri->dump_header, r->cpu); > + } > + break; > + default: > + process_generic(ri); > + } > } else { > UPDATE_VOLUME(p, sched_verbose, ri->size); > process_generic(&p->ri); >
On 16/02/16 18:12, Dario Faggioli wrote: > so the trace will show properly decoded info, > rather than just a bunch of hex codes. > > Signed-off-by: Dario Faggioli <dario.faggioli@citrix.com> > Reviewed-by: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com> > --- > Cc: George Dunlap <george.dunlap@eu.citrix.com> > Cc: Ian Jackson <ian.jackson@eu.citrix.com> > Cc: Ian Campbell <ian.campbell@citrix.com> > Cc: Wei Liu <wei.liu2@citrix.com> > Cc: Olaf Hering <olaf@aepfle.de> > --- > Changes from v1: > * '} * r =' turned into '} *r =', as requested > during review. > --- > tools/xentrace/xenalyze.c | 57 +++++++++++++++++++++++++++++++++++++++++++++ > 1 file changed, 57 insertions(+) > > diff --git a/tools/xentrace/xenalyze.c b/tools/xentrace/xenalyze.c > index 17021f1..4ab2dba 100644 > --- a/tools/xentrace/xenalyze.c > +++ b/tools/xentrace/xenalyze.c > @@ -7673,6 +7673,63 @@ void sched_process(struct pcpu_info *p) > default: > process_generic(&p->ri); > } > + } else if(ri->evt.sub == 2) { > + /* TRC_SCHED_CLASS */ > + switch(ri->event) > + { > + /* CREDIT (TRC_CSCHED_xxx) */ > + case TRC_SCHED_CLASS_EVT(CSCHED, 1): /* SCHED_TASKLET */ Sorry, just one more comment: It would probably be good at some point to find a way to expose these in a public header, rather than having to manually keep this file in sync with the values in sched_*.c. But that's a nice-to-have for another day. :-) (Maybe a cleanup for a GSoC / OPW student...?) -George > + if(opt.dump_all) > + printf(" %s csched:sched_tasklet\n", ri->dump_header); > + break; > + case TRC_SCHED_CLASS_EVT(CSCHED, 2): /* ACCOUNT_START */ > + case TRC_SCHED_CLASS_EVT(CSCHED, 3): /* ACCOUNT_STOP */ > + if(opt.dump_all) { > + struct { > + unsigned int domid, vcpuid, actv_cnt; > + } *r = (typeof(r))ri->d; > + > + printf(" %s csched:acct_%s d%uv%u, active_vcpus %u\n", > + ri->dump_header, > + ri->event == TRC_SCHED_CLASS_EVT(CSCHED, 2) ? > + "start" : "stop", > + r->domid, r->vcpuid, > + r->actv_cnt); > + } > + break; > + case TRC_SCHED_CLASS_EVT(CSCHED, 4): /* STOLEN_VCPU */ > + if(opt.dump_all) { > + struct { > + unsigned int peer_cpu, domid, vcpuid; > + } *r = (typeof(r))ri->d; > + > + printf(" %s csched:stolen_vcpu d%uv%u from cpu %u\n", > + ri->dump_header, r->domid, r->vcpuid, r->peer_cpu); > + } > + break; > + case TRC_SCHED_CLASS_EVT(CSCHED, 5): /* PICKED_CPU */ > + if(opt.dump_all) { > + struct { > + unsigned int domid, vcpuid, cpu; > + } *r = (typeof(r))ri->d; > + > + printf(" %s csched:pick_cpu %u for d%uv%u\n", > + ri->dump_header, r->cpu, r->domid, r->vcpuid); > + } > + break; > + case TRC_SCHED_CLASS_EVT(CSCHED, 6): /* TICKLE */ > + if(opt.dump_all) { > + struct { > + unsigned int cpu; > + } *r = (typeof(r))ri->d; > + > + printf(" %s csched:runq_tickle, cpu %u\n", > + ri->dump_header, r->cpu); > + } > + break; > + default: > + process_generic(ri); > + } > } else { > UPDATE_VOLUME(p, sched_verbose, ri->size); > process_generic(&p->ri); >
On Thu, 2016-02-18 at 15:31 +0000, George Dunlap wrote: > On 16/02/16 18:12, Dario Faggioli wrote: > > > > diff --git a/tools/xentrace/xenalyze.c b/tools/xentrace/xenalyze.c > > index 17021f1..4ab2dba 100644 > > --- a/tools/xentrace/xenalyze.c > > +++ b/tools/xentrace/xenalyze.c > > @@ -7673,6 +7673,63 @@ void sched_process(struct pcpu_info *p) > > default: > > process_generic(&p->ri); > > } > > + } else if(ri->evt.sub == 2) { > > + /* TRC_SCHED_CLASS */ > > + switch(ri->event) > > + { > > + /* CREDIT (TRC_CSCHED_xxx) */ > > + case TRC_SCHED_CLASS_EVT(CSCHED, 1): /* SCHED_TASKLET */ > > Sorry, just one more comment: > > It would probably be good at some point to find a way to expose these > in > a public header, rather than having to manually keep this file in > sync > with the values in sched_*.c. But that's a nice-to-have for another > day. :-) > Indeed. I can add this to my TODO list, although... > (Maybe a cleanup for a GSoC / OPW student...?) > ... that's actually a good idea (and we should add this to the list of similar projects, if we keep one). Regards, Dario
diff --git a/tools/xentrace/xenalyze.c b/tools/xentrace/xenalyze.c index 17021f1..4ab2dba 100644 --- a/tools/xentrace/xenalyze.c +++ b/tools/xentrace/xenalyze.c @@ -7673,6 +7673,63 @@ void sched_process(struct pcpu_info *p) default: process_generic(&p->ri); } + } else if(ri->evt.sub == 2) { + /* TRC_SCHED_CLASS */ + switch(ri->event) + { + /* CREDIT (TRC_CSCHED_xxx) */ + case TRC_SCHED_CLASS_EVT(CSCHED, 1): /* SCHED_TASKLET */ + if(opt.dump_all) + printf(" %s csched:sched_tasklet\n", ri->dump_header); + break; + case TRC_SCHED_CLASS_EVT(CSCHED, 2): /* ACCOUNT_START */ + case TRC_SCHED_CLASS_EVT(CSCHED, 3): /* ACCOUNT_STOP */ + if(opt.dump_all) { + struct { + unsigned int domid, vcpuid, actv_cnt; + } *r = (typeof(r))ri->d; + + printf(" %s csched:acct_%s d%uv%u, active_vcpus %u\n", + ri->dump_header, + ri->event == TRC_SCHED_CLASS_EVT(CSCHED, 2) ? + "start" : "stop", + r->domid, r->vcpuid, + r->actv_cnt); + } + break; + case TRC_SCHED_CLASS_EVT(CSCHED, 4): /* STOLEN_VCPU */ + if(opt.dump_all) { + struct { + unsigned int peer_cpu, domid, vcpuid; + } *r = (typeof(r))ri->d; + + printf(" %s csched:stolen_vcpu d%uv%u from cpu %u\n", + ri->dump_header, r->domid, r->vcpuid, r->peer_cpu); + } + break; + case TRC_SCHED_CLASS_EVT(CSCHED, 5): /* PICKED_CPU */ + if(opt.dump_all) { + struct { + unsigned int domid, vcpuid, cpu; + } *r = (typeof(r))ri->d; + + printf(" %s csched:pick_cpu %u for d%uv%u\n", + ri->dump_header, r->cpu, r->domid, r->vcpuid); + } + break; + case TRC_SCHED_CLASS_EVT(CSCHED, 6): /* TICKLE */ + if(opt.dump_all) { + struct { + unsigned int cpu; + } *r = (typeof(r))ri->d; + + printf(" %s csched:runq_tickle, cpu %u\n", + ri->dump_header, r->cpu); + } + break; + default: + process_generic(ri); + } } else { UPDATE_VOLUME(p, sched_verbose, ri->size); process_generic(&p->ri);