* [PATCH] xen/tools: tracing: credits can go negative, so use int.
@ 2017-01-18 11:32 Dario Faggioli
2017-02-01 14:37 ` George Dunlap
0 siblings, 1 reply; 2+ messages in thread
From: Dario Faggioli @ 2017-01-18 11:32 UTC (permalink / raw)
To: xen-devel; +Cc: George Dunlap
For Credit2, in both the trace records, inside Xen,
and in their parsing, in xenalyze.
In fact, as it is quite a bit better, in order to
understand how much negative credits have gone for
a certain vCPU, to see an actual negative number,
as compared to a wrapped around unsigned!
Signed-off-by: Dario Faggioli <dario.faggioli@citrix.com>
---
Cc: George Dunlap <george.dunlap@eu.citrix.com>
---
tools/xentrace/xenalyze.c | 20 ++++++++++----------
xen/common/sched_credit2.c | 10 +++++-----
2 files changed, 15 insertions(+), 15 deletions(-)
diff --git a/tools/xentrace/xenalyze.c b/tools/xentrace/xenalyze.c
index f006804..a90da20 100644
--- a/tools/xentrace/xenalyze.c
+++ b/tools/xentrace/xenalyze.c
@@ -7651,11 +7651,11 @@ void sched_process(struct pcpu_info *p)
case TRC_SCHED_CLASS_EVT(CSCHED2, 3): /* CREDIT_BURN */
if(opt.dump_all) {
struct {
- unsigned int vcpuid:16, domid:16, credit;
- int delta;
+ unsigned int vcpuid:16, domid:16;
+ int credit, delta;
} *r = (typeof(r))ri->d;
- printf(" %s csched2:burn_credits d%uv%u, credit = %u, delta = %d\n",
+ printf(" %s csched2:burn_credits d%uv%u, credit = %d, delta = %d\n",
ri->dump_header, r->domid, r->vcpuid,
r->credit, r->delta);
}
@@ -7664,10 +7664,10 @@ void sched_process(struct pcpu_info *p)
if(opt.dump_all) {
struct {
unsigned int vcpuid:16, domid:16;
- unsigned int credit;
+ int credit;
} *r = (typeof(r))ri->d;
- printf(" %s csched2:tickle_check d%uv%u, credit = %u\n",
+ printf(" %s csched2:tickle_check d%uv%u, credit = %d\n",
ri->dump_header, r->domid, r->vcpuid, r->credit);
}
break;
@@ -7685,12 +7685,12 @@ void sched_process(struct pcpu_info *p)
if(opt.dump_all) {
struct {
unsigned int vcpuid:16, domid:16;
- unsigned int credit_start, credit_end;
+ int credit_start, credit_end;
unsigned int multiplier;
} *r = (typeof(r))ri->d;
printf(" %s csched2:reset_credits d%uv%u, "
- "credit_start = %u, credit_end = %u, mult = %u\n",
+ "credit_start = %d, credit_end = %d, mult = %u\n",
ri->dump_header, r->domid, r->vcpuid,
r->credit_start, r->credit_end, r->multiplier);
}
@@ -7752,12 +7752,12 @@ void sched_process(struct pcpu_info *p)
case TRC_SCHED_CLASS_EVT(CSCHED2, 13): /* TICKLE_NEW */
if (opt.dump_all) {
struct {
- unsigned vcpuid:16, domid:16;
- unsigned processor, credit;
+ unsigned int vcpuid:16, domid:16, processor;
+ int credit;
} *r = (typeof(r))ri->d;
printf(" %s csched2:runq_tickle_new d%uv%u, "
- "processor = %u, credit = %u\n",
+ "processor = %u, credit = %d\n",
ri->dump_header, r->domid, r->vcpuid,
r->processor, r->credit);
}
diff --git a/xen/common/sched_credit2.c b/xen/common/sched_credit2.c
index ef8e0d8..50a5115 100644
--- a/xen/common/sched_credit2.c
+++ b/xen/common/sched_credit2.c
@@ -930,7 +930,8 @@ runq_tickle(const struct scheduler *ops, struct csched2_vcpu *new, s_time_t now)
{
struct {
unsigned vcpu:16, dom:16;
- unsigned processor, credit;
+ unsigned processor;
+ int credit;
} d;
d.dom = new->vcpu->domain->domain_id;
d.vcpu = new->vcpu->vcpu_id;
@@ -1026,7 +1027,7 @@ runq_tickle(const struct scheduler *ops, struct csched2_vcpu *new, s_time_t now)
{
struct {
unsigned vcpu:16, dom:16;
- unsigned credit;
+ int credit;
} d;
d.dom = cur->vcpu->domain->domain_id;
d.vcpu = cur->vcpu->vcpu_id;
@@ -1131,7 +1132,7 @@ static void reset_credit(const struct scheduler *ops, int cpu, s_time_t now,
{
struct {
unsigned vcpu:16, dom:16;
- unsigned credit_start, credit_end;
+ int credit_start, credit_end;
unsigned multiplier;
} d;
d.dom = svc->vcpu->domain->domain_id;
@@ -1181,8 +1182,7 @@ void burn_credits(struct csched2_runqueue_data *rqd,
{
struct {
unsigned vcpu:16, dom:16;
- unsigned credit;
- int delta;
+ int credit, delta;
} d;
d.dom = svc->vcpu->domain->domain_id;
d.vcpu = svc->vcpu->vcpu_id;
_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
https://lists.xen.org/xen-devel
^ permalink raw reply related [flat|nested] 2+ messages in thread
* Re: [PATCH] xen/tools: tracing: credits can go negative, so use int.
2017-01-18 11:32 [PATCH] xen/tools: tracing: credits can go negative, so use int Dario Faggioli
@ 2017-02-01 14:37 ` George Dunlap
0 siblings, 0 replies; 2+ messages in thread
From: George Dunlap @ 2017-02-01 14:37 UTC (permalink / raw)
To: Dario Faggioli, xen-devel; +Cc: George Dunlap
On 18/01/17 11:32, Dario Faggioli wrote:
> For Credit2, in both the trace records, inside Xen,
> and in their parsing, in xenalyze.
>
> In fact, as it is quite a bit better, in order to
> understand how much negative credits have gone for
> a certain vCPU, to see an actual negative number,
> as compared to a wrapped around unsigned!
>
> Signed-off-by: Dario Faggioli <dario.faggioli@citrix.com>
Reviewed-by: George Dunlap <george.dunlap@citrix.com>
_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
https://lists.xen.org/xen-devel
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2017-02-01 14:37 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2017-01-18 11:32 [PATCH] xen/tools: tracing: credits can go negative, so use int Dario Faggioli
2017-02-01 14:37 ` George Dunlap
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).