[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Xen-devel] [PATCH 2/3] xen: sched RTDS: use uint64_t for tracing time values



such as deadline and budget. Packing is necessary to make
it possible for xentrace_format to properly interpreet the
records.

Signed-off-by: Dario Faggioli <dario.faggioli@xxxxxxxxxx>
---
Cc: George Dunlap <george.dunlap@xxxxxxxxxxxxx>
Cc: Meng Xu <mengxu@xxxxxxxxxxxxx>
---
 xen/common/sched_rt.c |   30 +++++++++++-------------------
 1 file changed, 11 insertions(+), 19 deletions(-)

diff --git a/xen/common/sched_rt.c b/xen/common/sched_rt.c
index bfed2e2..8e51abe 100644
--- a/xen/common/sched_rt.c
+++ b/xen/common/sched_rt.c
@@ -361,17 +361,14 @@ rt_update_deadline(s_time_t now, struct rt_vcpu *svc)
 
     /* TRACE */
     {
-        struct {
+        struct __packed {
             unsigned vcpu:16, dom:16;
-            unsigned cur_deadline_lo, cur_deadline_hi;
-            unsigned cur_budget_lo, cur_budget_hi;
+            uint64_t cur_deadline, cur_budget;
         } d;
         d.dom = svc->vcpu->domain->domain_id;
         d.vcpu = svc->vcpu->vcpu_id;
-        d.cur_deadline_lo = (unsigned) svc->cur_deadline;
-        d.cur_deadline_hi = (unsigned) (svc->cur_deadline >> 32);
-        d.cur_budget_lo = (unsigned) svc->cur_budget;
-        d.cur_budget_hi = (unsigned) (svc->cur_budget >> 32);
+        d.cur_deadline = (uint64_t) svc->cur_deadline;
+        d.cur_budget = (uint64_t) svc->cur_budget;
         trace_var(TRC_RTDS_BUDGET_REPLENISH, 1,
                   sizeof(d),
                   (unsigned char *) &d);
@@ -711,16 +708,14 @@ burn_budget(const struct scheduler *ops, struct rt_vcpu 
*svc, s_time_t now)
 
     /* TRACE */
     {
-        struct {
+        struct __packed {
             unsigned vcpu:16, dom:16;
-            unsigned cur_budget_lo;
-            unsigned cur_budget_hi;
+            uint64_t cur_budget;
             int delta;
         } d;
         d.dom = svc->vcpu->domain->domain_id;
         d.vcpu = svc->vcpu->vcpu_id;
-        d.cur_budget_lo = (unsigned) svc->cur_budget;
-        d.cur_budget_hi = (unsigned) (svc->cur_budget >> 32);
+        d.cur_budget = (uint64_t) svc->cur_budget;
         d.delta = delta;
         trace_var(TRC_RTDS_BUDGET_BURN, 1,
                   sizeof(d),
@@ -763,17 +758,14 @@ __runq_pick(const struct scheduler *ops, const cpumask_t 
*mask)
     {
         if( svc != NULL )
         {
-            struct {
+            struct __packed {
                 unsigned vcpu:16, dom:16;
-                unsigned cur_deadline_lo, cur_deadline_hi;
-                unsigned cur_budget_lo, cur_budget_hi;
+                uint64_t cur_deadline, cur_budget;
             } d;
             d.dom = svc->vcpu->domain->domain_id;
             d.vcpu = svc->vcpu->vcpu_id;
-            d.cur_deadline_lo = (unsigned) svc->cur_deadline;
-            d.cur_deadline_hi = (unsigned) (svc->cur_deadline >> 32);
-            d.cur_budget_lo = (unsigned) svc->cur_budget;
-            d.cur_budget_hi = (unsigned) (svc->cur_budget >> 32);
+            d.cur_deadline = (uint64_t) svc->cur_deadline;
+            d.cur_budget = (uint64_t) svc->cur_budget;
             trace_var(TRC_RTDS_RUNQ_PICK, 1,
                       sizeof(d),
                       (unsigned char *) &d);


_______________________________________________
Xen-devel mailing list
Xen-devel@xxxxxxxxxxxxx
http://lists.xen.org/xen-devel

 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.