All of lore.kernel.org
 help / color / mirror / Atom feed
From: Dario Faggioli <dario.faggioli@citrix.com>
To: xen-devel@lists.xenproject.org
Cc: George Dunlap <george.dunlap@eu.citrix.com>
Subject: [PATCH 7/9] xen/tools: tracing: credits can go negative, so use int.
Date: Thu, 26 Jan 2017 01:30:35 +0100	[thread overview]
Message-ID: <148539063552.5464.11983958099406902513.stgit@Solace.fritz.box> (raw)
In-Reply-To: <148539008889.5464.5896389113741708672.stgit@Solace.fritz.box>

For Credit2, in both the trace records, inside Xen,
and in their parsing, in xenalyze.

In fact, it is a lot easier to figure out how much
negative credits have gone for a certain vCPU by
looking at a negative integer, rather than to an
overflowed 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 07e0a6d..43db669 100644
--- a/xen/common/sched_credit2.c
+++ b/xen/common/sched_credit2.c
@@ -1165,7 +1165,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;
@@ -1264,7 +1265,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;
@@ -1378,7 +1379,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;
@@ -1428,8 +1429,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

  parent reply	other threads:[~2017-01-26  0:30 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-01-26  0:29 [PATCH 0/9] xen: credit2: improve style, and tracing; fix two bugs Dario Faggioli
2017-01-26  0:29 ` [PATCH 1/9] xen: credit2: improve comments' style and definition of CSFLAG-s Dario Faggioli
2017-01-26  0:30 ` [PATCH 2/9] xen: credit2: make accessor helpers inline functions instead of macros Dario Faggioli
2017-01-26  0:30 ` [PATCH 3/9] xen: credit2: tidy up functions names by removing leading '__' Dario Faggioli
2017-01-26  0:30 ` [PATCH 4/9] xen: credit2: group the runq manipulating functions Dario Faggioli
2017-01-26  0:30 ` [PATCH 5/9] xen: credit2: always mark a tickled pCPU as... tickled! Dario Faggioli
2017-01-26  0:30 ` [PATCH 6/9] xen: credit2: don't miss accounting while doing a credit reset Dario Faggioli
2017-01-26  0:30 ` Dario Faggioli [this message]
2017-01-26  0:30 ` [PATCH 8/9] xen/tools: tracing: trace (Credit2) runq traversal Dario Faggioli
2017-01-26  0:30 ` [PATCH 9/9] xen/tools: tracing: always report how long next slice will be Dario Faggioli

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=148539063552.5464.11983958099406902513.stgit@Solace.fritz.box \
    --to=dario.faggioli@citrix.com \
    --cc=george.dunlap@eu.citrix.com \
    --cc=xen-devel@lists.xenproject.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.