All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH v2 00/16] Scheduling related tracing improvements
@ 2016-02-16 18:11 Dario Faggioli
  2016-02-16 18:11 ` [PATCH v2 01/16] xen: sched: __runq_tickle takes a useless cpu parameter Dario Faggioli
                   ` (16 more replies)
  0 siblings, 17 replies; 51+ messages in thread
From: Dario Faggioli @ 2016-02-16 18:11 UTC (permalink / raw)
  To: xen-devel
  Cc: Olaf Hering, Wei Liu, Ian Campbell, George Dunlap, Tianyang Chen,
	Ian Jackson, Meng Xu

Hi,

Take 2 of this series. v1 is here:

 http://lists.xenproject.org/archives/html/xen-devel/2016-02/msg01016.html

Konrad's feedback taken into acount, which basically meant modifying a little
bit patch 3 ("xen: sched: improve domain creation tracing"), and adding two
simple patches to xentrace formats file, and to xenalyze (patch 11 and 16).

Thanks and Regards,
Dario
---
Dario Faggioli (16):
      xen: sched: __runq_tickle takes a useless cpu parameter
      xen: sched: move up the trace record for vcpu_wake and vcpu_sleep
      xen: sched: improve domain creation tracing
      xen: credit2: pack trace data better for xentrace_format
      xen: RTDS: pack trace data better for xentrace_format
      xen: sched: tracing: enable TSC tracing for all events
      xentrace: formats: update format of scheduling events
      xentrace: formats: add events from Credit scheduler
      xentrace: formats: add events from Credit2 scheduler
      xentrace: formats: add events from RTDS scheduler
      xentrace: formats: add domain create and destroy events.
      xenalyze: handle scheduling events
      xenalyze: handle Credit1 scheduler events
      xenalyze: handle Credit2 scheduler events
      xenalyze: handle RTDS scheduler events
      xenalyze: handle DOM0 operaions events

 tools/xentrace/formats     |   47 ++++-
 tools/xentrace/xenalyze.c  |  399 +++++++++++++++++++++++++++++++++++++++++---
 xen/common/domain.c        |    5 -
 xen/common/sched_credit.c  |   12 +
 xen/common/sched_credit2.c |   22 +-
 xen/common/sched_rt.c      |   29 +--
 xen/common/schedule.c      |   20 +-
 xen/include/public/trace.h |    6 +
 8 files changed, 450 insertions(+), 90 deletions(-)
--
<<This happens because I choose it to happen!>> (Raistlin Majere)
-----------------------------------------------------------------
Dario Faggioli, Ph.D, http://about.me/dario.faggioli
Senior Software Engineer, Citrix Systems R&D Ltd., Cambridge (UK)

^ permalink raw reply	[flat|nested] 51+ messages in thread

* [PATCH v2 01/16] xen: sched: __runq_tickle takes a useless cpu parameter
  2016-02-16 18:11 [PATCH v2 00/16] Scheduling related tracing improvements Dario Faggioli
@ 2016-02-16 18:11 ` Dario Faggioli
  2016-02-18 10:33   ` George Dunlap
  2016-02-16 18:11 ` [PATCH v2 02/16] xen: sched: move up the trace record for vcpu_wake and vcpu_sleep Dario Faggioli
                   ` (15 subsequent siblings)
  16 siblings, 1 reply; 51+ messages in thread
From: Dario Faggioli @ 2016-02-16 18:11 UTC (permalink / raw)
  To: xen-devel; +Cc: George Dunlap

as it is always acts on v->processor of the vcpu that
we are tickling.

Getting rid of it makes the code easier to understand
and better looking.

While there, remove a spurious blank line.

Signed-off-by: Dario Faggioli <dario.faggioli@citrix.com>
Reviewed-by: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>
---
Cc: George Dunlap <george.dunlap@citrix.com>
---
Changes from v1:
 * fix wording inside the changelog, as suggested during
   review.
---
 xen/common/sched_credit.c |   10 ++++------
 1 file changed, 4 insertions(+), 6 deletions(-)

diff --git a/xen/common/sched_credit.c b/xen/common/sched_credit.c
index 671bbee..5279b92 100644
--- a/xen/common/sched_credit.c
+++ b/xen/common/sched_credit.c
@@ -360,9 +360,9 @@ boolean_param("tickle_one_idle_cpu", opt_tickle_one_idle);
 
 DEFINE_PER_CPU(unsigned int, last_tickle_cpu);
 
-static inline void
-__runq_tickle(unsigned int cpu, struct csched_vcpu *new)
+static inline void __runq_tickle(struct csched_vcpu *new)
 {
+    unsigned int cpu = new->vcpu->processor;
     struct csched_vcpu * const cur = CSCHED_VCPU(curr_on_cpu(cpu));
     struct csched_private *prv = CSCHED_PRIV(per_cpu(scheduler, cpu));
     cpumask_t mask, idle_mask, *online;
@@ -375,7 +375,6 @@ __runq_tickle(unsigned int cpu, struct csched_vcpu *new)
     cpumask_and(&idle_mask, prv->idlers, online);
     idlers_empty = cpumask_empty(&idle_mask);
 
-
     /*
      * If the pcpu is idle, or there are no idlers and the new
      * vcpu is a higher priority than the old vcpu, run it here.
@@ -980,11 +979,10 @@ static void
 csched_vcpu_wake(const struct scheduler *ops, struct vcpu *vc)
 {
     struct csched_vcpu * const svc = CSCHED_VCPU(vc);
-    const unsigned int cpu = vc->processor;
 
     BUG_ON( is_idle_vcpu(vc) );
 
-    if ( unlikely(curr_on_cpu(cpu) == vc) )
+    if ( unlikely(curr_on_cpu(vc->processor) == vc) )
     {
         SCHED_STAT_CRANK(vcpu_wake_running);
         return;
@@ -1028,7 +1026,7 @@ csched_vcpu_wake(const struct scheduler *ops, struct vcpu *vc)
 
     /* Put the VCPU on the runq and tickle CPUs */
     __runq_insert(svc);
-    __runq_tickle(cpu, svc);
+    __runq_tickle(svc);
 }
 
 static void

^ permalink raw reply related	[flat|nested] 51+ messages in thread

* [PATCH v2 02/16] xen: sched: move up the trace record for vcpu_wake and vcpu_sleep
  2016-02-16 18:11 [PATCH v2 00/16] Scheduling related tracing improvements Dario Faggioli
  2016-02-16 18:11 ` [PATCH v2 01/16] xen: sched: __runq_tickle takes a useless cpu parameter Dario Faggioli
@ 2016-02-16 18:11 ` Dario Faggioli
  2016-02-18 10:34   ` George Dunlap
  2016-02-16 18:11 ` [PATCH v2 03/16] xen: sched: improve domain creation tracing Dario Faggioli
                   ` (14 subsequent siblings)
  16 siblings, 1 reply; 51+ messages in thread
From: Dario Faggioli @ 2016-02-16 18:11 UTC (permalink / raw)
  To: xen-devel; +Cc: George Dunlap

vcpu_wake() and vcpu_sleep() are called before the specific
schedulers wakeup and sleep routines (in fact, it is them
that calls those specific routine).

Make the trace reflect that, by moving the records up. In
fact, it is more natural and easy to find the record of
the event (e.g., the wakeup) *before* the records of the
actions that deals with the event itself.

Signed-off-by: Dario Faggioli <dario.faggioli@citrix.com>
Reviewed-by: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>
---
Cc: George Dunlap <george.dunlap@citrix.com>
---
 xen/common/schedule.c |   16 ++++++++++------
 1 file changed, 10 insertions(+), 6 deletions(-)

diff --git a/xen/common/schedule.c b/xen/common/schedule.c
index 7306d71..c87922f 100644
--- a/xen/common/schedule.c
+++ b/xen/common/schedule.c
@@ -381,7 +381,11 @@ void sched_destroy_domain(struct domain *d)
 void vcpu_sleep_nosync(struct vcpu *v)
 {
     unsigned long flags;
-    spinlock_t *lock = vcpu_schedule_lock_irqsave(v, &flags);
+    spinlock_t *lock;
+
+    TRACE_2D(TRC_SCHED_SLEEP, v->domain->domain_id, v->vcpu_id);
+
+    lock = vcpu_schedule_lock_irqsave(v, &flags);
 
     if ( likely(!vcpu_runnable(v)) )
     {
@@ -392,8 +396,6 @@ void vcpu_sleep_nosync(struct vcpu *v)
     }
 
     vcpu_schedule_unlock_irqrestore(lock, flags, v);
-
-    TRACE_2D(TRC_SCHED_SLEEP, v->domain->domain_id, v->vcpu_id);
 }
 
 void vcpu_sleep_sync(struct vcpu *v)
@@ -409,7 +411,11 @@ void vcpu_sleep_sync(struct vcpu *v)
 void vcpu_wake(struct vcpu *v)
 {
     unsigned long flags;
-    spinlock_t *lock = vcpu_schedule_lock_irqsave(v, &flags);
+    spinlock_t *lock;
+
+    TRACE_2D(TRC_SCHED_WAKE, v->domain->domain_id, v->vcpu_id);
+
+    lock = vcpu_schedule_lock_irqsave(v, &flags);
 
     if ( likely(vcpu_runnable(v)) )
     {
@@ -424,8 +430,6 @@ void vcpu_wake(struct vcpu *v)
     }
 
     vcpu_schedule_unlock_irqrestore(lock, flags, v);
-
-    TRACE_2D(TRC_SCHED_WAKE, v->domain->domain_id, v->vcpu_id);
 }
 
 void vcpu_unblock(struct vcpu *v)

^ permalink raw reply related	[flat|nested] 51+ messages in thread

* [PATCH v2 03/16] xen: sched: improve domain creation tracing
  2016-02-16 18:11 [PATCH v2 00/16] Scheduling related tracing improvements Dario Faggioli
  2016-02-16 18:11 ` [PATCH v2 01/16] xen: sched: __runq_tickle takes a useless cpu parameter Dario Faggioli
  2016-02-16 18:11 ` [PATCH v2 02/16] xen: sched: move up the trace record for vcpu_wake and vcpu_sleep Dario Faggioli
@ 2016-02-16 18:11 ` Dario Faggioli
  2016-02-18 11:04   ` George Dunlap
  2016-02-16 18:11 ` [PATCH v2 04/16] xen: credit2: pack trace data better for xentrace_format Dario Faggioli
                   ` (13 subsequent siblings)
  16 siblings, 1 reply; 51+ messages in thread
From: Dario Faggioli @ 2016-02-16 18:11 UTC (permalink / raw)
  To: xen-devel; +Cc: George Dunlap

by doing the following two things:

 - move TRC_SCHED_DOM_{ADD,REM}, into the functions
   that do the actual scheduling-related domain
   initialization;

 - add two 'generic' DOM_{ADD,REM} events. They're
   made part of the TRC_DOM0 tracing class, as Dom0
   is, usually, from where domains are created and
   destroyed.

Signed-off-by: Dario Faggioli <dario.faggioli@citrix.com>
---
Cc: George Dunlap <george.dunlap@eu.citrix.com>
Cc: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>
---
Changes from v1:
 * added generic domain creation and destruction events, as
   suggested during review.
---
 xen/common/domain.c        |    5 ++++-
 xen/common/schedule.c      |    4 ++--
 xen/include/public/trace.h |    6 ++++++
 3 files changed, 12 insertions(+), 3 deletions(-)

diff --git a/xen/common/domain.c b/xen/common/domain.c
index 425767c..45273d4 100644
--- a/xen/common/domain.c
+++ b/xen/common/domain.c
@@ -270,6 +270,8 @@ struct domain *domain_create(domid_t domid, unsigned int domcr_flags,
 
     d->domain_id = domid;
 
+    TRACE_1D(TRC_DOM0_DOM_ADD, d->domain_id);
+
     lock_profile_register_struct(LOCKPROF_TYPE_PERDOM, d, domid, "Domain");
 
     if ( (err = xsm_alloc_security_domain(d)) != 0 )
@@ -864,10 +866,11 @@ void domain_destroy(struct domain *d)
     if ( atomic_cmpxchg(&d->refcnt, 0, DOMAIN_DESTROYED) != 0 )
         return;
 
+    TRACE_1D(TRC_DOM0_DOM_REM, d->domain_id);
+
     cpupool_rm_domain(d);
 
     /* Delete from task list and task hashtable. */
-    TRACE_1D(TRC_SCHED_DOM_REM, d->domain_id);
     spin_lock(&domlist_update_lock);
     pd = &domain_list;
     while ( *pd != d ) 
diff --git a/xen/common/schedule.c b/xen/common/schedule.c
index c87922f..27695e3 100644
--- a/xen/common/schedule.c
+++ b/xen/common/schedule.c
@@ -241,8 +241,6 @@ int sched_init_vcpu(struct vcpu *v, unsigned int processor)
     if ( v->sched_priv == NULL )
         return 1;
 
-    TRACE_2D(TRC_SCHED_DOM_ADD, v->domain->domain_id, v->vcpu_id);
-
     /* Idle VCPUs are scheduled immediately, so don't put them in runqueue. */
     if ( is_idle_domain(d) )
     {
@@ -369,12 +367,14 @@ void sched_destroy_vcpu(struct vcpu *v)
 int sched_init_domain(struct domain *d)
 {
     SCHED_STAT_CRANK(dom_init);
+    TRACE_1D(TRC_SCHED_DOM_ADD, d->domain_id);
     return SCHED_OP(DOM2OP(d), init_domain, d);
 }
 
 void sched_destroy_domain(struct domain *d)
 {
     SCHED_STAT_CRANK(dom_destroy);
+    TRACE_1D(TRC_SCHED_DOM_REM, d->domain_id);
     SCHED_OP(DOM2OP(d), destroy_domain, d);
 }
 
diff --git a/xen/include/public/trace.h b/xen/include/public/trace.h
index 274f8f6..5ef9c37 100644
--- a/xen/include/public/trace.h
+++ b/xen/include/public/trace.h
@@ -85,6 +85,9 @@
       ((TRC_SCHED_##_c << TRC_SCHED_ID_SHIFT) & TRC_SCHED_ID_MASK) ) + \
     (_e & TRC_SCHED_EVT_MASK) )
 
+/* Trace classes for DOM0 operations */
+#define TRC_DOM0_DOMOPS     0x00041000   /* Domains manipulations */
+
 /* Trace classes for Hardware */
 #define TRC_HW_PM           0x00801000   /* Power management traces */
 #define TRC_HW_IRQ          0x00802000   /* Traces relating to the handling of IRQs */
@@ -113,6 +116,9 @@
 #define TRC_SCHED_SWITCH_INFNEXT (TRC_SCHED_VERBOSE + 15)
 #define TRC_SCHED_SHUTDOWN_CODE  (TRC_SCHED_VERBOSE + 16)
 
+#define TRC_DOM0_DOM_ADD         (TRC_DOM0_DOMOPS + 1)
+#define TRC_DOM0_DOM_REM         (TRC_DOM0_DOMOPS + 2)
+
 #define TRC_MEM_PAGE_GRANT_MAP      (TRC_MEM + 1)
 #define TRC_MEM_PAGE_GRANT_UNMAP    (TRC_MEM + 2)
 #define TRC_MEM_PAGE_GRANT_TRANSFER (TRC_MEM + 3)

^ permalink raw reply related	[flat|nested] 51+ messages in thread

* [PATCH v2 04/16] xen: credit2: pack trace data better for xentrace_format
  2016-02-16 18:11 [PATCH v2 00/16] Scheduling related tracing improvements Dario Faggioli
                   ` (2 preceding siblings ...)
  2016-02-16 18:11 ` [PATCH v2 03/16] xen: sched: improve domain creation tracing Dario Faggioli
@ 2016-02-16 18:11 ` Dario Faggioli
  2016-02-18 11:10   ` George Dunlap
  2016-02-16 18:11 ` [PATCH v2 05/16] xen: RTDS: " Dario Faggioli
                   ` (12 subsequent siblings)
  16 siblings, 1 reply; 51+ messages in thread
From: Dario Faggioli @ 2016-02-16 18:11 UTC (permalink / raw)
  To: xen-devel; +Cc: Olaf Hering, George Dunlap

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 <dario.faggioli@citrix.com>
Reviewed-by: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>
---
Cc: George Dunlap <george.dunlap@citrix.com>
Cc: Olaf Hering <olaf@aepfle.de>
---
 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;

^ permalink raw reply related	[flat|nested] 51+ messages in thread

* [PATCH v2 05/16] xen: RTDS: pack trace data better for xentrace_format
  2016-02-16 18:11 [PATCH v2 00/16] Scheduling related tracing improvements Dario Faggioli
                   ` (3 preceding siblings ...)
  2016-02-16 18:11 ` [PATCH v2 04/16] xen: credit2: pack trace data better for xentrace_format Dario Faggioli
@ 2016-02-16 18:11 ` Dario Faggioli
  2016-02-18 11:12   ` George Dunlap
  2016-02-18 14:43   ` Meng Xu
  2016-02-16 18:11 ` [PATCH v2 06/16] xen: sched: tracing: enable TSC tracing for all events Dario Faggioli
                   ` (11 subsequent siblings)
  16 siblings, 2 replies; 51+ messages in thread
From: Dario Faggioli @ 2016-02-16 18:11 UTC (permalink / raw)
  To: xen-devel; +Cc: Olaf Hering, Tianyang Chen, Meng Xu, George Dunlap

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 RTDS 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.

While there, we also:
 - fix the use of TRC_RTDS_SCHED_TASKLET (it should
   only be involved when a tasklet is scheduled, not
   _every_ time rt_schedule() is invoked!);
 - remove a very chatty and useless (nothing has been
   picked!) use of TRC_RTDS_RUNQ_PICK.

In fact, one can already figure out when nothing has been
picked from the runqueue, by looking at when cpu_idle
is invoked --which is the same thing one would do if on
Credit or Credit2.

Signed-off-by: Dario Faggioli <dario.faggioli@citrix.com>
Reviewed-by: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>
---
Cc: George Dunlap <george.dunlap@citrix.com>
Cc: Meng Xu <xumengpanda@gmail.com>
Cc: Tianyang Chen <tiche@seas.upenn.edu>
Cc: Olaf Hering <olaf@aepfle.de>
---
Changes from v1:
 * enhanced changelog, as suggested during review.
---
 xen/common/sched_rt.c |   27 ++++-----------------------
 1 file changed, 4 insertions(+), 23 deletions(-)

diff --git a/xen/common/sched_rt.c b/xen/common/sched_rt.c
index 2e5430f..53de6d6 100644
--- a/xen/common/sched_rt.c
+++ b/xen/common/sched_rt.c
@@ -362,7 +362,7 @@ rt_update_deadline(s_time_t now, struct rt_vcpu *svc)
     /* TRACE */
     {
         struct {
-            unsigned dom:16,vcpu:16;
+            unsigned vcpu:16, dom:16;
             unsigned cur_deadline_lo, cur_deadline_hi;
             unsigned cur_budget_lo, cur_budget_hi;
         } d;
@@ -711,7 +711,7 @@ burn_budget(const struct scheduler *ops, struct rt_vcpu *svc, s_time_t now)
     /* TRACE */
     {
         struct {
-            unsigned dom:16, vcpu:16;
+            unsigned vcpu:16, dom:16;
             unsigned cur_budget_lo;
             unsigned cur_budget_hi;
             int delta;
@@ -763,7 +763,7 @@ __runq_pick(const struct scheduler *ops, const cpumask_t *mask)
         if( svc != NULL )
         {
             struct {
-                unsigned dom:16, vcpu:16;
+                unsigned vcpu:16, dom:16;
                 unsigned cur_deadline_lo, cur_deadline_hi;
                 unsigned cur_budget_lo, cur_budget_hi;
             } d;
@@ -777,8 +777,6 @@ __runq_pick(const struct scheduler *ops, const cpumask_t *mask)
                       sizeof(d),
                       (unsigned char *) &d);
         }
-        else
-            trace_var(TRC_RTDS_RUNQ_PICK, 1, 0, NULL);
     }
 
     return svc;
@@ -845,6 +843,7 @@ rt_schedule(const struct scheduler *ops, s_time_t now, bool_t tasklet_work_sched
 
     if ( tasklet_work_scheduled )
     {
+        trace_var(TRC_RTDS_SCHED_TASKLET, 1, 0,  NULL);
         snext = rt_vcpu(idle_vcpu[cpu]);
     }
     else
@@ -885,24 +884,6 @@ rt_schedule(const struct scheduler *ops, s_time_t now, bool_t tasklet_work_sched
     ret.time = MIN(snext->budget, MAX_SCHEDULE); /* sched quantum */
     ret.task = snext->vcpu;
 
-    /* TRACE */
-    {
-        struct {
-            unsigned dom:16,vcpu:16;
-            unsigned cur_deadline_lo, cur_deadline_hi;
-            unsigned cur_budget_lo, cur_budget_hi;
-        } d;
-        d.dom = snext->vcpu->domain->domain_id;
-        d.vcpu = snext->vcpu->vcpu_id;
-        d.cur_deadline_lo = (unsigned) snext->cur_deadline;
-        d.cur_deadline_hi = (unsigned) (snext->cur_deadline >> 32);
-        d.cur_budget_lo = (unsigned) snext->cur_budget;
-        d.cur_budget_hi = (unsigned) (snext->cur_budget >> 32);
-        trace_var(TRC_RTDS_SCHED_TASKLET, 1,
-                  sizeof(d),
-                  (unsigned char *)&d);
-    }
-
     return ret;
 }

^ permalink raw reply related	[flat|nested] 51+ messages in thread

* [PATCH v2 06/16] xen: sched: tracing: enable TSC tracing for all events
  2016-02-16 18:11 [PATCH v2 00/16] Scheduling related tracing improvements Dario Faggioli
                   ` (4 preceding siblings ...)
  2016-02-16 18:11 ` [PATCH v2 05/16] xen: RTDS: " Dario Faggioli
@ 2016-02-16 18:11 ` Dario Faggioli
  2016-02-16 18:21   ` Meng Xu
  2016-02-16 18:12 ` [PATCH v2 07/16] xentrace: formats: update format of scheduling events Dario Faggioli
                   ` (10 subsequent siblings)
  16 siblings, 1 reply; 51+ messages in thread
From: Dario Faggioli @ 2016-02-16 18:11 UTC (permalink / raw)
  To: xen-devel; +Cc: Olaf Hering, Tianyang Chen, Meng Xu, George Dunlap

it is enabled for pretty much all of them already.
There were just a few that had it disabled.

When tracing a scheduler, timing information is
really important, so enable it everywhere scheduling
related.

Note that this was not really a problem if looking
at the traces with xenalyze, but it was if using
xentrace_format.

Signed-off-by: Dario Faggioli <dario.faggioli@citrix.com>
---
Cc: George Dunlap <george.dunlap@citrix.com>
Cc: Meng Xu <xumengpanda@gmail.com>
Cc: Tianyang Chen <tiche@seas.upenn.edu>
Cc: Olaf Hering <olaf@aepfle.de>
---
 xen/common/sched_credit.c  |    2 +-
 xen/common/sched_credit2.c |    6 +++---
 xen/common/sched_rt.c      |    2 +-
 3 files changed, 5 insertions(+), 5 deletions(-)

diff --git a/xen/common/sched_credit.c b/xen/common/sched_credit.c
index 5279b92..bd2f37f 100644
--- a/xen/common/sched_credit.c
+++ b/xen/common/sched_credit.c
@@ -476,7 +476,7 @@ static inline void __runq_tickle(struct csched_vcpu *new)
         {
             /* Avoid TRACE_*: saves checking !tb_init_done each step */
             for_each_cpu(cpu, &mask)
-                __trace_var(TRC_CSCHED_TICKLE, 0, sizeof(cpu), &cpu);
+                __trace_var(TRC_CSCHED_TICKLE, 1, sizeof(cpu), &cpu);
         }
 
         /* Send scheduler interrupts to designated CPUs */
diff --git a/xen/common/sched_credit2.c b/xen/common/sched_credit2.c
index cf40f68..2934e26 100644
--- a/xen/common/sched_credit2.c
+++ b/xen/common/sched_credit2.c
@@ -456,7 +456,7 @@ runq_insert(const struct scheduler *ops, unsigned int cpu, struct csched2_vcpu *
         d.dom = svc->vcpu->domain->domain_id;
         d.vcpu = svc->vcpu->vcpu_id;
         d.pos = pos;
-        trace_var(TRC_CSCHED2_RUNQ_POS, 0,
+        trace_var(TRC_CSCHED2_RUNQ_POS, 1,
                   sizeof(d),
                   (unsigned char *)&d);
     }
@@ -564,7 +564,7 @@ tickle:
             unsigned cpu:16, pad:16;
         } d;
         d.cpu = ipid; d.pad = 0;
-        trace_var(TRC_CSCHED2_TICKLE, 0,
+        trace_var(TRC_CSCHED2_TICKLE, 1,
                   sizeof(d),
                   (unsigned char *)&d);
     }
@@ -1721,7 +1721,7 @@ csched2_schedule(
      */
     if ( tasklet_work_scheduled )
     {
-        trace_var(TRC_CSCHED2_SCHED_TASKLET, 0, 0,  NULL);
+        trace_var(TRC_CSCHED2_SCHED_TASKLET, 1, 0,  NULL);
         snext = CSCHED2_VCPU(idle_vcpu[cpu]);
     }
     else
diff --git a/xen/common/sched_rt.c b/xen/common/sched_rt.c
index 53de6d6..33ac9de 100644
--- a/xen/common/sched_rt.c
+++ b/xen/common/sched_rt.c
@@ -985,7 +985,7 @@ out:
         } d;
         d.cpu = cpu_to_tickle;
         d.pad = 0;
-        trace_var(TRC_RTDS_TICKLE, 0,
+        trace_var(TRC_RTDS_TICKLE, 1,
                   sizeof(d),
                   (unsigned char *)&d);
     }

^ permalink raw reply related	[flat|nested] 51+ messages in thread

* [PATCH v2 07/16] xentrace: formats: update format of scheduling events
  2016-02-16 18:11 [PATCH v2 00/16] Scheduling related tracing improvements Dario Faggioli
                   ` (5 preceding siblings ...)
  2016-02-16 18:11 ` [PATCH v2 06/16] xen: sched: tracing: enable TSC tracing for all events Dario Faggioli
@ 2016-02-16 18:12 ` Dario Faggioli
  2016-02-18 12:28   ` George Dunlap
  2016-02-16 18:12 ` [PATCH v2 08/16] xentrace: formats: add events from Credit scheduler Dario Faggioli
                   ` (9 subsequent siblings)
  16 siblings, 1 reply; 51+ messages in thread
From: Dario Faggioli @ 2016-02-16 18:12 UTC (permalink / raw)
  To: xen-devel; +Cc: Olaf Hering, Wei Liu, Ian Campbell, George Dunlap, Ian Jackson

to include the vcpu IDs, in a way that matches
how the "dom:vcpu" couple is displayed in other
events (runstate changes).

Also add the trace for TRC_SCHED_SHUTDOWN_CODE which
was missing and was done via SCHEDOP_shutdown_code hypercall.
(TRC_SCHED_SHUTDOWN trace was present).

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:
 * enhanced changelog, as suggested during review.
---
 tools/xentrace/formats |   18 +++++++++---------
 1 file changed, 9 insertions(+), 9 deletions(-)

diff --git a/tools/xentrace/formats b/tools/xentrace/formats
index 5d7b72a..5257cf0 100644
--- a/tools/xentrace/formats
+++ b/tools/xentrace/formats
@@ -19,22 +19,22 @@
 0x00021311  CPU%(cpu)d  %(tsc)d (+%(reltsc)8d)  offline_to_runnable [ dom:vcpu = 0x%(1)08x ]
 0x00021321  CPU%(cpu)d  %(tsc)d (+%(reltsc)8d)  offline_to_blocked  [ dom:vcpu = 0x%(1)08x ]
 
-0x00028001  CPU%(cpu)d  %(tsc)d (+%(reltsc)8d)  sched_add_domain  [ domid = 0x%(1)08x, edomid = 0x%(2)08x ]
-0x00028002  CPU%(cpu)d  %(tsc)d (+%(reltsc)8d)  sched_rem_domain  [ domid = 0x%(1)08x, edomid = 0x%(2)08x ]
-0x00028003  CPU%(cpu)d  %(tsc)d (+%(reltsc)8d)  domain_sleep      [ domid = 0x%(1)08x, edomid = 0x%(2)08x ]
-0x00028004  CPU%(cpu)d  %(tsc)d (+%(reltsc)8d)  domain_wake       [ domid = 0x%(1)08x, edomid = 0x%(2)08x ]
-0x00028005  CPU%(cpu)d  %(tsc)d (+%(reltsc)8d)  do_yield          [ domid = 0x%(1)08x, edomid = 0x%(2)08x ]
-0x00028006  CPU%(cpu)d  %(tsc)d (+%(reltsc)8d)  do_block          [ domid = 0x%(1)08x, edomid = 0x%(2)08x ]
-0x00022006  CPU%(cpu)d  %(tsc)d (+%(reltsc)8d)  do_block          [ dom:vcpu = 0x%(1)08x, domid = 0x%(2)08x ]
-0x00028007  CPU%(cpu)d  %(tsc)d (+%(reltsc)8d)  domain_shutdown	  [ domid = 0x%(1)08x, edomid = 0x%(2)08x, reason = 0x%(3)08x ]
+0x00028001  CPU%(cpu)d  %(tsc)d (+%(reltsc)8d)  sched_add_domain  [ domid = 0x%(1)08x ]
+0x00028002  CPU%(cpu)d  %(tsc)d (+%(reltsc)8d)  sched_rem_domain  [ domid = 0x%(1)08x ]
+0x00028003  CPU%(cpu)d  %(tsc)d (+%(reltsc)8d)  domain_sleep      [ dom:vcpu = 0x%(1)04x%(2)04x ]
+0x00028004  CPU%(cpu)d  %(tsc)d (+%(reltsc)8d)  domain_wake       [ dom:vcpu = 0x%(1)04x%(2)04x ]
+0x00028005  CPU%(cpu)d  %(tsc)d (+%(reltsc)8d)  do_yield          [ dom:vcpu = 0x%(1)04x%(2)04x ]
+0x00028006  CPU%(cpu)d  %(tsc)d (+%(reltsc)8d)  do_block          [ dom:vcpu = 0x%(1)04x%(2)04x ]
+0x00028007  CPU%(cpu)d  %(tsc)d (+%(reltsc)8d)  domain_shutdown	  [ dom:vcpu = 0x%(1)04x%(2)04x, reason = 0x%(3)08x ]
 0x00028008  CPU%(cpu)d  %(tsc)d (+%(reltsc)8d)  sched_ctl
 0x00028009  CPU%(cpu)d  %(tsc)d (+%(reltsc)8d)  sched_adjdom      [ domid = 0x%(1)08x ]
-0x0002800a  CPU%(cpu)d  %(tsc)d (+%(reltsc)8d)  __enter_scheduler [ prev<domid:edomid> = 0x%(1)08x : 0x%(2)08x, next<domid:edomid> = 0x%(3)08x : 0x%(4)08x ]
+0x0002800a  CPU%(cpu)d  %(tsc)d (+%(reltsc)8d)  __enter_scheduler [ prev<dom:vcpu> = 0x%(1)04x%(2)04x, next<dom:vcpu> = 0x%(3)04x%(4)04x ]
 0x0002800b  CPU%(cpu)d  %(tsc)d (+%(reltsc)8d)  s_timer_fn
 0x0002800c  CPU%(cpu)d  %(tsc)d (+%(reltsc)8d)  t_timer_fn
 0x0002800d  CPU%(cpu)d  %(tsc)d (+%(reltsc)8d)  dom_timer_fn
 0x0002800e  CPU%(cpu)d  %(tsc)d (+%(reltsc)8d)  switch_infprev    [ old_domid = 0x%(1)08x, runtime = %(2)d ]
 0x0002800f  CPU%(cpu)d  %(tsc)d (+%(reltsc)8d)  switch_infnext    [ new_domid = 0x%(1)08x, time = %(2)d, r_time = %(3)d ]
+0x00028010  CPU%(cpu)d  %(tsc)d (+%(reltsc)8d)  domain_shutdown_code [ dom:vcpu = 0x%(1)04x%(2)04x, reason = 0x%(3)08x ]
 
 0x00081001  CPU%(cpu)d  %(tsc)d (+%(reltsc)8d)  VMENTRY
 0x00081002  CPU%(cpu)d  %(tsc)d (+%(reltsc)8d)  VMEXIT      [ exitcode = 0x%(1)08x, rIP  = 0x%(2)08x ]

^ permalink raw reply related	[flat|nested] 51+ messages in thread

* [PATCH v2 08/16] xentrace: formats: add events from Credit scheduler
  2016-02-16 18:11 [PATCH v2 00/16] Scheduling related tracing improvements Dario Faggioli
                   ` (6 preceding siblings ...)
  2016-02-16 18:12 ` [PATCH v2 07/16] xentrace: formats: update format of scheduling events Dario Faggioli
@ 2016-02-16 18:12 ` Dario Faggioli
  2016-02-16 18:12 ` [PATCH v2 09/16] xentrace: formats: add events from Credit2 scheduler Dario Faggioli
                   ` (8 subsequent siblings)
  16 siblings, 0 replies; 51+ messages in thread
From: Dario Faggioli @ 2016-02-16 18:12 UTC (permalink / raw)
  To: xen-devel; +Cc: Olaf Hering, Wei Liu, Ian Campbell, George Dunlap, Ian Jackson

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>
---
 tools/xentrace/formats |    7 +++++++
 1 file changed, 7 insertions(+)

diff --git a/tools/xentrace/formats b/tools/xentrace/formats
index 5257cf0..a5636e9 100644
--- a/tools/xentrace/formats
+++ b/tools/xentrace/formats
@@ -36,6 +36,13 @@
 0x0002800f  CPU%(cpu)d  %(tsc)d (+%(reltsc)8d)  switch_infnext    [ new_domid = 0x%(1)08x, time = %(2)d, r_time = %(3)d ]
 0x00028010  CPU%(cpu)d  %(tsc)d (+%(reltsc)8d)  domain_shutdown_code [ dom:vcpu = 0x%(1)04x%(2)04x, reason = 0x%(3)08x ]
 
+0x00022001  CPU%(cpu)d  %(tsc)d (+%(reltsc)8d)  csched:sched_tasklet
+0x00022002  CPU%(cpu)d  %(tsc)d (+%(reltsc)8d)  csched:account_start [ dom:vcpu = 0x%(1)04x%(2)04x, active = %(3)d ]
+0x00022003  CPU%(cpu)d  %(tsc)d (+%(reltsc)8d)  csched:account_stop  [ dom:vcpu = 0x%(1)04x%(2)04x, active = %(3)d ]
+0x00022004  CPU%(cpu)d  %(tsc)d (+%(reltsc)8d)  csched:stolen_vcpu   [ dom:vcpu = 0x%(2)04x%(3)04x, from = %(1)d ]
+0x00022005  CPU%(cpu)d  %(tsc)d (+%(reltsc)8d)  csched:picked_cpu    [ dom:vcpu = 0x%(1)04x%(2)04x, cpu = %(3)d ]
+0x00022006  CPU%(cpu)d  %(tsc)d (+%(reltsc)8d)  csched:tickle        [ cpu = %(1)d ]
+
 0x00081001  CPU%(cpu)d  %(tsc)d (+%(reltsc)8d)  VMENTRY
 0x00081002  CPU%(cpu)d  %(tsc)d (+%(reltsc)8d)  VMEXIT      [ exitcode = 0x%(1)08x, rIP  = 0x%(2)08x ]
 0x00081102  CPU%(cpu)d  %(tsc)d (+%(reltsc)8d)  VMEXIT      [ exitcode = 0x%(1)08x, rIP  = 0x%(3)08x%(2)08x ]

^ permalink raw reply related	[flat|nested] 51+ messages in thread

* [PATCH v2 09/16] xentrace: formats: add events from Credit2 scheduler
  2016-02-16 18:11 [PATCH v2 00/16] Scheduling related tracing improvements Dario Faggioli
                   ` (7 preceding siblings ...)
  2016-02-16 18:12 ` [PATCH v2 08/16] xentrace: formats: add events from Credit scheduler Dario Faggioli
@ 2016-02-16 18:12 ` Dario Faggioli
  2016-02-16 18:12 ` [PATCH v2 10/16] xentrace: formats: add events from RTDS scheduler Dario Faggioli
                   ` (7 subsequent siblings)
  16 siblings, 0 replies; 51+ messages in thread
From: Dario Faggioli @ 2016-02-16 18:12 UTC (permalink / raw)
  To: xen-devel; +Cc: George Dunlap, Wei Liu, Olaf Hering, Ian Jackson, Ian Campbell

Signed-off-by: Dario Faggioli <dario.faggioli@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:
 * fix typo in two events (rq_idx/rq_id)., as requested during
   review.
---
 tools/xentrace/formats |   13 +++++++++++++
 1 file changed, 13 insertions(+)

diff --git a/tools/xentrace/formats b/tools/xentrace/formats
index a5636e9..6911fcb 100644
--- a/tools/xentrace/formats
+++ b/tools/xentrace/formats
@@ -43,6 +43,19 @@
 0x00022005  CPU%(cpu)d  %(tsc)d (+%(reltsc)8d)  csched:picked_cpu    [ dom:vcpu = 0x%(1)04x%(2)04x, cpu = %(3)d ]
 0x00022006  CPU%(cpu)d  %(tsc)d (+%(reltsc)8d)  csched:tickle        [ cpu = %(1)d ]
 
+0x00022201  CPU%(cpu)d  %(tsc)d (+%(reltsc)8d)  csched2:tick
+0x00022202  CPU%(cpu)d  %(tsc)d (+%(reltsc)8d)  csched2:runq_pos       [ dom:vcpu = 0x%(1)08x, pos = %(2)d]
+0x00022203  CPU%(cpu)d  %(tsc)d (+%(reltsc)8d)  csched2:credit burn    [ dom:vcpu = 0x%(1)08x, credit = %(2)d, delta = %(3)d ]
+0x00022204  CPU%(cpu)d  %(tsc)d (+%(reltsc)8d)  csched2:credit_add
+0x00022205  CPU%(cpu)d  %(tsc)d (+%(reltsc)8d)  csched2:tickle_check   [ dom:vcpu = 0x%(1)08x, credit = %(2)d ]
+0x00022206  CPU%(cpu)d  %(tsc)d (+%(reltsc)8d)  csched2:tickle         [ cpu = %(1)d ]
+0x00022207  CPU%(cpu)d  %(tsc)d (+%(reltsc)8d)  csched2:credit_reset   [ dom:vcpu = 0x%(1)08x, cr_start = %(2)d, cr_end = %(3)d, mult = %(4)d ]
+0x00022208  CPU%(cpu)d  %(tsc)d (+%(reltsc)8d)  csched2:sched_tasklet
+0x00022209  CPU%(cpu)d  %(tsc)d (+%(reltsc)8d)  csched2:update_load
+0x0002220a  CPU%(cpu)d  %(tsc)d (+%(reltsc)8d)  csched2:runq_assign    [ dom:vcpu = 0x%(1)08x, rq_id = %(2)d ]
+0x0002220b  CPU%(cpu)d  %(tsc)d (+%(reltsc)8d)  csched2:updt_vcpu_load [ dom:vcpu = 0x%(1)08x, avgload = %(2)d ]
+0x0002220c  CPU%(cpu)d  %(tsc)d (+%(reltsc)8d)  csched2:updt_runq_load [ rq_load[4]:rq_avgload[28] = 0x%(1)08x, rq_id[4]:b_avgload[28] = 0x%(2)08x ]
+
 0x00081001  CPU%(cpu)d  %(tsc)d (+%(reltsc)8d)  VMENTRY
 0x00081002  CPU%(cpu)d  %(tsc)d (+%(reltsc)8d)  VMEXIT      [ exitcode = 0x%(1)08x, rIP  = 0x%(2)08x ]
 0x00081102  CPU%(cpu)d  %(tsc)d (+%(reltsc)8d)  VMEXIT      [ exitcode = 0x%(1)08x, rIP  = 0x%(3)08x%(2)08x ]

^ permalink raw reply related	[flat|nested] 51+ messages in thread

* [PATCH v2 10/16] xentrace: formats: add events from RTDS scheduler
  2016-02-16 18:11 [PATCH v2 00/16] Scheduling related tracing improvements Dario Faggioli
                   ` (8 preceding siblings ...)
  2016-02-16 18:12 ` [PATCH v2 09/16] xentrace: formats: add events from Credit2 scheduler Dario Faggioli
@ 2016-02-16 18:12 ` Dario Faggioli
  2016-02-16 18:12 ` [PATCH v2 11/16] xentrace: formats: add domain create and destroy events Dario Faggioli
                   ` (6 subsequent siblings)
  16 siblings, 0 replies; 51+ messages in thread
From: Dario Faggioli @ 2016-02-16 18:12 UTC (permalink / raw)
  To: xen-devel
  Cc: Olaf Hering, Wei Liu, Ian Campbell, George Dunlap, Tianyang Chen,
	Ian Jackson, Meng Xu

Signed-off-by: Dario Faggioli <dario.faggioli@citrix.com>
---
Cc: George Dunlap <george.dunlap@eu.citrix.com>
Cc: Meng Xu <xumengpanda@gmail.com>
Cc: Tianyang Chen <tiche@seas.upenn.edu>
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>
---
 tools/xentrace/formats |    6 ++++++
 1 file changed, 6 insertions(+)

diff --git a/tools/xentrace/formats b/tools/xentrace/formats
index 6911fcb..60a8e8f 100644
--- a/tools/xentrace/formats
+++ b/tools/xentrace/formats
@@ -56,6 +56,12 @@
 0x0002220b  CPU%(cpu)d  %(tsc)d (+%(reltsc)8d)  csched2:updt_vcpu_load [ dom:vcpu = 0x%(1)08x, avgload = %(2)d ]
 0x0002220c  CPU%(cpu)d  %(tsc)d (+%(reltsc)8d)  csched2:updt_runq_load [ rq_load[4]:rq_avgload[28] = 0x%(1)08x, rq_id[4]:b_avgload[28] = 0x%(2)08x ]
 
+0x00022801  CPU%(cpu)d  %(tsc)d (+%(reltsc)8d)  rtds:tickle        [ cpu = %(1)d ]
+0x00022802  CPU%(cpu)d  %(tsc)d (+%(reltsc)8d)  rtds:runq_pick     [ dom:vcpu = 0x%(1)08x, cur_deadline = 0x%(3)08x%(2)08x, cur_budget = 0x%(5)08x%(4)08x ]
+0x00022803  CPU%(cpu)d  %(tsc)d (+%(reltsc)8d)  rtds:burn_budget   [ dom:vcpu = 0x%(1)08x, cur_budget = 0x%(3)08x%(2)08x, delta = %(4)d ]
+0x00022804  CPU%(cpu)d  %(tsc)d (+%(reltsc)8d)  rtds:repl_budget   [ dom:vcpu = 0x%(1)08x, cur_deadline = 0x%(3)08x%(2)08x, cur_budget = 0x%(5)08x%(4)08x ]
+0x00022805  CPU%(cpu)d  %(tsc)d (+%(reltsc)8d)  rtds:sched_tasklet
+
 0x00081001  CPU%(cpu)d  %(tsc)d (+%(reltsc)8d)  VMENTRY
 0x00081002  CPU%(cpu)d  %(tsc)d (+%(reltsc)8d)  VMEXIT      [ exitcode = 0x%(1)08x, rIP  = 0x%(2)08x ]
 0x00081102  CPU%(cpu)d  %(tsc)d (+%(reltsc)8d)  VMEXIT      [ exitcode = 0x%(1)08x, rIP  = 0x%(3)08x%(2)08x ]

^ permalink raw reply related	[flat|nested] 51+ messages in thread

* [PATCH v2 11/16] xentrace: formats: add domain create and destroy events.
  2016-02-16 18:11 [PATCH v2 00/16] Scheduling related tracing improvements Dario Faggioli
                   ` (9 preceding siblings ...)
  2016-02-16 18:12 ` [PATCH v2 10/16] xentrace: formats: add events from RTDS scheduler Dario Faggioli
@ 2016-02-16 18:12 ` Dario Faggioli
  2016-02-16 18:12 ` [PATCH v2 12/16] xenalyze: handle scheduling events Dario Faggioli
                   ` (5 subsequent siblings)
  16 siblings, 0 replies; 51+ messages in thread
From: Dario Faggioli @ 2016-02-16 18:12 UTC (permalink / raw)
  To: xen-devel; +Cc: Olaf Hering, Wei Liu, Ian Campbell, George Dunlap, Ian Jackson

Signed-off-by: Dario Faggioli <dario.faggioli@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>
Cc: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>
---
Changes from v2:
 * new patch in the series.
---
 tools/xentrace/formats |    3 +++
 1 file changed, 3 insertions(+)

diff --git a/tools/xentrace/formats b/tools/xentrace/formats
index 60a8e8f..d204351 100644
--- a/tools/xentrace/formats
+++ b/tools/xentrace/formats
@@ -62,6 +62,9 @@
 0x00022804  CPU%(cpu)d  %(tsc)d (+%(reltsc)8d)  rtds:repl_budget   [ dom:vcpu = 0x%(1)08x, cur_deadline = 0x%(3)08x%(2)08x, cur_budget = 0x%(5)08x%(4)08x ]
 0x00022805  CPU%(cpu)d  %(tsc)d (+%(reltsc)8d)  rtds:sched_tasklet
 
+0x00041001  CPU%(cpu)d  %(tsc)d (+%(reltsc)8d)  domain_create   [ dom = 0x%(1)08x ]
+0x00041002  CPU%(cpu)d  %(tsc)d (+%(reltsc)8d)  domain_destroy  [ dom = 0x%(1)08x ]
+
 0x00081001  CPU%(cpu)d  %(tsc)d (+%(reltsc)8d)  VMENTRY
 0x00081002  CPU%(cpu)d  %(tsc)d (+%(reltsc)8d)  VMEXIT      [ exitcode = 0x%(1)08x, rIP  = 0x%(2)08x ]
 0x00081102  CPU%(cpu)d  %(tsc)d (+%(reltsc)8d)  VMEXIT      [ exitcode = 0x%(1)08x, rIP  = 0x%(3)08x%(2)08x ]

^ permalink raw reply related	[flat|nested] 51+ messages in thread

* [PATCH v2 12/16] xenalyze: handle scheduling events
  2016-02-16 18:11 [PATCH v2 00/16] Scheduling related tracing improvements Dario Faggioli
                   ` (10 preceding siblings ...)
  2016-02-16 18:12 ` [PATCH v2 11/16] xentrace: formats: add domain create and destroy events Dario Faggioli
@ 2016-02-16 18:12 ` Dario Faggioli
  2016-02-18 15:18   ` George Dunlap
  2016-02-16 18:12 ` [PATCH v2 13/16] xenalyze: handle Credit1 scheduler events Dario Faggioli
                   ` (4 subsequent siblings)
  16 siblings, 1 reply; 51+ messages in thread
From: Dario Faggioli @ 2016-02-16 18:12 UTC (permalink / raw)
  To: xen-devel; +Cc: Olaf Hering, Wei Liu, Ian Campbell, George Dunlap, Ian Jackson

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:
 * SCHED_DOM_{ADD,REM} handling slightly changed, to avoid
   confusion with DOM0_DOM_{ADD,REM} (introduced later in
   the series);
 * '} * r =' turned into '} *r =', as requested
   during review.
---
 tools/xentrace/xenalyze.c |  156 ++++++++++++++++++++++++++++++++++++---------
 1 file changed, 126 insertions(+), 30 deletions(-)

diff --git a/tools/xentrace/xenalyze.c b/tools/xentrace/xenalyze.c
index 6520790..17021f1 100644
--- a/tools/xentrace/xenalyze.c
+++ b/tools/xentrace/xenalyze.c
@@ -1519,27 +1519,6 @@ struct pv_data {
 };
 
 /* Sched data */
-
-enum {
-    SCHED_DOM_ADD=1,
-    SCHED_DOM_REM,
-    SCHED_SLEEP,
-    SCHED_WAKE,
-    SCHED_YIELD,
-    SCHED_BLOCK,
-    SCHED_SHUTDOWN,
-    SCHED_CTL,
-    SCHED_ADJDOM,
-    SCHED_SWITCH,
-    SCHED_S_TIMER_FN,
-    SCHED_T_TIMER_FN,
-    SCHED_DOM_TIMER_FN,
-    SCHED_SWITCH_INFPREV,
-    SCHED_SWITCH_INFNEXT,
-    SCHED_SHUTDOWN_CODE,
-    SCHED_MAX
-};
-
 enum {
     RUNSTATE_RUNNING=0,
     RUNSTATE_RUNNABLE,
@@ -7431,6 +7410,17 @@ no_update:
     return;
 }
 
+void dump_sched_switch(struct record_info *ri)
+{
+    struct {
+        unsigned int prev_dom, prev_vcpu, next_dom, next_vcpu;
+    } *r = (typeof(r))ri->d;
+
+    printf(" %s sched_switch prev d%uv%u next d%uv%u\n",
+           ri->dump_header, r->prev_dom, r->prev_vcpu,
+           r->next_dom, r->next_vcpu);
+}
+
 void sched_switch_process(struct pcpu_info *p)
 {
     struct vcpu_data *prev, *next;
@@ -7440,10 +7430,7 @@ void sched_switch_process(struct pcpu_info *p)
     } * r = (typeof(r))ri->d;
 
     if(opt.dump_all)
-        printf("%s sched_switch prev d%uv%u next d%uv%u\n",
-               ri->dump_header,
-               r->prev_dom, r->prev_vcpu,
-               r->next_dom, r->next_vcpu);
+        dump_sched_switch(ri);
 
     if(r->prev_vcpu > MAX_CPUS)
     {
@@ -7559,6 +7546,14 @@ void sched_summary_domain(struct domain_data *d)
     }
 }
 
+void dump_sched_vcpu_action(struct record_info *ri, const char *action)
+{
+    struct {
+        unsigned int domid, vcpuid;
+    } *r = (typeof(r))ri->d;
+
+    printf(" %s %s d%uv%u\n", ri->dump_header, action, r->domid, r->vcpuid);
+}
 
 void sched_process(struct pcpu_info *p)
 {
@@ -7573,13 +7568,114 @@ void sched_process(struct pcpu_info *p)
         default:
             process_generic(&p->ri);
         }
-    } else {
-        if(ri->evt.sub == 1)
-            sched_runstate_process(p);
-        else {
-            UPDATE_VOLUME(p, sched_verbose, ri->size);
+        return;
+    }
+
+    if(ri->evt.sub == 1) {
+        /* TRC_SCHED_MIN */
+        sched_runstate_process(p);
+    } else if (ri->evt.sub == 8) {
+        /* TRC_SCHED_VERBOSE */
+        switch(ri->event)
+        {
+        case TRC_SCHED_DOM_ADD:
+            if(opt.dump_all) {
+                struct {
+                    unsigned int domid;
+                } *r = (typeof(r))ri->d;
+
+                printf(" %s sched_init_domain d%u\n", ri->dump_header, r->domid);
+            }
+            break;
+        case TRC_SCHED_DOM_REM:
+            if(opt.dump_all) {
+                struct {
+                    unsigned int domid, vcpuid;
+                } *r = (typeof(r))ri->d;
+
+                printf(" %s sched_destroy_domain d%u\n", ri->dump_header, r->domid);
+            }
+            break;
+        case TRC_SCHED_SLEEP:
+            if(opt.dump_all)
+                dump_sched_vcpu_action(ri, "vcpu_sleep");
+            break;
+        case TRC_SCHED_WAKE:
+            if(opt.dump_all)
+                dump_sched_vcpu_action(ri, "vcpu_wake");
+            break;
+        case TRC_SCHED_YIELD:
+            if(opt.dump_all)
+                dump_sched_vcpu_action(ri, "vcpu_yield");
+            break;
+        case TRC_SCHED_BLOCK:
+            if(opt.dump_all)
+                dump_sched_vcpu_action(ri, "vcpu_block");
+            break;
+        case TRC_SCHED_SHUTDOWN:
+        case TRC_SCHED_SHUTDOWN_CODE:
+            if(opt.dump_all) {
+                struct {
+                    unsigned int domid, vcpuid, reason;
+                } *r = (typeof(r))ri->d;
+
+                printf(" %s %s d%uv%u, reason = %u\n", ri->dump_header,
+                       ri->event == TRC_SCHED_SHUTDOWN ? "sched_shutdown" :
+                       "sched_shutdown_code", r->domid, r->vcpuid, r->reason);
+            }
+            break;
+        case TRC_SCHED_ADJDOM:
+            if(opt.dump_all) {
+                struct {
+                    unsigned int domid;
+                } *r = (typeof(r))ri->d;
+
+                printf(" %s sched_adjust d%u\n", ri->dump_header, r->domid);
+            }
+            break;
+        case TRC_SCHED_SWITCH:
+            dump_sched_switch(ri);
+            break;
+        case TRC_SCHED_SWITCH_INFPREV:
+            if(opt.dump_all) {
+                struct {
+                    unsigned int domid, runtime;
+                } *r = (typeof(r))ri->d;
+
+                printf(" %s sched_switch prev d%u, run for %u.%uus\n",
+                       ri->dump_header, r->domid, r->runtime / 1000,
+                       r->runtime % 1000);
+            }
+            break;
+        case TRC_SCHED_SWITCH_INFNEXT:
+            if(opt.dump_all)
+            {
+                struct {
+                    unsigned int domid, rsince;
+                    int slice;
+                } *r = (typeof(r))ri->d;
+
+                printf(" %s sched_switch next d%u", ri->dump_header, r->domid);
+                if ( r->rsince != 0 )
+                    printf(", was runnable for %u.%uus, ", r->rsince / 1000,
+                           r->rsince % 1000);
+                if ( r->slice > 0 )
+                    printf("next slice %u.%uus\n", r->slice / 1000,
+                           r->slice % 1000);
+                printf("\n");
+            }
+            break;
+        case TRC_SCHED_CTL:
+        case TRC_SCHED_S_TIMER_FN:
+        case TRC_SCHED_T_TIMER_FN:
+        case TRC_SCHED_DOM_TIMER_FN:
+            break;
+        default:
             process_generic(&p->ri);
         }
+    } else {
+        UPDATE_VOLUME(p, sched_verbose, ri->size);
+        process_generic(&p->ri);
     }
 }

^ permalink raw reply related	[flat|nested] 51+ messages in thread

* [PATCH v2 13/16] xenalyze: handle Credit1 scheduler events
  2016-02-16 18:11 [PATCH v2 00/16] Scheduling related tracing improvements Dario Faggioli
                   ` (11 preceding siblings ...)
  2016-02-16 18:12 ` [PATCH v2 12/16] xenalyze: handle scheduling events Dario Faggioli
@ 2016-02-16 18:12 ` Dario Faggioli
  2016-02-18 15:28   ` George Dunlap
  2016-02-18 15:31   ` George Dunlap
  2016-02-16 18:13 ` [PATCH v2 14/16] xenalyze: handle Credit2 " Dario Faggioli
                   ` (3 subsequent siblings)
  16 siblings, 2 replies; 51+ messages in thread
From: Dario Faggioli @ 2016-02-16 18:12 UTC (permalink / raw)
  To: xen-devel; +Cc: Olaf Hering, Wei Liu, Ian Campbell, George Dunlap, Ian Jackson

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 */
+            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);

^ permalink raw reply related	[flat|nested] 51+ messages in thread

* [PATCH v2 14/16] xenalyze: handle Credit2 scheduler events
  2016-02-16 18:11 [PATCH v2 00/16] Scheduling related tracing improvements Dario Faggioli
                   ` (12 preceding siblings ...)
  2016-02-16 18:12 ` [PATCH v2 13/16] xenalyze: handle Credit1 scheduler events Dario Faggioli
@ 2016-02-16 18:13 ` Dario Faggioli
  2016-02-18 15:17   ` George Dunlap
  2016-02-16 18:13 ` [PATCH v2 15/16] xenalyze: handle RTDS " Dario Faggioli
                   ` (2 subsequent siblings)
  16 siblings, 1 reply; 51+ messages in thread
From: Dario Faggioli @ 2016-02-16 18:13 UTC (permalink / raw)
  To: xen-devel; +Cc: Olaf Hering, Wei Liu, Ian Campbell, George Dunlap, Ian Jackson

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>
Cc: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>
---
Changes from v1:
 * '} * r =' turned into '} *r =', as requested
   during review.
---
 tools/xentrace/xenalyze.c |  101 +++++++++++++++++++++++++++++++++++++++++++++
 1 file changed, 101 insertions(+)

diff --git a/tools/xentrace/xenalyze.c b/tools/xentrace/xenalyze.c
index 4ab2dba..8f97f3a 100644
--- a/tools/xentrace/xenalyze.c
+++ b/tools/xentrace/xenalyze.c
@@ -7727,6 +7727,107 @@ void sched_process(struct pcpu_info *p)
                        ri->dump_header, r->cpu);
             }
             break;
+        /* CREDIT 2 (TRC_CSCHED2_xxx) */
+        case TRC_SCHED_CLASS_EVT(CSCHED2, 1): /* TICK              */
+        case TRC_SCHED_CLASS_EVT(CSCHED2, 4): /* CREDIT_ADD        */
+        case TRC_SCHED_CLASS_EVT(CSCHED2, 9): /* UPDATE_LOAD       */
+            break;
+        case TRC_SCHED_CLASS_EVT(CSCHED2, 2): /* RUNQ_POS          */
+            if(opt.dump_all) {
+                struct {
+                    unsigned int vcpuid:16, domid:16, pos;
+                } *r = (typeof(r))ri->d;
+
+                printf(" %s csched2:runq_insert d%uv%u, position %u\n",
+                       ri->dump_header, r->domid, r->vcpuid, r->pos);
+            }
+            break;
+        case TRC_SCHED_CLASS_EVT(CSCHED2, 3): /* CREDIT_BURN       */
+            if(opt.dump_all) {
+                struct {
+                    unsigned int vcpuid:16, domid:16, credit;
+                    int delta;
+                } *r = (typeof(r))ri->d;
+
+                printf(" %s csched2:burn_credits d%uv%u, credit = %u, delta = %d\n",
+                       ri->dump_header, r->domid, r->vcpuid,
+                       r->credit, r->delta);
+            }
+            break;
+        case TRC_SCHED_CLASS_EVT(CSCHED2, 5): /* TICKLE_CHECK      */
+            if(opt.dump_all) {
+                struct {
+                    unsigned int vcpuid:16, domid:16;
+                    unsigned int credit;
+                } *r = (typeof(r))ri->d;
+
+                printf(" %s csched2:tickle_check d%uv%u, credit = %u\n",
+                       ri->dump_header, r->domid, r->vcpuid, r->credit);
+            }
+            break;
+        case TRC_SCHED_CLASS_EVT(CSCHED2, 6): /* TICKLE            */
+            if(opt.dump_all) {
+                struct {
+                    unsigned int cpu:16;
+                } *r = (typeof(r))ri->d;
+
+                printf(" %s csched2:runq_tickle cpu %u\n",
+                       ri->dump_header, r->cpu);
+            }
+            break;
+        case TRC_SCHED_CLASS_EVT(CSCHED2, 7):  /* CREDIT_RESET     */
+            if(opt.dump_all) {
+                struct {
+                    unsigned int vcpuid:16, domid:16;
+                    unsigned 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",
+                       ri->dump_header, r->domid, r->vcpuid,
+                       r->credit_start, r->credit_end, r->multiplier);
+            }
+            break;
+        case TRC_SCHED_CLASS_EVT(CSCHED2, 8):  /* SCHED_TASKLET    */
+            if(opt.dump_all)
+                printf(" %s csched2:sched_tasklet\n", ri->dump_header);
+            break;
+        case TRC_SCHED_CLASS_EVT(CSCHED2, 10): /* RUNQ_ASSIGN      */
+            if(opt.dump_all) {
+                struct {
+                    unsigned int vcpuid:16, domid:16;
+                    unsigned int rqi;
+                } *r = (typeof(r))ri->d;
+
+                printf(" %s csched2:runq_assign d%uv%u on rq# %u\n",
+                       ri->dump_header, r->domid, r->vcpuid, r->rqi);
+            }
+            break;
+        case TRC_SCHED_CLASS_EVT(CSCHED2, 11): /* UPDATE_VCPU_LOAD */
+            if(opt.dump_all) {
+                struct {
+                    unsigned int vcpuid:16, domid:16;
+                    unsigned int avgload;
+                } *r = (typeof(r))ri->d;
+
+                printf(" %s csched2:update_vcpu_load d%uv%u, avg_load = %u\n",
+                       ri->dump_header, r->domid, r->vcpuid, r->avgload);
+            }
+            break;
+        case TRC_SCHED_CLASS_EVT(CSCHED2, 12): /* UPDATE_RUNQ_LOAD */
+            if(opt.dump_all) {
+                struct {
+                    unsigned int rq_load:4, rq_avgload:28;
+                    unsigned int rq_id:4, b_avgload:28;
+                } *r = (typeof(r))ri->d;
+
+                printf(" %s csched2:update_rq_load rq# %u, load = %u, "
+                       "avgload = %u, b_avgload = %u\n",
+                       ri->dump_header, r->rq_id, r->rq_load,
+                       r->rq_avgload, r->b_avgload);
+            }
+            break;
         default:
             process_generic(ri);
         }

^ permalink raw reply related	[flat|nested] 51+ messages in thread

* [PATCH v2 15/16] xenalyze: handle RTDS scheduler events
  2016-02-16 18:11 [PATCH v2 00/16] Scheduling related tracing improvements Dario Faggioli
                   ` (13 preceding siblings ...)
  2016-02-16 18:13 ` [PATCH v2 14/16] xenalyze: handle Credit2 " Dario Faggioli
@ 2016-02-16 18:13 ` Dario Faggioli
  2016-02-18 15:28   ` George Dunlap
  2016-02-16 18:13 ` [PATCH v2 16/16] xenalyze: handle DOM0 operaions events Dario Faggioli
  2016-03-04 18:25 ` [PATCH v2 00/16] Scheduling related tracing improvements Dario Faggioli
  16 siblings, 1 reply; 51+ messages in thread
From: Dario Faggioli @ 2016-02-16 18:13 UTC (permalink / raw)
  To: xen-devel
  Cc: Olaf Hering, Wei Liu, Ian Campbell, George Dunlap, Tianyang Chen,
	Ian Jackson, Meng Xu

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: Meng Xu <xumengpanda@gmail.com>
Cc: Tianyang Chen <tiche@seas.upenn.edu>
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 |   59 +++++++++++++++++++++++++++++++++++++++++++++
 1 file changed, 59 insertions(+)

diff --git a/tools/xentrace/xenalyze.c b/tools/xentrace/xenalyze.c
index 8f97f3a..dd21229 100644
--- a/tools/xentrace/xenalyze.c
+++ b/tools/xentrace/xenalyze.c
@@ -7828,6 +7828,65 @@ void sched_process(struct pcpu_info *p)
                        r->rq_avgload, r->b_avgload);
             }
             break;
+        /* RTDS (TRC_RTDS_xxx) */
+        case TRC_SCHED_CLASS_EVT(RTDS, 1): /* TICKLE           */
+            if(opt.dump_all) {
+                struct {
+                    unsigned int cpu:16;
+                } *r = (typeof(r))ri->d;
+
+                printf(" %s rtds:runq_tickle cpu %u\n",
+                       ri->dump_header, r->cpu);
+            }
+            break;
+        case TRC_SCHED_CLASS_EVT(RTDS, 2): /* RUNQ_PICK        */
+            if(opt.dump_all) {
+                struct {
+                    unsigned int vcpuid:16, domid:16;
+                    unsigned int cur_dl_lo, cur_dl_hi;
+                    unsigned int cur_bg_lo, cur_bg_hi;
+                } *r = (typeof(r))ri->d;
+                uint64_t dl = (((uint64_t)r->cur_dl_hi) << 32) + r->cur_dl_lo;
+                uint64_t bg = (((uint64_t)r->cur_bg_hi) << 32) + r->cur_bg_lo;
+
+                printf(" %s rtds:runq_pick d%uv%u, deadline = %"PRIu64", "
+                       "budget = %"PRIu64"\n", ri->dump_header,
+                       r->domid, r->vcpuid, dl, bg);
+            }
+            break;
+        case TRC_SCHED_CLASS_EVT(RTDS, 3): /* BUDGET_BURN      */
+            if(opt.dump_all) {
+                struct {
+                    unsigned int vcpuid:16, domid:16;
+                    unsigned int cur_bg_lo, cur_bg_hi;
+                    int delta;
+                } *r = (typeof(r))ri->d;
+                uint64_t bg = (((uint64_t)r->cur_bg_hi) << 32) + r->cur_bg_lo;
+
+                printf(" %s rtds:burn_budget d%uv%u, budget = %"PRIu64", "
+                       "delta = %d\n", ri->dump_header, r->domid,
+                       r->vcpuid, bg, r->delta);
+            }
+            break;
+        case TRC_SCHED_CLASS_EVT(RTDS, 4): /* BUDGET_REPLENISH */
+            if(opt.dump_all) {
+                struct {
+                    unsigned int vcpuid:16, domid:16;
+                    unsigned int cur_dl_lo, cur_dl_hi;
+                    unsigned int cur_bg_lo, cur_bg_hi;
+                } *r = (typeof(r))ri->d;
+                uint64_t dl = (((uint64_t)r->cur_dl_hi) << 32) + r->cur_dl_lo;
+                uint64_t bg = (((uint64_t)r->cur_bg_hi) << 32) + r->cur_bg_lo;
+
+                printf(" %s rtds:repl_budget d%uv%u, deadline = %"PRIu64", "
+                       "budget = %"PRIu64"\n", ri->dump_header,
+                       r->domid, r->vcpuid, dl, bg);
+            }
+            break;
+        case TRC_SCHED_CLASS_EVT(RTDS, 5): /* SCHED_TASKLET    */
+            if(opt.dump_all)
+                printf(" %s rtds:sched_tasklet\n", ri->dump_header);
+            break;
         default:
             process_generic(ri);
         }

^ permalink raw reply related	[flat|nested] 51+ messages in thread

* [PATCH v2 16/16] xenalyze: handle DOM0 operaions events
  2016-02-16 18:11 [PATCH v2 00/16] Scheduling related tracing improvements Dario Faggioli
                   ` (14 preceding siblings ...)
  2016-02-16 18:13 ` [PATCH v2 15/16] xenalyze: handle RTDS " Dario Faggioli
@ 2016-02-16 18:13 ` Dario Faggioli
  2016-03-04 18:25 ` [PATCH v2 00/16] Scheduling related tracing improvements Dario Faggioli
  16 siblings, 0 replies; 51+ messages in thread
From: Dario Faggioli @ 2016-02-16 18:13 UTC (permalink / raw)
  To: xen-devel; +Cc: Olaf Hering, Wei Liu, Ian Campbell, George Dunlap, Ian Jackson

(i.e., domain creation and destruction) so the
trace will show properly decoded info, rather
than just a bunch of hex codes.
---
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>
Cc: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>
---
Changes from v1:
 * new patch in the series.
---
 tools/xentrace/xenalyze.c |   26 ++++++++++++++++++++++++++
 1 file changed, 26 insertions(+)

diff --git a/tools/xentrace/xenalyze.c b/tools/xentrace/xenalyze.c
index dd21229..267f932 100644
--- a/tools/xentrace/xenalyze.c
+++ b/tools/xentrace/xenalyze.c
@@ -8452,6 +8452,30 @@ void hw_process(struct pcpu_info *p)
     }
 
 }
+
+#define TRC_DOM0_SUB_DOMOPS 1
+void dom0_process(struct pcpu_info *p)
+{
+    struct record_info *ri = &p->ri;
+
+    switch(ri->evt.sub)
+    {
+    case TRC_DOM0_SUB_DOMOPS:
+        if(opt.dump_all) {
+            struct {
+                unsigned int domid;
+            } *r = (typeof(r))ri->d;
+
+        printf(" %s %s domain d%u\n", ri->dump_header,
+               ri->event == TRC_DOM0_DOM_ADD ? "creating" : "destroying",
+               r->domid);
+        }
+        break;
+    default:
+        process_generic(&p->ri);
+    }
+}
+
 /* ---- Base ----- */
 void dump_generic(FILE * f, struct record_info *ri)
 {
@@ -9288,6 +9312,8 @@ void process_record(struct pcpu_info *p) {
             hw_process(p);
             break;
         case TRC_DOM0OP_MAIN:
+            dom0_process(p);
+            break;
         default:
             process_generic(ri);
         }

^ permalink raw reply related	[flat|nested] 51+ messages in thread

* Re: [PATCH v2 06/16] xen: sched: tracing: enable TSC tracing for all events
  2016-02-16 18:11 ` [PATCH v2 06/16] xen: sched: tracing: enable TSC tracing for all events Dario Faggioli
@ 2016-02-16 18:21   ` Meng Xu
  2016-02-17  9:52     ` Dario Faggioli
  0 siblings, 1 reply; 51+ messages in thread
From: Meng Xu @ 2016-02-16 18:21 UTC (permalink / raw)
  To: Dario Faggioli; +Cc: xen-devel, Olaf Hering, Tianyang Chen, George Dunlap

Hi Dario,

Since this patch did some obvious change, I will reply with
reviewed-by, although my reviewed-by does not count much. ;-)

On Tue, Feb 16, 2016 at 1:11 PM, Dario Faggioli
<dario.faggioli@citrix.com> wrote:
>
> it is enabled for pretty much all of them already.
> There were just a few that had it disabled.
>
> When tracing a scheduler, timing information is
> really important, so enable it everywhere scheduling
> related.
>
> Note that this was not really a problem if looking
> at the traces with xenalyze, but it was if using
> xentrace_format.

I just have a quick (and perhaps naive) question: :-)
If xenanlyze works better than xentrace_format, why shouldn't we stick
to xenanlyze?
Is there some functionality xentrace_format can but xenalyze cannot?

(I have to confess that I only used xenalyze but didn't use
xentrace_format before. :-()

>
> Signed-off-by: Dario Faggioli <dario.faggioli@citrix.com>
> ---
> Cc: George Dunlap <george.dunlap@citrix.com>
> Cc: Meng Xu <xumengpanda@gmail.com>
> Cc: Tianyang Chen <tiche@seas.upenn.edu>
> Cc: Olaf Hering <olaf@aepfle.de>
> ---
>  xen/common/sched_credit.c  |    2 +-
>  xen/common/sched_credit2.c |    6 +++---
>  xen/common/sched_rt.c      |    2 +-
>  3 files changed, 5 insertions(+), 5 deletions(-)
>
> diff --git a/xen/common/sched_credit.c b/xen/common/sched_credit.c
> index 5279b92..bd2f37f 100644
> --- a/xen/common/sched_credit.c
> +++ b/xen/common/sched_credit.c
> @@ -476,7 +476,7 @@ static inline void __runq_tickle(struct csched_vcpu *new)
>          {
>              /* Avoid TRACE_*: saves checking !tb_init_done each step */
>              for_each_cpu(cpu, &mask)
> -                __trace_var(TRC_CSCHED_TICKLE, 0, sizeof(cpu), &cpu);
> +                __trace_var(TRC_CSCHED_TICKLE, 1, sizeof(cpu), &cpu);
>          }
>
>          /* Send scheduler interrupts to designated CPUs */
> diff --git a/xen/common/sched_credit2.c b/xen/common/sched_credit2.c
> index cf40f68..2934e26 100644
> --- a/xen/common/sched_credit2.c
> +++ b/xen/common/sched_credit2.c
> @@ -456,7 +456,7 @@ runq_insert(const struct scheduler *ops, unsigned int cpu, struct csched2_vcpu *
>          d.dom = svc->vcpu->domain->domain_id;
>          d.vcpu = svc->vcpu->vcpu_id;
>          d.pos = pos;
> -        trace_var(TRC_CSCHED2_RUNQ_POS, 0,
> +        trace_var(TRC_CSCHED2_RUNQ_POS, 1,
>                    sizeof(d),
>                    (unsigned char *)&d);
>      }
> @@ -564,7 +564,7 @@ tickle:
>              unsigned cpu:16, pad:16;
>          } d;
>          d.cpu = ipid; d.pad = 0;
> -        trace_var(TRC_CSCHED2_TICKLE, 0,
> +        trace_var(TRC_CSCHED2_TICKLE, 1,
>                    sizeof(d),
>                    (unsigned char *)&d);
>      }
> @@ -1721,7 +1721,7 @@ csched2_schedule(
>       */
>      if ( tasklet_work_scheduled )
>      {
> -        trace_var(TRC_CSCHED2_SCHED_TASKLET, 0, 0,  NULL);
> +        trace_var(TRC_CSCHED2_SCHED_TASKLET, 1, 0,  NULL);
>          snext = CSCHED2_VCPU(idle_vcpu[cpu]);
>      }
>      else
> diff --git a/xen/common/sched_rt.c b/xen/common/sched_rt.c
> index 53de6d6..33ac9de 100644
> --- a/xen/common/sched_rt.c
> +++ b/xen/common/sched_rt.c
> @@ -985,7 +985,7 @@ out:
>          } d;
>          d.cpu = cpu_to_tickle;
>          d.pad = 0;
> -        trace_var(TRC_RTDS_TICKLE, 0,
> +        trace_var(TRC_RTDS_TICKLE, 1,
>                    sizeof(d),
>                    (unsigned char *)&d);
>      }
>

Reviewed-by: Meng Xu <mengxu@cis.upenn.edu>

Best,

Meng


-----------
Meng Xu
PhD Student in Computer and Information Science
University of Pennsylvania
http://www.cis.upenn.edu/~mengxu/

^ permalink raw reply	[flat|nested] 51+ messages in thread

* Re: [PATCH v2 06/16] xen: sched: tracing: enable TSC tracing for all events
  2016-02-16 18:21   ` Meng Xu
@ 2016-02-17  9:52     ` Dario Faggioli
  2016-02-17 15:26       ` Meng Xu
  2016-02-18 11:43       ` George Dunlap
  0 siblings, 2 replies; 51+ messages in thread
From: Dario Faggioli @ 2016-02-17  9:52 UTC (permalink / raw)
  To: Meng Xu; +Cc: xen-devel, Olaf Hering, Tianyang Chen, George Dunlap


[-- Attachment #1.1: Type: text/plain, Size: 2774 bytes --]

On Tue, 2016-02-16 at 13:21 -0500, Meng Xu wrote:
> Hi Dario,
> 
> Since this patch did some obvious change, I will reply with
> reviewed-by, although my reviewed-by does not count much. ;-)
> 
That can't be less true. First of all, you're the original author of
this code, and you and, although I'm the maintainer, your group are the
one doing active development on it, so your opinion does have a weight.

But even if that wasn't the case, every reviewed-by is important, and
helps the project. It will be maintainers' and committer's job to
properly take each one into account in the most appropriate way, but
that does not mean it's not worthwhile for you (or anyone else) to
review the patches and express your acknowledgment, or send in your
comments. :-)

Actually, do feel free to do as much review (and, in case it applies,
send in your reviewed-by tag) as you like and can, either on RTDS or
anywhere else... The project is in great need of that!!

> On Tue, Feb 16, 2016 at 1:11 PM, Dario Faggioli
> <dario.faggioli@citrix.com> wrote:
> > 
> > Note that this was not really a problem if looking
> > at the traces with xenalyze, but it was if using
> > xentrace_format.
> 
> I just have a quick (and perhaps naive) question: :-)
> If xenanlyze works better than xentrace_format, why shouldn't we
> stick
> to xenanlyze?
> Is there some functionality xentrace_format can but xenalyze cannot?
> 
> (I have to confess that I only used xenalyze but didn't use
> xentrace_format before. :-()
>
xenalyze is indeed more advanced, but I don't think this means we
should ignore or neglect xentrace_format: we've got it in tree, so we
should not let it bitrot. I'm not in all our users' heads, so I don't
know whether --and if yes why-- people may prefer the latter over the
former, but I see room for someone wanting something basic and simple,
in some cases.

Actually, I've been in a couple of situations myself, where the raw
output of xentrace_format is easier to consume and, quick-&-dirtily,
post-process, than the much more elaborated one of xenalyze.

For instance, the thing that you can just change on the fly the way a
trace is shown (by tweaking the format file) looks an interesting
feature to me, even considering all the limitations of "pure" xentrace.
And if one want to change the formats for her own purposes, I feel like
it is important that the one that we ship is updated, and can be used
as a decent base for that.

Regards,
Dario
-- 
<<This happens because I choose it to happen!>> (Raistlin Majere)
-----------------------------------------------------------------
Dario Faggioli, Ph.D, http://about.me/dario.faggioli
Senior Software Engineer, Citrix Systems R&D Ltd., Cambridge (UK)


[-- Attachment #1.2: This is a digitally signed message part --]
[-- Type: application/pgp-signature, Size: 181 bytes --]

[-- Attachment #2: Type: text/plain, Size: 126 bytes --]

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

^ permalink raw reply	[flat|nested] 51+ messages in thread

* Re: [PATCH v2 06/16] xen: sched: tracing: enable TSC tracing for all events
  2016-02-17  9:52     ` Dario Faggioli
@ 2016-02-17 15:26       ` Meng Xu
  2016-02-18 11:43       ` George Dunlap
  1 sibling, 0 replies; 51+ messages in thread
From: Meng Xu @ 2016-02-17 15:26 UTC (permalink / raw)
  To: Dario Faggioli; +Cc: xen-devel, Olaf Hering, Tianyang Chen, George Dunlap

On Wed, Feb 17, 2016 at 4:52 AM, Dario Faggioli
<dario.faggioli@citrix.com> wrote:
> On Tue, 2016-02-16 at 13:21 -0500, Meng Xu wrote:
>> Hi Dario,
>>
>> Since this patch did some obvious change, I will reply with
>> reviewed-by, although my reviewed-by does not count much. ;-)
>>
> That can't be less true. First of all, you're the original author of
> this code, and you and, although I'm the maintainer, your group are the
> one doing active development on it, so your opinion does have a weight.
>
> But even if that wasn't the case, every reviewed-by is important, and
> helps the project. It will be maintainers' and committer's job to
> properly take each one into account in the most appropriate way, but
> that does not mean it's not worthwhile for you (or anyone else) to
> review the patches and express your acknowledgment, or send in your
> comments. :-)
>
> Actually, do feel free to do as much review (and, in case it applies,
> send in your reviewed-by tag) as you like and can, either on RTDS or
> anywhere else... The project is in great need of that!!

I see. Thank you very much for the advice and information! I got it now. :-D
I'm so glad to know that I can also comment on other parts of the
code, besides RTDS. :-D

>
>> On Tue, Feb 16, 2016 at 1:11 PM, Dario Faggioli
>> <dario.faggioli@citrix.com> wrote:
>> >
>> > Note that this was not really a problem if looking
>> > at the traces with xenalyze, but it was if using
>> > xentrace_format.
>>
>> I just have a quick (and perhaps naive) question: :-)
>> If xenanlyze works better than xentrace_format, why shouldn't we
>> stick
>> to xenanlyze?
>> Is there some functionality xentrace_format can but xenalyze cannot?
>>
>> (I have to confess that I only used xenalyze but didn't use
>> xentrace_format before. :-()
>>
> xenalyze is indeed more advanced, but I don't think this means we
> should ignore or neglect xentrace_format: we've got it in tree, so we
> should not let it bitrot. I'm not in all our users' heads, so I don't
> know whether --and if yes why-- people may prefer the latter over the
> former, but I see room for someone wanting something basic and simple,
> in some cases.
>
> Actually, I've been in a couple of situations myself, where the raw
> output of xentrace_format is easier to consume and, quick-&-dirtily,
> post-process, than the much more elaborated one of xenalyze.
>
> For instance, the thing that you can just change on the fly the way a
> trace is shown (by tweaking the format file) looks an interesting
> feature to me, even considering all the limitations of "pure" xentrace.
> And if one want to change the formats for her own purposes, I feel like
> it is important that the one that we ship is updated, and can be used
> as a decent base for that.

I see the point here now. I will try the xentrace_format next time then. :-)

Thanks and best regards,

Meng
-- 


-----------
Meng Xu
PhD Student in Computer and Information Science
University of Pennsylvania
http://www.cis.upenn.edu/~mengxu/

^ permalink raw reply	[flat|nested] 51+ messages in thread

* Re: [PATCH v2 01/16] xen: sched: __runq_tickle takes a useless cpu parameter
  2016-02-16 18:11 ` [PATCH v2 01/16] xen: sched: __runq_tickle takes a useless cpu parameter Dario Faggioli
@ 2016-02-18 10:33   ` George Dunlap
  0 siblings, 0 replies; 51+ messages in thread
From: George Dunlap @ 2016-02-18 10:33 UTC (permalink / raw)
  To: Dario Faggioli, xen-devel

On 16/02/16 18:11, Dario Faggioli wrote:
> as it is always acts on v->processor of the vcpu that
> we are tickling.
> 
> Getting rid of it makes the code easier to understand
> and better looking.
> 
> While there, remove a spurious blank line.
> 
> 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@citrix.com>
> ---
> Changes from v1:
>  * fix wording inside the changelog, as suggested during
>    review.
> ---
>  xen/common/sched_credit.c |   10 ++++------
>  1 file changed, 4 insertions(+), 6 deletions(-)
> 
> diff --git a/xen/common/sched_credit.c b/xen/common/sched_credit.c
> index 671bbee..5279b92 100644
> --- a/xen/common/sched_credit.c
> +++ b/xen/common/sched_credit.c
> @@ -360,9 +360,9 @@ boolean_param("tickle_one_idle_cpu", opt_tickle_one_idle);
>  
>  DEFINE_PER_CPU(unsigned int, last_tickle_cpu);
>  
> -static inline void
> -__runq_tickle(unsigned int cpu, struct csched_vcpu *new)
> +static inline void __runq_tickle(struct csched_vcpu *new)
>  {
> +    unsigned int cpu = new->vcpu->processor;
>      struct csched_vcpu * const cur = CSCHED_VCPU(curr_on_cpu(cpu));
>      struct csched_private *prv = CSCHED_PRIV(per_cpu(scheduler, cpu));
>      cpumask_t mask, idle_mask, *online;
> @@ -375,7 +375,6 @@ __runq_tickle(unsigned int cpu, struct csched_vcpu *new)
>      cpumask_and(&idle_mask, prv->idlers, online);
>      idlers_empty = cpumask_empty(&idle_mask);
>  
> -
>      /*
>       * If the pcpu is idle, or there are no idlers and the new
>       * vcpu is a higher priority than the old vcpu, run it here.
> @@ -980,11 +979,10 @@ static void
>  csched_vcpu_wake(const struct scheduler *ops, struct vcpu *vc)
>  {
>      struct csched_vcpu * const svc = CSCHED_VCPU(vc);
> -    const unsigned int cpu = vc->processor;
>  
>      BUG_ON( is_idle_vcpu(vc) );
>  
> -    if ( unlikely(curr_on_cpu(cpu) == vc) )
> +    if ( unlikely(curr_on_cpu(vc->processor) == vc) )
>      {
>          SCHED_STAT_CRANK(vcpu_wake_running);
>          return;
> @@ -1028,7 +1026,7 @@ csched_vcpu_wake(const struct scheduler *ops, struct vcpu *vc)
>  
>      /* Put the VCPU on the runq and tickle CPUs */
>      __runq_insert(svc);
> -    __runq_tickle(cpu, svc);
> +    __runq_tickle(svc);
>  }
>  
>  static void
> 

^ permalink raw reply	[flat|nested] 51+ messages in thread

* Re: [PATCH v2 02/16] xen: sched: move up the trace record for vcpu_wake and vcpu_sleep
  2016-02-16 18:11 ` [PATCH v2 02/16] xen: sched: move up the trace record for vcpu_wake and vcpu_sleep Dario Faggioli
@ 2016-02-18 10:34   ` George Dunlap
  0 siblings, 0 replies; 51+ messages in thread
From: George Dunlap @ 2016-02-18 10:34 UTC (permalink / raw)
  To: Dario Faggioli, xen-devel

On 16/02/16 18:11, Dario Faggioli wrote:
> vcpu_wake() and vcpu_sleep() are called before the specific
> schedulers wakeup and sleep routines (in fact, it is them
> that calls those specific routine).
> 
> Make the trace reflect that, by moving the records up. In
> fact, it is more natural and easy to find the record of
> the event (e.g., the wakeup) *before* the records of the
> actions that deals with the event itself.
> 
> 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@citrix.com>
> ---
>  xen/common/schedule.c |   16 ++++++++++------
>  1 file changed, 10 insertions(+), 6 deletions(-)
> 
> diff --git a/xen/common/schedule.c b/xen/common/schedule.c
> index 7306d71..c87922f 100644
> --- a/xen/common/schedule.c
> +++ b/xen/common/schedule.c
> @@ -381,7 +381,11 @@ void sched_destroy_domain(struct domain *d)
>  void vcpu_sleep_nosync(struct vcpu *v)
>  {
>      unsigned long flags;
> -    spinlock_t *lock = vcpu_schedule_lock_irqsave(v, &flags);
> +    spinlock_t *lock;
> +
> +    TRACE_2D(TRC_SCHED_SLEEP, v->domain->domain_id, v->vcpu_id);
> +
> +    lock = vcpu_schedule_lock_irqsave(v, &flags);
>  
>      if ( likely(!vcpu_runnable(v)) )
>      {
> @@ -392,8 +396,6 @@ void vcpu_sleep_nosync(struct vcpu *v)
>      }
>  
>      vcpu_schedule_unlock_irqrestore(lock, flags, v);
> -
> -    TRACE_2D(TRC_SCHED_SLEEP, v->domain->domain_id, v->vcpu_id);
>  }
>  
>  void vcpu_sleep_sync(struct vcpu *v)
> @@ -409,7 +411,11 @@ void vcpu_sleep_sync(struct vcpu *v)
>  void vcpu_wake(struct vcpu *v)
>  {
>      unsigned long flags;
> -    spinlock_t *lock = vcpu_schedule_lock_irqsave(v, &flags);
> +    spinlock_t *lock;
> +
> +    TRACE_2D(TRC_SCHED_WAKE, v->domain->domain_id, v->vcpu_id);
> +
> +    lock = vcpu_schedule_lock_irqsave(v, &flags);
>  
>      if ( likely(vcpu_runnable(v)) )
>      {
> @@ -424,8 +430,6 @@ void vcpu_wake(struct vcpu *v)
>      }
>  
>      vcpu_schedule_unlock_irqrestore(lock, flags, v);
> -
> -    TRACE_2D(TRC_SCHED_WAKE, v->domain->domain_id, v->vcpu_id);
>  }
>  
>  void vcpu_unblock(struct vcpu *v)
> 

^ permalink raw reply	[flat|nested] 51+ messages in thread

* Re: [PATCH v2 03/16] xen: sched: improve domain creation tracing
  2016-02-16 18:11 ` [PATCH v2 03/16] xen: sched: improve domain creation tracing Dario Faggioli
@ 2016-02-18 11:04   ` George Dunlap
  2016-02-24 11:21     ` Dario Faggioli
  0 siblings, 1 reply; 51+ messages in thread
From: George Dunlap @ 2016-02-18 11:04 UTC (permalink / raw)
  To: Dario Faggioli, xen-devel; +Cc: George Dunlap, Ian Campbell, Jan Beulich

On 16/02/16 18:11, Dario Faggioli wrote:
> by doing the following two things:
> 
>  - move TRC_SCHED_DOM_{ADD,REM}, into the functions
>    that do the actual scheduling-related domain
>    initialization;
> 
>  - add two 'generic' DOM_{ADD,REM} events. They're
>    made part of the TRC_DOM0 tracing class, as Dom0
>    is, usually, from where domains are created and
>    destroyed.
> 
> Signed-off-by: Dario Faggioli <dario.faggioli@citrix.com>

Reviewed-by: George Dunlap <george.dunlap@citrix.com>

Since this changes domain.c, I guess this would need an ack from "The
Rest" -- probably either from Jan or Ian, since they're somewhat
familiar with this code...?

 -George

> ---
> Cc: George Dunlap <george.dunlap@eu.citrix.com>
> Cc: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>
> ---
> Changes from v1:
>  * added generic domain creation and destruction events, as
>    suggested during review.
> ---
>  xen/common/domain.c        |    5 ++++-
>  xen/common/schedule.c      |    4 ++--
>  xen/include/public/trace.h |    6 ++++++
>  3 files changed, 12 insertions(+), 3 deletions(-)
> 
> diff --git a/xen/common/domain.c b/xen/common/domain.c
> index 425767c..45273d4 100644
> --- a/xen/common/domain.c
> +++ b/xen/common/domain.c
> @@ -270,6 +270,8 @@ struct domain *domain_create(domid_t domid, unsigned int domcr_flags,
>  
>      d->domain_id = domid;
>  
> +    TRACE_1D(TRC_DOM0_DOM_ADD, d->domain_id);
> +
>      lock_profile_register_struct(LOCKPROF_TYPE_PERDOM, d, domid, "Domain");
>  
>      if ( (err = xsm_alloc_security_domain(d)) != 0 )
> @@ -864,10 +866,11 @@ void domain_destroy(struct domain *d)
>      if ( atomic_cmpxchg(&d->refcnt, 0, DOMAIN_DESTROYED) != 0 )
>          return;
>  
> +    TRACE_1D(TRC_DOM0_DOM_REM, d->domain_id);
> +
>      cpupool_rm_domain(d);
>  
>      /* Delete from task list and task hashtable. */
> -    TRACE_1D(TRC_SCHED_DOM_REM, d->domain_id);
>      spin_lock(&domlist_update_lock);
>      pd = &domain_list;
>      while ( *pd != d ) 
> diff --git a/xen/common/schedule.c b/xen/common/schedule.c
> index c87922f..27695e3 100644
> --- a/xen/common/schedule.c
> +++ b/xen/common/schedule.c
> @@ -241,8 +241,6 @@ int sched_init_vcpu(struct vcpu *v, unsigned int processor)
>      if ( v->sched_priv == NULL )
>          return 1;
>  
> -    TRACE_2D(TRC_SCHED_DOM_ADD, v->domain->domain_id, v->vcpu_id);
> -
>      /* Idle VCPUs are scheduled immediately, so don't put them in runqueue. */
>      if ( is_idle_domain(d) )
>      {
> @@ -369,12 +367,14 @@ void sched_destroy_vcpu(struct vcpu *v)
>  int sched_init_domain(struct domain *d)
>  {
>      SCHED_STAT_CRANK(dom_init);
> +    TRACE_1D(TRC_SCHED_DOM_ADD, d->domain_id);
>      return SCHED_OP(DOM2OP(d), init_domain, d);
>  }
>  
>  void sched_destroy_domain(struct domain *d)
>  {
>      SCHED_STAT_CRANK(dom_destroy);
> +    TRACE_1D(TRC_SCHED_DOM_REM, d->domain_id);
>      SCHED_OP(DOM2OP(d), destroy_domain, d);
>  }
>  
> diff --git a/xen/include/public/trace.h b/xen/include/public/trace.h
> index 274f8f6..5ef9c37 100644
> --- a/xen/include/public/trace.h
> +++ b/xen/include/public/trace.h
> @@ -85,6 +85,9 @@
>        ((TRC_SCHED_##_c << TRC_SCHED_ID_SHIFT) & TRC_SCHED_ID_MASK) ) + \
>      (_e & TRC_SCHED_EVT_MASK) )
>  
> +/* Trace classes for DOM0 operations */
> +#define TRC_DOM0_DOMOPS     0x00041000   /* Domains manipulations */
> +
>  /* Trace classes for Hardware */
>  #define TRC_HW_PM           0x00801000   /* Power management traces */
>  #define TRC_HW_IRQ          0x00802000   /* Traces relating to the handling of IRQs */
> @@ -113,6 +116,9 @@
>  #define TRC_SCHED_SWITCH_INFNEXT (TRC_SCHED_VERBOSE + 15)
>  #define TRC_SCHED_SHUTDOWN_CODE  (TRC_SCHED_VERBOSE + 16)
>  
> +#define TRC_DOM0_DOM_ADD         (TRC_DOM0_DOMOPS + 1)
> +#define TRC_DOM0_DOM_REM         (TRC_DOM0_DOMOPS + 2)
> +
>  #define TRC_MEM_PAGE_GRANT_MAP      (TRC_MEM + 1)
>  #define TRC_MEM_PAGE_GRANT_UNMAP    (TRC_MEM + 2)
>  #define TRC_MEM_PAGE_GRANT_TRANSFER (TRC_MEM + 3)
> 

^ permalink raw reply	[flat|nested] 51+ messages in thread

* Re: [PATCH v2 04/16] xen: credit2: pack trace data better for xentrace_format
  2016-02-16 18:11 ` [PATCH v2 04/16] xen: credit2: pack trace data better for xentrace_format Dario Faggioli
@ 2016-02-18 11:10   ` George Dunlap
  2016-02-18 13:42     ` Dario Faggioli
  0 siblings, 1 reply; 51+ messages in thread
From: George Dunlap @ 2016-02-18 11:10 UTC (permalink / raw)
  To: Dario Faggioli, xen-devel; +Cc: Olaf Hering

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 <dario.faggioli@citrix.com>
> Reviewed-by: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>

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 <george.dunlap@citrix.com>

> ---
> Cc: George Dunlap <george.dunlap@citrix.com>
> Cc: Olaf Hering <olaf@aepfle.de>
> ---
>  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;
> 

^ permalink raw reply	[flat|nested] 51+ messages in thread

* Re: [PATCH v2 05/16] xen: RTDS: pack trace data better for xentrace_format
  2016-02-16 18:11 ` [PATCH v2 05/16] xen: RTDS: " Dario Faggioli
@ 2016-02-18 11:12   ` George Dunlap
  2016-02-18 14:43   ` Meng Xu
  1 sibling, 0 replies; 51+ messages in thread
From: George Dunlap @ 2016-02-18 11:12 UTC (permalink / raw)
  To: Dario Faggioli, xen-devel; +Cc: Olaf Hering, Tianyang Chen, Meng Xu

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 RTDS 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.
> 
> While there, we also:
>  - fix the use of TRC_RTDS_SCHED_TASKLET (it should
>    only be involved when a tasklet is scheduled, not
>    _every_ time rt_schedule() is invoked!);
>  - remove a very chatty and useless (nothing has been
>    picked!) use of TRC_RTDS_RUNQ_PICK.
> 
> In fact, one can already figure out when nothing has been
> picked from the runqueue, by looking at when cpu_idle
> is invoked --which is the same thing one would do if on
> Credit or Credit2.
> 
> 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@citrix.com>
> Cc: Meng Xu <xumengpanda@gmail.com>
> Cc: Tianyang Chen <tiche@seas.upenn.edu>
> Cc: Olaf Hering <olaf@aepfle.de>
> ---
> Changes from v1:
>  * enhanced changelog, as suggested during review.
> ---
>  xen/common/sched_rt.c |   27 ++++-----------------------
>  1 file changed, 4 insertions(+), 23 deletions(-)
> 
> diff --git a/xen/common/sched_rt.c b/xen/common/sched_rt.c
> index 2e5430f..53de6d6 100644
> --- a/xen/common/sched_rt.c
> +++ b/xen/common/sched_rt.c
> @@ -362,7 +362,7 @@ rt_update_deadline(s_time_t now, struct rt_vcpu *svc)
>      /* TRACE */
>      {
>          struct {
> -            unsigned dom:16,vcpu:16;
> +            unsigned vcpu:16, dom:16;
>              unsigned cur_deadline_lo, cur_deadline_hi;
>              unsigned cur_budget_lo, cur_budget_hi;
>          } d;
> @@ -711,7 +711,7 @@ burn_budget(const struct scheduler *ops, struct rt_vcpu *svc, s_time_t now)
>      /* TRACE */
>      {
>          struct {
> -            unsigned dom:16, vcpu:16;
> +            unsigned vcpu:16, dom:16;
>              unsigned cur_budget_lo;
>              unsigned cur_budget_hi;
>              int delta;
> @@ -763,7 +763,7 @@ __runq_pick(const struct scheduler *ops, const cpumask_t *mask)
>          if( svc != NULL )
>          {
>              struct {
> -                unsigned dom:16, vcpu:16;
> +                unsigned vcpu:16, dom:16;
>                  unsigned cur_deadline_lo, cur_deadline_hi;
>                  unsigned cur_budget_lo, cur_budget_hi;
>              } d;
> @@ -777,8 +777,6 @@ __runq_pick(const struct scheduler *ops, const cpumask_t *mask)
>                        sizeof(d),
>                        (unsigned char *) &d);
>          }
> -        else
> -            trace_var(TRC_RTDS_RUNQ_PICK, 1, 0, NULL);
>      }
>  
>      return svc;
> @@ -845,6 +843,7 @@ rt_schedule(const struct scheduler *ops, s_time_t now, bool_t tasklet_work_sched
>  
>      if ( tasklet_work_scheduled )
>      {
> +        trace_var(TRC_RTDS_SCHED_TASKLET, 1, 0,  NULL);
>          snext = rt_vcpu(idle_vcpu[cpu]);
>      }
>      else
> @@ -885,24 +884,6 @@ rt_schedule(const struct scheduler *ops, s_time_t now, bool_t tasklet_work_sched
>      ret.time = MIN(snext->budget, MAX_SCHEDULE); /* sched quantum */
>      ret.task = snext->vcpu;
>  
> -    /* TRACE */
> -    {
> -        struct {
> -            unsigned dom:16,vcpu:16;
> -            unsigned cur_deadline_lo, cur_deadline_hi;
> -            unsigned cur_budget_lo, cur_budget_hi;
> -        } d;
> -        d.dom = snext->vcpu->domain->domain_id;
> -        d.vcpu = snext->vcpu->vcpu_id;
> -        d.cur_deadline_lo = (unsigned) snext->cur_deadline;
> -        d.cur_deadline_hi = (unsigned) (snext->cur_deadline >> 32);
> -        d.cur_budget_lo = (unsigned) snext->cur_budget;
> -        d.cur_budget_hi = (unsigned) (snext->cur_budget >> 32);
> -        trace_var(TRC_RTDS_SCHED_TASKLET, 1,
> -                  sizeof(d),
> -                  (unsigned char *)&d);
> -    }
> -
>      return ret;
>  }
>  
> 

^ permalink raw reply	[flat|nested] 51+ messages in thread

* Re: [PATCH v2 06/16] xen: sched: tracing: enable TSC tracing for all events
  2016-02-17  9:52     ` Dario Faggioli
  2016-02-17 15:26       ` Meng Xu
@ 2016-02-18 11:43       ` George Dunlap
  2016-02-18 16:52         ` Dario Faggioli
  1 sibling, 1 reply; 51+ messages in thread
From: George Dunlap @ 2016-02-18 11:43 UTC (permalink / raw)
  To: Dario Faggioli, Meng Xu; +Cc: xen-devel, Olaf Hering, Tianyang Chen

On 17/02/16 09:52, Dario Faggioli wrote:
> On Tue, 2016-02-16 at 13:21 -0500, Meng Xu wrote:
>> Hi Dario,
>>
>> Since this patch did some obvious change, I will reply with
>> reviewed-by, although my reviewed-by does not count much. ;-)
>>
> That can't be less true. First of all, you're the original author of
> this code, and you and, although I'm the maintainer, your group are the
> one doing active development on it, so your opinion does have a weight.
> 
> But even if that wasn't the case, every reviewed-by is important, and
> helps the project. It will be maintainers' and committer's job to
> properly take each one into account in the most appropriate way, but
> that does not mean it's not worthwhile for you (or anyone else) to
> review the patches and express your acknowledgment, or send in your
> comments. :-)
> 
> Actually, do feel free to do as much review (and, in case it applies,
> send in your reviewed-by tag) as you like and can, either on RTDS or
> anywhere else... The project is in great need of that!!
> 
>> On Tue, Feb 16, 2016 at 1:11 PM, Dario Faggioli
>> <dario.faggioli@citrix.com> wrote:
>>>  
>>> Note that this was not really a problem if looking
>>> at the traces with xenalyze, but it was if using
>>> xentrace_format.
>>
>> I just have a quick (and perhaps naive) question: :-)
>> If xenanlyze works better than xentrace_format, why shouldn't we
>> stick
>> to xenanlyze?
>> Is there some functionality xentrace_format can but xenalyze cannot?
>>
>> (I have to confess that I only used xenalyze but didn't use
>> xentrace_format before. :-()
>>
> xenalyze is indeed more advanced, but I don't think this means we
> should ignore or neglect xentrace_format: we've got it in tree, so we
> should not let it bitrot. I'm not in all our users' heads, so I don't
> know whether --and if yes why-- people may prefer the latter over the
> former, but I see room for someone wanting something basic and simple,
> in some cases.
> 
> Actually, I've been in a couple of situations myself, where the raw
> output of xentrace_format is easier to consume and, quick-&-dirtily,
> post-process, than the much more elaborated one of xenalyze.
> 
> For instance, the thing that you can just change on the fly the way a
> trace is shown (by tweaking the format file) looks an interesting
> feature to me, even considering all the limitations of "pure" xentrace.
> And if one want to change the formats for her own purposes, I feel like
> it is important that the one that we ship is updated, and can be used
> as a decent base for that.

So I certainly agree that xentrace_formats should be maintained so that
it works.  I hadn't thought before about the advantage of being able to
change the formats file more easily than adding new records to xenalyze,
but that's a good point.

But I do want to ask, how neccessary / useful is it to make the *TSC*
information available to xentrace_format?

The reason most of the traces don't include a timestamp is that it
increases the record size by a non-negligible amount -- in all the cases
here the traces are 1, 2, or 3 bytes without the tsc, so you're
basically doubling the size of what gets traced.

How does adding the TSC significantly help someone using xentrace_format?

 -George

^ permalink raw reply	[flat|nested] 51+ messages in thread

* Re: [PATCH v2 07/16] xentrace: formats: update format of scheduling events
  2016-02-16 18:12 ` [PATCH v2 07/16] xentrace: formats: update format of scheduling events Dario Faggioli
@ 2016-02-18 12:28   ` George Dunlap
  0 siblings, 0 replies; 51+ messages in thread
From: George Dunlap @ 2016-02-18 12:28 UTC (permalink / raw)
  To: Dario Faggioli, xen-devel
  Cc: Olaf Hering, Wei Liu, Ian Campbell, George Dunlap, Ian Jackson

On 16/02/16 18:12, Dario Faggioli wrote:
> to include the vcpu IDs, in a way that matches
> how the "dom:vcpu" couple is displayed in other
> events (runstate changes).
> 
> Also add the trace for TRC_SCHED_SHUTDOWN_CODE which
> was missing and was done via SCHEDOP_shutdown_code hypercall.
> (TRC_SCHED_SHUTDOWN trace was present).
> 
> Signed-off-by: Dario Faggioli <dario.faggioli@citrix.com>
> Reviewed-by: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>

I haven't reviewed the formats file changes, but all of them look
reasonable; so for patches 7-11:

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:
>  * enhanced changelog, as suggested during review.
> ---
>  tools/xentrace/formats |   18 +++++++++---------
>  1 file changed, 9 insertions(+), 9 deletions(-)
> 
> diff --git a/tools/xentrace/formats b/tools/xentrace/formats
> index 5d7b72a..5257cf0 100644
> --- a/tools/xentrace/formats
> +++ b/tools/xentrace/formats
> @@ -19,22 +19,22 @@
>  0x00021311  CPU%(cpu)d  %(tsc)d (+%(reltsc)8d)  offline_to_runnable [ dom:vcpu = 0x%(1)08x ]
>  0x00021321  CPU%(cpu)d  %(tsc)d (+%(reltsc)8d)  offline_to_blocked  [ dom:vcpu = 0x%(1)08x ]
>  
> -0x00028001  CPU%(cpu)d  %(tsc)d (+%(reltsc)8d)  sched_add_domain  [ domid = 0x%(1)08x, edomid = 0x%(2)08x ]
> -0x00028002  CPU%(cpu)d  %(tsc)d (+%(reltsc)8d)  sched_rem_domain  [ domid = 0x%(1)08x, edomid = 0x%(2)08x ]
> -0x00028003  CPU%(cpu)d  %(tsc)d (+%(reltsc)8d)  domain_sleep      [ domid = 0x%(1)08x, edomid = 0x%(2)08x ]
> -0x00028004  CPU%(cpu)d  %(tsc)d (+%(reltsc)8d)  domain_wake       [ domid = 0x%(1)08x, edomid = 0x%(2)08x ]
> -0x00028005  CPU%(cpu)d  %(tsc)d (+%(reltsc)8d)  do_yield          [ domid = 0x%(1)08x, edomid = 0x%(2)08x ]
> -0x00028006  CPU%(cpu)d  %(tsc)d (+%(reltsc)8d)  do_block          [ domid = 0x%(1)08x, edomid = 0x%(2)08x ]
> -0x00022006  CPU%(cpu)d  %(tsc)d (+%(reltsc)8d)  do_block          [ dom:vcpu = 0x%(1)08x, domid = 0x%(2)08x ]
> -0x00028007  CPU%(cpu)d  %(tsc)d (+%(reltsc)8d)  domain_shutdown	  [ domid = 0x%(1)08x, edomid = 0x%(2)08x, reason = 0x%(3)08x ]
> +0x00028001  CPU%(cpu)d  %(tsc)d (+%(reltsc)8d)  sched_add_domain  [ domid = 0x%(1)08x ]
> +0x00028002  CPU%(cpu)d  %(tsc)d (+%(reltsc)8d)  sched_rem_domain  [ domid = 0x%(1)08x ]
> +0x00028003  CPU%(cpu)d  %(tsc)d (+%(reltsc)8d)  domain_sleep      [ dom:vcpu = 0x%(1)04x%(2)04x ]
> +0x00028004  CPU%(cpu)d  %(tsc)d (+%(reltsc)8d)  domain_wake       [ dom:vcpu = 0x%(1)04x%(2)04x ]
> +0x00028005  CPU%(cpu)d  %(tsc)d (+%(reltsc)8d)  do_yield          [ dom:vcpu = 0x%(1)04x%(2)04x ]
> +0x00028006  CPU%(cpu)d  %(tsc)d (+%(reltsc)8d)  do_block          [ dom:vcpu = 0x%(1)04x%(2)04x ]
> +0x00028007  CPU%(cpu)d  %(tsc)d (+%(reltsc)8d)  domain_shutdown	  [ dom:vcpu = 0x%(1)04x%(2)04x, reason = 0x%(3)08x ]
>  0x00028008  CPU%(cpu)d  %(tsc)d (+%(reltsc)8d)  sched_ctl
>  0x00028009  CPU%(cpu)d  %(tsc)d (+%(reltsc)8d)  sched_adjdom      [ domid = 0x%(1)08x ]
> -0x0002800a  CPU%(cpu)d  %(tsc)d (+%(reltsc)8d)  __enter_scheduler [ prev<domid:edomid> = 0x%(1)08x : 0x%(2)08x, next<domid:edomid> = 0x%(3)08x : 0x%(4)08x ]
> +0x0002800a  CPU%(cpu)d  %(tsc)d (+%(reltsc)8d)  __enter_scheduler [ prev<dom:vcpu> = 0x%(1)04x%(2)04x, next<dom:vcpu> = 0x%(3)04x%(4)04x ]
>  0x0002800b  CPU%(cpu)d  %(tsc)d (+%(reltsc)8d)  s_timer_fn
>  0x0002800c  CPU%(cpu)d  %(tsc)d (+%(reltsc)8d)  t_timer_fn
>  0x0002800d  CPU%(cpu)d  %(tsc)d (+%(reltsc)8d)  dom_timer_fn
>  0x0002800e  CPU%(cpu)d  %(tsc)d (+%(reltsc)8d)  switch_infprev    [ old_domid = 0x%(1)08x, runtime = %(2)d ]
>  0x0002800f  CPU%(cpu)d  %(tsc)d (+%(reltsc)8d)  switch_infnext    [ new_domid = 0x%(1)08x, time = %(2)d, r_time = %(3)d ]
> +0x00028010  CPU%(cpu)d  %(tsc)d (+%(reltsc)8d)  domain_shutdown_code [ dom:vcpu = 0x%(1)04x%(2)04x, reason = 0x%(3)08x ]
>  
>  0x00081001  CPU%(cpu)d  %(tsc)d (+%(reltsc)8d)  VMENTRY
>  0x00081002  CPU%(cpu)d  %(tsc)d (+%(reltsc)8d)  VMEXIT      [ exitcode = 0x%(1)08x, rIP  = 0x%(2)08x ]
> 

^ permalink raw reply	[flat|nested] 51+ messages in thread

* Re: [PATCH v2 04/16] xen: credit2: pack trace data better for xentrace_format
  2016-02-18 11:10   ` George Dunlap
@ 2016-02-18 13:42     ` Dario Faggioli
  0 siblings, 0 replies; 51+ messages in thread
From: Dario Faggioli @ 2016-02-18 13:42 UTC (permalink / raw)
  To: George Dunlap, xen-devel; +Cc: Olaf Hering


[-- Attachment #1.1: Type: text/plain, Size: 1775 bytes --]

On Thu, 2016-02-18 at 11:10 +0000, George Dunlap wrote:
> 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 <dario.faggioli@citrix.com>
> > Reviewed-by: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>
> 
> 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.
> 
If I understand what you mean, I'm doing exactly that in the second
half of this series (and per the latest email, the xentrace_format
part, you've seen it already). :-)

> So, all is well:
> 
> Acked-by: George Dunlap <george.dunlap@citrix.com>
> 
Thanks,
Dario
-- 
<<This happens because I choose it to happen!>> (Raistlin Majere)
-----------------------------------------------------------------
Dario Faggioli, Ph.D, http://about.me/dario.faggioli
Senior Software Engineer, Citrix Systems R&D Ltd., Cambridge (UK)


[-- Attachment #1.2: This is a digitally signed message part --]
[-- Type: application/pgp-signature, Size: 181 bytes --]

[-- Attachment #2: Type: text/plain, Size: 126 bytes --]

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

^ permalink raw reply	[flat|nested] 51+ messages in thread

* Re: [PATCH v2 05/16] xen: RTDS: pack trace data better for xentrace_format
  2016-02-16 18:11 ` [PATCH v2 05/16] xen: RTDS: " Dario Faggioli
  2016-02-18 11:12   ` George Dunlap
@ 2016-02-18 14:43   ` Meng Xu
  1 sibling, 0 replies; 51+ messages in thread
From: Meng Xu @ 2016-02-18 14:43 UTC (permalink / raw)
  To: Dario Faggioli; +Cc: xen-devel, Olaf Hering, Tianyang Chen, George Dunlap

I'm sorry for replying late. Somehow, I forgot to reply this patch email. :-(

On Tue, Feb 16, 2016 at 1:11 PM, Dario Faggioli
<dario.faggioli@citrix.com> 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 RTDS 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.
>
> While there, we also:
>  - fix the use of TRC_RTDS_SCHED_TASKLET (it should
>    only be involved when a tasklet is scheduled, not
>    _every_ time rt_schedule() is invoked!);
>  - remove a very chatty and useless (nothing has been
>    picked!) use of TRC_RTDS_RUNQ_PICK.
>
> In fact, one can already figure out when nothing has been
> picked from the runqueue, by looking at when cpu_idle
> is invoked --which is the same thing one would do if on
> Credit or Credit2.
>
> Signed-off-by: Dario Faggioli <dario.faggioli@citrix.com>
> Reviewed-by: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>

Reviewed-by: Meng Xu <mengxu@cis.upenn.edu>

> ---
> Cc: George Dunlap <george.dunlap@citrix.com>
> Cc: Meng Xu <xumengpanda@gmail.com>
> Cc: Tianyang Chen <tiche@seas.upenn.edu>
> Cc: Olaf Hering <olaf@aepfle.de>
> ---
> Changes from v1:
>  * enhanced changelog, as suggested during review.
> ---
>  xen/common/sched_rt.c |   27 ++++-----------------------
>  1 file changed, 4 insertions(+), 23 deletions(-)
>
> diff --git a/xen/common/sched_rt.c b/xen/common/sched_rt.c
> index 2e5430f..53de6d6 100644
> --- a/xen/common/sched_rt.c
> +++ b/xen/common/sched_rt.c
> @@ -362,7 +362,7 @@ rt_update_deadline(s_time_t now, struct rt_vcpu *svc)
>      /* TRACE */
>      {
>          struct {
> -            unsigned dom:16,vcpu:16;
> +            unsigned vcpu:16, dom:16;
>              unsigned cur_deadline_lo, cur_deadline_hi;
>              unsigned cur_budget_lo, cur_budget_hi;
>          } d;
> @@ -711,7 +711,7 @@ burn_budget(const struct scheduler *ops, struct rt_vcpu *svc, s_time_t now)
>      /* TRACE */
>      {
>          struct {
> -            unsigned dom:16, vcpu:16;
> +            unsigned vcpu:16, dom:16;
>              unsigned cur_budget_lo;
>              unsigned cur_budget_hi;
>              int delta;
> @@ -763,7 +763,7 @@ __runq_pick(const struct scheduler *ops, const cpumask_t *mask)
>          if( svc != NULL )
>          {
>              struct {
> -                unsigned dom:16, vcpu:16;
> +                unsigned vcpu:16, dom:16;
>                  unsigned cur_deadline_lo, cur_deadline_hi;
>                  unsigned cur_budget_lo, cur_budget_hi;
>              } d;
> @@ -777,8 +777,6 @@ __runq_pick(const struct scheduler *ops, const cpumask_t *mask)
>                        sizeof(d),
>                        (unsigned char *) &d);
>          }
> -        else
> -            trace_var(TRC_RTDS_RUNQ_PICK, 1, 0, NULL);
>      }
>
>      return svc;
> @@ -845,6 +843,7 @@ rt_schedule(const struct scheduler *ops, s_time_t now, bool_t tasklet_work_sched
>
>      if ( tasklet_work_scheduled )
>      {
> +        trace_var(TRC_RTDS_SCHED_TASKLET, 1, 0,  NULL);
>          snext = rt_vcpu(idle_vcpu[cpu]);
>      }
>      else
> @@ -885,24 +884,6 @@ rt_schedule(const struct scheduler *ops, s_time_t now, bool_t tasklet_work_sched
>      ret.time = MIN(snext->budget, MAX_SCHEDULE); /* sched quantum */
>      ret.task = snext->vcpu;
>
> -    /* TRACE */
> -    {
> -        struct {
> -            unsigned dom:16,vcpu:16;
> -            unsigned cur_deadline_lo, cur_deadline_hi;
> -            unsigned cur_budget_lo, cur_budget_hi;
> -        } d;
> -        d.dom = snext->vcpu->domain->domain_id;
> -        d.vcpu = snext->vcpu->vcpu_id;
> -        d.cur_deadline_lo = (unsigned) snext->cur_deadline;
> -        d.cur_deadline_hi = (unsigned) (snext->cur_deadline >> 32);
> -        d.cur_budget_lo = (unsigned) snext->cur_budget;
> -        d.cur_budget_hi = (unsigned) (snext->cur_budget >> 32);
> -        trace_var(TRC_RTDS_SCHED_TASKLET, 1,
> -                  sizeof(d),
> -                  (unsigned char *)&d);
> -    }
> -
>      return ret;
>  }
>
>



-----------
Meng Xu
PhD Student in Computer and Information Science
University of Pennsylvania
http://www.cis.upenn.edu/~mengxu/

^ permalink raw reply	[flat|nested] 51+ messages in thread

* Re: [PATCH v2 14/16] xenalyze: handle Credit2 scheduler events
  2016-02-16 18:13 ` [PATCH v2 14/16] xenalyze: handle Credit2 " Dario Faggioli
@ 2016-02-18 15:17   ` George Dunlap
  0 siblings, 0 replies; 51+ messages in thread
From: George Dunlap @ 2016-02-18 15:17 UTC (permalink / raw)
  To: Dario Faggioli, xen-devel
  Cc: Olaf Hering, Wei Liu, Ian Campbell, George Dunlap, Ian Jackson

On 16/02/16 18:13, 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>
> Cc: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>
> ---
> Changes from v1:
>  * '} * r =' turned into '} *r =', as requested
>    during review.
> ---
>  tools/xentrace/xenalyze.c |  101 +++++++++++++++++++++++++++++++++++++++++++++
>  1 file changed, 101 insertions(+)
> 
> diff --git a/tools/xentrace/xenalyze.c b/tools/xentrace/xenalyze.c
> index 4ab2dba..8f97f3a 100644
> --- a/tools/xentrace/xenalyze.c
> +++ b/tools/xentrace/xenalyze.c
> @@ -7727,6 +7727,107 @@ void sched_process(struct pcpu_info *p)
>                         ri->dump_header, r->cpu);
>              }
>              break;
> +        /* CREDIT 2 (TRC_CSCHED2_xxx) */
> +        case TRC_SCHED_CLASS_EVT(CSCHED2, 1): /* TICK              */
> +        case TRC_SCHED_CLASS_EVT(CSCHED2, 4): /* CREDIT_ADD        */
> +        case TRC_SCHED_CLASS_EVT(CSCHED2, 9): /* UPDATE_LOAD       */
> +            break;
> +        case TRC_SCHED_CLASS_EVT(CSCHED2, 2): /* RUNQ_POS          */
> +            if(opt.dump_all) {
> +                struct {
> +                    unsigned int vcpuid:16, domid:16, pos;
> +                } *r = (typeof(r))ri->d;
> +
> +                printf(" %s csched2:runq_insert d%uv%u, position %u\n",
> +                       ri->dump_header, r->domid, r->vcpuid, r->pos);
> +            }
> +            break;
> +        case TRC_SCHED_CLASS_EVT(CSCHED2, 3): /* CREDIT_BURN       */
> +            if(opt.dump_all) {
> +                struct {
> +                    unsigned int vcpuid:16, domid:16, credit;
> +                    int delta;
> +                } *r = (typeof(r))ri->d;
> +
> +                printf(" %s csched2:burn_credits d%uv%u, credit = %u, delta = %d\n",
> +                       ri->dump_header, r->domid, r->vcpuid,
> +                       r->credit, r->delta);
> +            }
> +            break;
> +        case TRC_SCHED_CLASS_EVT(CSCHED2, 5): /* TICKLE_CHECK      */
> +            if(opt.dump_all) {
> +                struct {
> +                    unsigned int vcpuid:16, domid:16;
> +                    unsigned int credit;
> +                } *r = (typeof(r))ri->d;
> +
> +                printf(" %s csched2:tickle_check d%uv%u, credit = %u\n",
> +                       ri->dump_header, r->domid, r->vcpuid, r->credit);
> +            }
> +            break;
> +        case TRC_SCHED_CLASS_EVT(CSCHED2, 6): /* TICKLE            */
> +            if(opt.dump_all) {
> +                struct {
> +                    unsigned int cpu:16;
> +                } *r = (typeof(r))ri->d;
> +
> +                printf(" %s csched2:runq_tickle cpu %u\n",
> +                       ri->dump_header, r->cpu);
> +            }
> +            break;
> +        case TRC_SCHED_CLASS_EVT(CSCHED2, 7):  /* CREDIT_RESET     */
> +            if(opt.dump_all) {
> +                struct {
> +                    unsigned int vcpuid:16, domid:16;
> +                    unsigned 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",
> +                       ri->dump_header, r->domid, r->vcpuid,
> +                       r->credit_start, r->credit_end, r->multiplier);
> +            }
> +            break;
> +        case TRC_SCHED_CLASS_EVT(CSCHED2, 8):  /* SCHED_TASKLET    */
> +            if(opt.dump_all)
> +                printf(" %s csched2:sched_tasklet\n", ri->dump_header);
> +            break;
> +        case TRC_SCHED_CLASS_EVT(CSCHED2, 10): /* RUNQ_ASSIGN      */
> +            if(opt.dump_all) {
> +                struct {
> +                    unsigned int vcpuid:16, domid:16;
> +                    unsigned int rqi;
> +                } *r = (typeof(r))ri->d;
> +
> +                printf(" %s csched2:runq_assign d%uv%u on rq# %u\n",
> +                       ri->dump_header, r->domid, r->vcpuid, r->rqi);
> +            }
> +            break;
> +        case TRC_SCHED_CLASS_EVT(CSCHED2, 11): /* UPDATE_VCPU_LOAD */
> +            if(opt.dump_all) {
> +                struct {
> +                    unsigned int vcpuid:16, domid:16;
> +                    unsigned int avgload;
> +                } *r = (typeof(r))ri->d;
> +
> +                printf(" %s csched2:update_vcpu_load d%uv%u, avg_load = %u\n",
> +                       ri->dump_header, r->domid, r->vcpuid, r->avgload);
> +            }
> +            break;
> +        case TRC_SCHED_CLASS_EVT(CSCHED2, 12): /* UPDATE_RUNQ_LOAD */
> +            if(opt.dump_all) {
> +                struct {
> +                    unsigned int rq_load:4, rq_avgload:28;
> +                    unsigned int rq_id:4, b_avgload:28;
> +                } *r = (typeof(r))ri->d;
> +
> +                printf(" %s csched2:update_rq_load rq# %u, load = %u, "
> +                       "avgload = %u, b_avgload = %u\n",
> +                       ri->dump_header, r->rq_id, r->rq_load,
> +                       r->rq_avgload, r->b_avgload);
> +            }
> +            break;
>          default:
>              process_generic(ri);
>          }
> 

^ permalink raw reply	[flat|nested] 51+ messages in thread

* Re: [PATCH v2 12/16] xenalyze: handle scheduling events
  2016-02-16 18:12 ` [PATCH v2 12/16] xenalyze: handle scheduling events Dario Faggioli
@ 2016-02-18 15:18   ` George Dunlap
  0 siblings, 0 replies; 51+ messages in thread
From: George Dunlap @ 2016-02-18 15:18 UTC (permalink / raw)
  To: Dario Faggioli, xen-devel
  Cc: Olaf Hering, Wei Liu, Ian Campbell, George Dunlap, Ian Jackson

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:
>  * SCHED_DOM_{ADD,REM} handling slightly changed, to avoid
>    confusion with DOM0_DOM_{ADD,REM} (introduced later in
>    the series);
>  * '} * r =' turned into '} *r =', as requested
>    during review.
> ---
>  tools/xentrace/xenalyze.c |  156 ++++++++++++++++++++++++++++++++++++---------
>  1 file changed, 126 insertions(+), 30 deletions(-)
> 
> diff --git a/tools/xentrace/xenalyze.c b/tools/xentrace/xenalyze.c
> index 6520790..17021f1 100644
> --- a/tools/xentrace/xenalyze.c
> +++ b/tools/xentrace/xenalyze.c
> @@ -1519,27 +1519,6 @@ struct pv_data {
>  };
>  
>  /* Sched data */
> -
> -enum {
> -    SCHED_DOM_ADD=1,
> -    SCHED_DOM_REM,
> -    SCHED_SLEEP,
> -    SCHED_WAKE,
> -    SCHED_YIELD,
> -    SCHED_BLOCK,
> -    SCHED_SHUTDOWN,
> -    SCHED_CTL,
> -    SCHED_ADJDOM,
> -    SCHED_SWITCH,
> -    SCHED_S_TIMER_FN,
> -    SCHED_T_TIMER_FN,
> -    SCHED_DOM_TIMER_FN,
> -    SCHED_SWITCH_INFPREV,
> -    SCHED_SWITCH_INFNEXT,
> -    SCHED_SHUTDOWN_CODE,
> -    SCHED_MAX
> -};
> -
>  enum {
>      RUNSTATE_RUNNING=0,
>      RUNSTATE_RUNNABLE,
> @@ -7431,6 +7410,17 @@ no_update:
>      return;
>  }
>  
> +void dump_sched_switch(struct record_info *ri)
> +{
> +    struct {
> +        unsigned int prev_dom, prev_vcpu, next_dom, next_vcpu;
> +    } *r = (typeof(r))ri->d;
> +
> +    printf(" %s sched_switch prev d%uv%u next d%uv%u\n",
> +           ri->dump_header, r->prev_dom, r->prev_vcpu,
> +           r->next_dom, r->next_vcpu);
> +}
> +
>  void sched_switch_process(struct pcpu_info *p)
>  {
>      struct vcpu_data *prev, *next;
> @@ -7440,10 +7430,7 @@ void sched_switch_process(struct pcpu_info *p)
>      } * r = (typeof(r))ri->d;
>  
>      if(opt.dump_all)
> -        printf("%s sched_switch prev d%uv%u next d%uv%u\n",
> -               ri->dump_header,
> -               r->prev_dom, r->prev_vcpu,
> -               r->next_dom, r->next_vcpu);
> +        dump_sched_switch(ri);
>  
>      if(r->prev_vcpu > MAX_CPUS)
>      {
> @@ -7559,6 +7546,14 @@ void sched_summary_domain(struct domain_data *d)
>      }
>  }
>  
> +void dump_sched_vcpu_action(struct record_info *ri, const char *action)
> +{
> +    struct {
> +        unsigned int domid, vcpuid;
> +    } *r = (typeof(r))ri->d;
> +
> +    printf(" %s %s d%uv%u\n", ri->dump_header, action, r->domid, r->vcpuid);
> +}
>  
>  void sched_process(struct pcpu_info *p)
>  {
> @@ -7573,13 +7568,114 @@ void sched_process(struct pcpu_info *p)
>          default:
>              process_generic(&p->ri);
>          }
> -    } else {
> -        if(ri->evt.sub == 1)
> -            sched_runstate_process(p);
> -        else {
> -            UPDATE_VOLUME(p, sched_verbose, ri->size);
> +        return;
> +    }
> +
> +    if(ri->evt.sub == 1) {
> +        /* TRC_SCHED_MIN */
> +        sched_runstate_process(p);
> +    } else if (ri->evt.sub == 8) {
> +        /* TRC_SCHED_VERBOSE */
> +        switch(ri->event)
> +        {
> +        case TRC_SCHED_DOM_ADD:
> +            if(opt.dump_all) {
> +                struct {
> +                    unsigned int domid;
> +                } *r = (typeof(r))ri->d;
> +
> +                printf(" %s sched_init_domain d%u\n", ri->dump_header, r->domid);
> +            }
> +            break;
> +        case TRC_SCHED_DOM_REM:
> +            if(opt.dump_all) {
> +                struct {
> +                    unsigned int domid, vcpuid;
> +                } *r = (typeof(r))ri->d;
> +
> +                printf(" %s sched_destroy_domain d%u\n", ri->dump_header, r->domid);
> +            }
> +            break;
> +        case TRC_SCHED_SLEEP:
> +            if(opt.dump_all)
> +                dump_sched_vcpu_action(ri, "vcpu_sleep");
> +            break;
> +        case TRC_SCHED_WAKE:
> +            if(opt.dump_all)
> +                dump_sched_vcpu_action(ri, "vcpu_wake");
> +            break;
> +        case TRC_SCHED_YIELD:
> +            if(opt.dump_all)
> +                dump_sched_vcpu_action(ri, "vcpu_yield");
> +            break;
> +        case TRC_SCHED_BLOCK:
> +            if(opt.dump_all)
> +                dump_sched_vcpu_action(ri, "vcpu_block");
> +            break;
> +        case TRC_SCHED_SHUTDOWN:
> +        case TRC_SCHED_SHUTDOWN_CODE:
> +            if(opt.dump_all) {
> +                struct {
> +                    unsigned int domid, vcpuid, reason;
> +                } *r = (typeof(r))ri->d;
> +
> +                printf(" %s %s d%uv%u, reason = %u\n", ri->dump_header,
> +                       ri->event == TRC_SCHED_SHUTDOWN ? "sched_shutdown" :
> +                       "sched_shutdown_code", r->domid, r->vcpuid, r->reason);
> +            }
> +            break;
> +        case TRC_SCHED_ADJDOM:
> +            if(opt.dump_all) {
> +                struct {
> +                    unsigned int domid;
> +                } *r = (typeof(r))ri->d;
> +
> +                printf(" %s sched_adjust d%u\n", ri->dump_header, r->domid);
> +            }
> +            break;
> +        case TRC_SCHED_SWITCH:
> +            dump_sched_switch(ri);
> +            break;
> +        case TRC_SCHED_SWITCH_INFPREV:
> +            if(opt.dump_all) {
> +                struct {
> +                    unsigned int domid, runtime;
> +                } *r = (typeof(r))ri->d;
> +
> +                printf(" %s sched_switch prev d%u, run for %u.%uus\n",
> +                       ri->dump_header, r->domid, r->runtime / 1000,
> +                       r->runtime % 1000);
> +            }
> +            break;
> +        case TRC_SCHED_SWITCH_INFNEXT:
> +            if(opt.dump_all)
> +            {
> +                struct {
> +                    unsigned int domid, rsince;
> +                    int slice;
> +                } *r = (typeof(r))ri->d;
> +
> +                printf(" %s sched_switch next d%u", ri->dump_header, r->domid);
> +                if ( r->rsince != 0 )
> +                    printf(", was runnable for %u.%uus, ", r->rsince / 1000,
> +                           r->rsince % 1000);
> +                if ( r->slice > 0 )
> +                    printf("next slice %u.%uus\n", r->slice / 1000,
> +                           r->slice % 1000);
> +                printf("\n");
> +            }
> +            break;
> +        case TRC_SCHED_CTL:
> +        case TRC_SCHED_S_TIMER_FN:
> +        case TRC_SCHED_T_TIMER_FN:
> +        case TRC_SCHED_DOM_TIMER_FN:
> +            break;
> +        default:
>              process_generic(&p->ri);
>          }
> +    } else {
> +        UPDATE_VOLUME(p, sched_verbose, ri->size);
> +        process_generic(&p->ri);
>      }
>  }
>  
> 

^ permalink raw reply	[flat|nested] 51+ messages in thread

* Re: [PATCH v2 13/16] xenalyze: handle Credit1 scheduler events
  2016-02-16 18:12 ` [PATCH v2 13/16] xenalyze: handle Credit1 scheduler events Dario Faggioli
@ 2016-02-18 15:28   ` George Dunlap
  2016-02-18 15:31   ` George Dunlap
  1 sibling, 0 replies; 51+ messages in thread
From: George Dunlap @ 2016-02-18 15:28 UTC (permalink / raw)
  To: Dario Faggioli, xen-devel
  Cc: Olaf Hering, Wei Liu, Ian Campbell, George Dunlap, Ian Jackson

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);
> 

^ permalink raw reply	[flat|nested] 51+ messages in thread

* Re: [PATCH v2 15/16] xenalyze: handle RTDS scheduler events
  2016-02-16 18:13 ` [PATCH v2 15/16] xenalyze: handle RTDS " Dario Faggioli
@ 2016-02-18 15:28   ` George Dunlap
  2016-02-18 17:02     ` Dario Faggioli
  0 siblings, 1 reply; 51+ messages in thread
From: George Dunlap @ 2016-02-18 15:28 UTC (permalink / raw)
  To: Dario Faggioli, xen-devel
  Cc: Olaf Hering, Wei Liu, Ian Campbell, George Dunlap, Tianyang Chen,
	Ian Jackson, Meng Xu

On 16/02/16 18:13, 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: Meng Xu <xumengpanda@gmail.com>
> Cc: Tianyang Chen <tiche@seas.upenn.edu>
> 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 |   59 +++++++++++++++++++++++++++++++++++++++++++++
>  1 file changed, 59 insertions(+)
> 
> diff --git a/tools/xentrace/xenalyze.c b/tools/xentrace/xenalyze.c
> index 8f97f3a..dd21229 100644
> --- a/tools/xentrace/xenalyze.c
> +++ b/tools/xentrace/xenalyze.c
> @@ -7828,6 +7828,65 @@ void sched_process(struct pcpu_info *p)
>                         r->rq_avgload, r->b_avgload);
>              }
>              break;
> +        /* RTDS (TRC_RTDS_xxx) */
> +        case TRC_SCHED_CLASS_EVT(RTDS, 1): /* TICKLE           */
> +            if(opt.dump_all) {
> +                struct {
> +                    unsigned int cpu:16;
> +                } *r = (typeof(r))ri->d;
> +
> +                printf(" %s rtds:runq_tickle cpu %u\n",
> +                       ri->dump_header, r->cpu);
> +            }
> +            break;
> +        case TRC_SCHED_CLASS_EVT(RTDS, 2): /* RUNQ_PICK        */
> +            if(opt.dump_all) {
> +                struct {
> +                    unsigned int vcpuid:16, domid:16;
> +                    unsigned int cur_dl_lo, cur_dl_hi;
> +                    unsigned int cur_bg_lo, cur_bg_hi;
> +                } *r = (typeof(r))ri->d;
> +                uint64_t dl = (((uint64_t)r->cur_dl_hi) << 32) + r->cur_dl_lo;
> +                uint64_t bg = (((uint64_t)r->cur_bg_hi) << 32) + r->cur_bg_lo;

Why are you doing this, instead of just using uint64_t?

 -George

^ permalink raw reply	[flat|nested] 51+ messages in thread

* Re: [PATCH v2 13/16] xenalyze: handle Credit1 scheduler events
  2016-02-16 18:12 ` [PATCH v2 13/16] xenalyze: handle Credit1 scheduler events Dario Faggioli
  2016-02-18 15:28   ` George Dunlap
@ 2016-02-18 15:31   ` George Dunlap
  2016-02-18 16:58     ` Dario Faggioli
  1 sibling, 1 reply; 51+ messages in thread
From: George Dunlap @ 2016-02-18 15:31 UTC (permalink / raw)
  To: Dario Faggioli, xen-devel
  Cc: Olaf Hering, Wei Liu, Ian Campbell, George Dunlap, Ian Jackson

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);
> 

^ permalink raw reply	[flat|nested] 51+ messages in thread

* Re: [PATCH v2 06/16] xen: sched: tracing: enable TSC tracing for all events
  2016-02-18 11:43       ` George Dunlap
@ 2016-02-18 16:52         ` Dario Faggioli
  2016-02-22 11:02           ` George Dunlap
  0 siblings, 1 reply; 51+ messages in thread
From: Dario Faggioli @ 2016-02-18 16:52 UTC (permalink / raw)
  To: George Dunlap, Meng Xu; +Cc: xen-devel, Olaf Hering, Tianyang Chen


[-- Attachment #1.1: Type: text/plain, Size: 5226 bytes --]

On Thu, 2016-02-18 at 11:43 +0000, George Dunlap wrote:
> On 17/02/16 09:52, Dario Faggioli wrote:
> > 
> > For instance, the thing that you can just change on the fly the way
> > a
> > trace is shown (by tweaking the format file) looks an interesting
> > feature to me, even considering all the limitations of "pure"
> > xentrace.
> > And if one want to change the formats for her own purposes, I feel
> > like
> > it is important that the one that we ship is updated, and can be
> > used
> > as a decent base for that.
> 
> So I certainly agree that xentrace_formats should be maintained so
> that
> it works.  I hadn't thought before about the advantage of being able
> to
> change the formats file more easily than adding new records to
> xenalyze,
> but that's a good point.
> 
Yeah... To be fair, it's much more the exception than the rule, IMO,
that you really need xentrace_format instead of xenalyze... But it can
happen, and that's one possible reason.

> But I do want to ask, how neccessary / useful is it to make the *TSC*
> information available to xentrace_format?
> 
So, when tracing the scheduler, I personally don't see much value in
having the record of an event, if I don't also have the time at which
the event happened.

So, this is an example of xentrace_format with all this series applied,
except for this patch:

CPU0  2970034498098 (+ 9454788)  domain_wake       [ dom:vcpu = 0x00000001 ]
CPU0  2970034499304 (+    1206)  blocked_to_runnable [ dom:vcpu = 0x00000001 ]
CPU0  0 (+       0)  csched:tickle        [ cpu = 0 ]
CPU0  2970034511640 (+   12336)  switch_infprev    [ old_domid = 0x00007fff, runtime = 3956318 ]
CPU0  2970034512090 (+     450)  switch_infnext    [ new_domid = 0x00000000, time = 4446, r_time = 30000000 ]
CPU0  2970034512480 (+     390)  __enter_scheduler [ prev<dom:vcpu> = 0x7fff0000, next<dom:vcpu> = 0x00000001 ]
CPU0  2970034513002 (+     522)  running_to_runnable [ dom:vcpu = 0x7fff0000 ]
CPU0  2970034513422 (+     420)  runnable_to_running [ dom:vcpu = 0x00000001 ]

So, suppose, for instance, I want to figure out how much time passes
between when a pcpu is tickled, and when it actually schedules and pick
up the task that woke up. From just the trace above, I can't do that.

I know that this may not always be reliable when using only
xentrace_format (because of TSC not being synchronized or drifting),
but if used well (e.g., with pinning) or on good/new enough hardware
(with synch and constant rate TSCs), I think it should be possible.

On the other hand this is how a similar trace looks if TSC is enabled,
where the above can be achived:

CPU5  9965509909596 (+ 9268404)  domain_wake       [ dom:vcpu = 0x00000004 ]
CPU5  9965509911030 (+    1434)  blocked_to_runnable [ dom:vcpu = 0x00000004 ]
CPU5  9965509912962 (+    1932)  csched:tickle        [ cpu = 5 ]
CPU5  9965509924002 (+   11040)  switch_infprev    [ old_domid = 0x00007fff, runtime = 3879052 ]
CPU5  9965509924506 (+     504)  switch_infnext    [ new_domid = 0x00000000, time = 5000, r_time = 30000000 ]
CPU5  9965509924824 (+     318)  __enter_scheduler [ prev<dom:vcpu> = 0x7fff0005, next<dom:vcpu> = 0x00000004 ]
CPU5  9965509925478 (+     654)  running_to_runnable [ dom:vcpu = 0x7fff0005 ]
CPU5  9965509925892 (+     414)  runnable_to_running [ dom:vcpu = 0x00000004 ]

This is not an issue with xenalyze, and I think that is because you
fiddle with timestamps in it, in order to compensate for the per-
cpuness/desynch/etc. issues. I haven't checked the code where that
happens in xenalyze, though, so I don't know whether having the TSC in
more records would also help xenalyze or not.

> The reason most of the traces don't include a timestamp is that it
> increases the record size by a non-negligible amount -- in all the
> cases
> here the traces are 1, 2, or 3 bytes without the tsc, so you're
> basically doubling the size of what gets traced.
> 
I see, but I think it's worth in this case.

Perhaps, we can think of ways of enabling and disabling logging TSC
dynamically, either at compile or run time. Doing at run time, given
the way tracing is currently implemented, will most likely incur in
some overhead. Very small, but still something, and I'm not sure we're
ok introducing it.

Doing it at compile time would be a lot less flexible, but perhaps a
decent compromise, i.e., I at least always have the events... If I want
to know exactly when they happened, for all of them, I need a Xen
version build to provide that (like I need a debug build to have
ASSERT()s and symbols).

> How does adding the TSC significantly help someone using
> xentrace_format?
> 
Hope I answered to this. Let me know what you think. :-)

Regards,
Dario
-- 
<<This happens because I choose it to happen!>> (Raistlin Majere)
-----------------------------------------------------------------
Dario Faggioli, Ph.D, http://about.me/dario.faggioli
Senior Software Engineer, Citrix Systems R&D Ltd., Cambridge (UK)


[-- Attachment #1.2: This is a digitally signed message part --]
[-- Type: application/pgp-signature, Size: 181 bytes --]

[-- Attachment #2: Type: text/plain, Size: 126 bytes --]

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

^ permalink raw reply	[flat|nested] 51+ messages in thread

* Re: [PATCH v2 13/16] xenalyze: handle Credit1 scheduler events
  2016-02-18 15:31   ` George Dunlap
@ 2016-02-18 16:58     ` Dario Faggioli
  0 siblings, 0 replies; 51+ messages in thread
From: Dario Faggioli @ 2016-02-18 16:58 UTC (permalink / raw)
  To: George Dunlap, xen-devel
  Cc: Olaf Hering, Wei Liu, Ian Campbell, George Dunlap, Ian Jackson


[-- Attachment #1.1: Type: text/plain, Size: 1538 bytes --]

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
-- 
<<This happens because I choose it to happen!>> (Raistlin Majere)
-----------------------------------------------------------------
Dario Faggioli, Ph.D, http://about.me/dario.faggioli
Senior Software Engineer, Citrix Systems R&D Ltd., Cambridge (UK)


[-- Attachment #1.2: This is a digitally signed message part --]
[-- Type: application/pgp-signature, Size: 181 bytes --]

[-- Attachment #2: Type: text/plain, Size: 126 bytes --]

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

^ permalink raw reply	[flat|nested] 51+ messages in thread

* Re: [PATCH v2 15/16] xenalyze: handle RTDS scheduler events
  2016-02-18 15:28   ` George Dunlap
@ 2016-02-18 17:02     ` Dario Faggioli
  2016-02-18 17:06       ` George Dunlap
  0 siblings, 1 reply; 51+ messages in thread
From: Dario Faggioli @ 2016-02-18 17:02 UTC (permalink / raw)
  To: George Dunlap, xen-devel
  Cc: Olaf Hering, Wei Liu, Ian Campbell, George Dunlap, Tianyang Chen,
	Ian Jackson, Meng Xu


[-- Attachment #1.1: Type: text/plain, Size: 2577 bytes --]

On Thu, 2016-02-18 at 15:28 +0000, George Dunlap wrote:
> On 16/02/16 18:13, Dario Faggioli wrote:
> > ---
> >  tools/xentrace/xenalyze.c |   59
> > +++++++++++++++++++++++++++++++++++++++++++++
> >  1 file changed, 59 insertions(+)
> > 
> > diff --git a/tools/xentrace/xenalyze.c b/tools/xentrace/xenalyze.c
> > index 8f97f3a..dd21229 100644
> > --- a/tools/xentrace/xenalyze.c
> > +++ b/tools/xentrace/xenalyze.c
> > @@ -7828,6 +7828,65 @@ void sched_process(struct pcpu_info *p)
> >                         r->rq_avgload, r->b_avgload);
> >              }
> >              break;
> > +        /* RTDS (TRC_RTDS_xxx) */
> > +        case TRC_SCHED_CLASS_EVT(RTDS, 1): /* TICKLE           */
> > +            if(opt.dump_all) {
> > +                struct {
> > +                    unsigned int cpu:16;
> > +                } *r = (typeof(r))ri->d;
> > +
> > +                printf(" %s rtds:runq_tickle cpu %u\n",
> > +                       ri->dump_header, r->cpu);
> > +            }
> > +            break;
> > +        case TRC_SCHED_CLASS_EVT(RTDS, 2): /* RUNQ_PICK        */
> > +            if(opt.dump_all) {
> > +                struct {
> > +                    unsigned int vcpuid:16, domid:16;
> > +                    unsigned int cur_dl_lo, cur_dl_hi;
> > +                    unsigned int cur_bg_lo, cur_bg_hi;
> > +                } *r = (typeof(r))ri->d;
> > +                uint64_t dl = (((uint64_t)r->cur_dl_hi) << 32) +
> > r->cur_dl_lo;
> > +                uint64_t bg = (((uint64_t)r->cur_bg_hi) << 32) +
> > r->cur_bg_lo;
> 
> Why are you doing this, instead of just using uint64_t?
> 
It was to make the struct in sched_rt.c and here exactly match, for
ease of someone reading both the pieces of code at the same time, to
understand what's being printed.

However, yes, using uint64_t is probably equally understandable, and
more readable in case one only look at this code, so I can change this
(and resend).

Regards,
Dario

-- 
<<This happens because I choose it to happen!>> (Raistlin Majere)
-----------------------------------------------------------------
Dario Faggioli, Ph.D, http://about.me/dario.faggioli
Senior Software Engineer, Citrix Systems R&D Ltd., Cambridge (UK)


[-- Attachment #1.2: This is a digitally signed message part --]
[-- Type: application/pgp-signature, Size: 181 bytes --]

[-- Attachment #2: Type: text/plain, Size: 126 bytes --]

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

^ permalink raw reply	[flat|nested] 51+ messages in thread

* Re: [PATCH v2 15/16] xenalyze: handle RTDS scheduler events
  2016-02-18 17:02     ` Dario Faggioli
@ 2016-02-18 17:06       ` George Dunlap
  2016-02-18 17:10         ` Dario Faggioli
  0 siblings, 1 reply; 51+ messages in thread
From: George Dunlap @ 2016-02-18 17:06 UTC (permalink / raw)
  To: Dario Faggioli, xen-devel
  Cc: Olaf Hering, Wei Liu, Ian Campbell, George Dunlap, Tianyang Chen,
	Ian Jackson, Meng Xu

On 18/02/16 17:02, Dario Faggioli wrote:
> On Thu, 2016-02-18 at 15:28 +0000, George Dunlap wrote:
>> On 16/02/16 18:13, Dario Faggioli wrote:
>>> ---
>>>  tools/xentrace/xenalyze.c |   59
>>> +++++++++++++++++++++++++++++++++++++++++++++
>>>  1 file changed, 59 insertions(+)
>>>
>>> diff --git a/tools/xentrace/xenalyze.c b/tools/xentrace/xenalyze.c
>>> index 8f97f3a..dd21229 100644
>>> --- a/tools/xentrace/xenalyze.c
>>> +++ b/tools/xentrace/xenalyze.c
>>> @@ -7828,6 +7828,65 @@ void sched_process(struct pcpu_info *p)
>>>                         r->rq_avgload, r->b_avgload);
>>>              }
>>>              break;
>>> +        /* RTDS (TRC_RTDS_xxx) */
>>> +        case TRC_SCHED_CLASS_EVT(RTDS, 1): /* TICKLE           */
>>> +            if(opt.dump_all) {
>>> +                struct {
>>> +                    unsigned int cpu:16;
>>> +                } *r = (typeof(r))ri->d;
>>> +
>>> +                printf(" %s rtds:runq_tickle cpu %u\n",
>>> +                       ri->dump_header, r->cpu);
>>> +            }
>>> +            break;
>>> +        case TRC_SCHED_CLASS_EVT(RTDS, 2): /* RUNQ_PICK        */
>>> +            if(opt.dump_all) {
>>> +                struct {
>>> +                    unsigned int vcpuid:16, domid:16;
>>> +                    unsigned int cur_dl_lo, cur_dl_hi;
>>> +                    unsigned int cur_bg_lo, cur_bg_hi;
>>> +                } *r = (typeof(r))ri->d;
>>> +                uint64_t dl = (((uint64_t)r->cur_dl_hi) << 32) +
>>> r->cur_dl_lo;
>>> +                uint64_t bg = (((uint64_t)r->cur_bg_hi) << 32) +
>>> r->cur_bg_lo;
>>
>> Why are you doing this, instead of just using uint64_t?
>>
> It was to make the struct in sched_rt.c and here exactly match, for
> ease of someone reading both the pieces of code at the same time, to
> understand what's being printed.
> 
> However, yes, using uint64_t is probably equally understandable, and
> more readable in case one only look at this code, so I can change this
> (and resend).

Hrm, well perhaps having the struct match exactly is better.

I think most of these patches can be checked in now.  What about
checking in the other patches, then sending a follow-up series with the
struct changed in the scheduler, and then this patch with the resulting
changes?

 -George

^ permalink raw reply	[flat|nested] 51+ messages in thread

* Re: [PATCH v2 15/16] xenalyze: handle RTDS scheduler events
  2016-02-18 17:06       ` George Dunlap
@ 2016-02-18 17:10         ` Dario Faggioli
  0 siblings, 0 replies; 51+ messages in thread
From: Dario Faggioli @ 2016-02-18 17:10 UTC (permalink / raw)
  To: George Dunlap, xen-devel
  Cc: Olaf Hering, Wei Liu, Ian Campbell, George Dunlap, Tianyang Chen,
	Ian Jackson, Meng Xu


[-- Attachment #1.1: Type: text/plain, Size: 2018 bytes --]

On Thu, 2016-02-18 at 17:06 +0000, George Dunlap wrote:
> On 18/02/16 17:02, Dario Faggioli wrote:
> > On Thu, 2016-02-18 at 15:28 +0000, George Dunlap wrote:
> > > 
> > > > +        case TRC_SCHED_CLASS_EVT(RTDS, 2): /*
> > > > RUNQ_PICK        */
> > > > +            if(opt.dump_all) {
> > > > +                struct {
> > > > +                    unsigned int vcpuid:16, domid:16;
> > > > +                    unsigned int cur_dl_lo, cur_dl_hi;
> > > > +                    unsigned int cur_bg_lo, cur_bg_hi;
> > > > +                } *r = (typeof(r))ri->d;
> > > > +                uint64_t dl = (((uint64_t)r->cur_dl_hi) << 32)
> > > > +
> > > > r->cur_dl_lo;
> > > > +                uint64_t bg = (((uint64_t)r->cur_bg_hi) << 32)
> > > > +
> > > > r->cur_bg_lo;
> > > 
> > > Why are you doing this, instead of just using uint64_t?
> > > 
> > It was to make the struct in sched_rt.c and here exactly match, for
> > ease of someone reading both the pieces of code at the same time,
> > to
> > understand what's being printed.
> > 
> > However, yes, using uint64_t is probably equally understandable,
> > and
> > more readable in case one only look at this code, so I can change
> > this
> > (and resend).
> 
> Hrm, well perhaps having the struct match exactly is better.
> 
> I think most of these patches can be checked in now.  What about
> checking in the other patches, then sending a follow-up series with
> the
> struct changed in the scheduler, and then this patch with the
> resulting
> changes?
> 
This would work for me.

Regards,
Dario
-- 
<<This happens because I choose it to happen!>> (Raistlin Majere)
-----------------------------------------------------------------
Dario Faggioli, Ph.D, http://about.me/dario.faggioli
Senior Software Engineer, Citrix Systems R&D Ltd., Cambridge (UK)


[-- Attachment #1.2: This is a digitally signed message part --]
[-- Type: application/pgp-signature, Size: 181 bytes --]

[-- Attachment #2: Type: text/plain, Size: 126 bytes --]

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

^ permalink raw reply	[flat|nested] 51+ messages in thread

* Re: [PATCH v2 06/16] xen: sched: tracing: enable TSC tracing for all events
  2016-02-18 16:52         ` Dario Faggioli
@ 2016-02-22 11:02           ` George Dunlap
  0 siblings, 0 replies; 51+ messages in thread
From: George Dunlap @ 2016-02-22 11:02 UTC (permalink / raw)
  To: Dario Faggioli
  Cc: xen-devel, Olaf Hering, Tianyang Chen, Meng Xu, George Dunlap

On Thu, Feb 18, 2016 at 4:52 PM, Dario Faggioli
<dario.faggioli@citrix.com> wrote:
> On Thu, 2016-02-18 at 11:43 +0000, George Dunlap wrote:
>> On 17/02/16 09:52, Dario Faggioli wrote:
>> >
>> > For instance, the thing that you can just change on the fly the way
>> > a
>> > trace is shown (by tweaking the format file) looks an interesting
>> > feature to me, even considering all the limitations of "pure"
>> > xentrace.
>> > And if one want to change the formats for her own purposes, I feel
>> > like
>> > it is important that the one that we ship is updated, and can be
>> > used
>> > as a decent base for that.
>>
>> So I certainly agree that xentrace_formats should be maintained so
>> that
>> it works.  I hadn't thought before about the advantage of being able
>> to
>> change the formats file more easily than adding new records to
>> xenalyze,
>> but that's a good point.
>>
> Yeah... To be fair, it's much more the exception than the rule, IMO,
> that you really need xentrace_format instead of xenalyze... But it can
> happen, and that's one possible reason.
>
>> But I do want to ask, how neccessary / useful is it to make the *TSC*
>> information available to xentrace_format?
>>
> So, when tracing the scheduler, I personally don't see much value in
> having the record of an event, if I don't also have the time at which
> the event happened.
>
> So, this is an example of xentrace_format with all this series applied,
> except for this patch:
>
> CPU0  2970034498098 (+ 9454788)  domain_wake       [ dom:vcpu = 0x00000001 ]
> CPU0  2970034499304 (+    1206)  blocked_to_runnable [ dom:vcpu = 0x00000001 ]
> CPU0  0 (+       0)  csched:tickle        [ cpu = 0 ]
> CPU0  2970034511640 (+   12336)  switch_infprev    [ old_domid = 0x00007fff, runtime = 3956318 ]
> CPU0  2970034512090 (+     450)  switch_infnext    [ new_domid = 0x00000000, time = 4446, r_time = 30000000 ]
> CPU0  2970034512480 (+     390)  __enter_scheduler [ prev<dom:vcpu> = 0x7fff0000, next<dom:vcpu> = 0x00000001 ]
> CPU0  2970034513002 (+     522)  running_to_runnable [ dom:vcpu = 0x7fff0000 ]
> CPU0  2970034513422 (+     420)  runnable_to_running [ dom:vcpu = 0x00000001 ]
>
> So, suppose, for instance, I want to figure out how much time passes
> between when a pcpu is tickled, and when it actually schedules and pick
> up the task that woke up. From just the trace above, I can't do that.
>
> I know that this may not always be reliable when using only
> xentrace_format (because of TSC not being synchronized or drifting),
> but if used well (e.g., with pinning) or on good/new enough hardware
> (with synch and constant rate TSCs), I think it should be possible.
>
> On the other hand this is how a similar trace looks if TSC is enabled,
> where the above can be achived:
>
> CPU5  9965509909596 (+ 9268404)  domain_wake       [ dom:vcpu = 0x00000004 ]
> CPU5  9965509911030 (+    1434)  blocked_to_runnable [ dom:vcpu = 0x00000004 ]
> CPU5  9965509912962 (+    1932)  csched:tickle        [ cpu = 5 ]
> CPU5  9965509924002 (+   11040)  switch_infprev    [ old_domid = 0x00007fff, runtime = 3879052 ]
> CPU5  9965509924506 (+     504)  switch_infnext    [ new_domid = 0x00000000, time = 5000, r_time = 30000000 ]
> CPU5  9965509924824 (+     318)  __enter_scheduler [ prev<dom:vcpu> = 0x7fff0005, next<dom:vcpu> = 0x00000004 ]
> CPU5  9965509925478 (+     654)  running_to_runnable [ dom:vcpu = 0x7fff0005 ]
> CPU5  9965509925892 (+     414)  runnable_to_running [ dom:vcpu = 0x00000004 ]
>
> This is not an issue with xenalyze, and I think that is because you
> fiddle with timestamps in it, in order to compensate for the per-
> cpuness/desynch/etc. issues. I haven't checked the code where that
> happens in xenalyze, though, so I don't know whether having the TSC in
> more records would also help xenalyze or not.
>
>> The reason most of the traces don't include a timestamp is that it
>> increases the record size by a non-negligible amount -- in all the
>> cases
>> here the traces are 1, 2, or 3 bytes without the tsc, so you're
>> basically doubling the size of what gets traced.
>>
> I see, but I think it's worth in this case.
>
> Perhaps, we can think of ways of enabling and disabling logging TSC
> dynamically, either at compile or run time. Doing at run time, given
> the way tracing is currently implemented, will most likely incur in
> some overhead. Very small, but still something, and I'm not sure we're
> ok introducing it.
>
> Doing it at compile time would be a lot less flexible, but perhaps a
> decent compromise, i.e., I at least always have the events... If I want
> to know exactly when they happened, for all of them, I need a Xen
> version build to provide that (like I need a debug build to have
> ASSERT()s and symbols).
>
>> How does adding the TSC significantly help someone using
>> xentrace_format?
>>
> Hope I answered to this. Let me know what you think. :-)

The other thing to say in favor of this patch is: While we are
doubling the size of this small handful of traces, these will
constitute a much smaller percentage of the overall trace file,
particularly as (as you say in the changelog) a lot of the other
traces do already use tsc.

So I guess you've convinced me:

Acked-by: George Dunlap <george.dunlap@citrix.com>

^ permalink raw reply	[flat|nested] 51+ messages in thread

* Re: [PATCH v2 03/16] xen: sched: improve domain creation tracing
  2016-02-18 11:04   ` George Dunlap
@ 2016-02-24 11:21     ` Dario Faggioli
  2016-02-24 11:52       ` Jan Beulich
  0 siblings, 1 reply; 51+ messages in thread
From: Dario Faggioli @ 2016-02-24 11:21 UTC (permalink / raw)
  To: George Dunlap, xen-devel; +Cc: George Dunlap, Ian Campbell, Jan Beulich


[-- Attachment #1.1: Type: text/plain, Size: 1603 bytes --]

On Thu, 2016-02-18 at 11:04 +0000, George Dunlap wrote:
> On 16/02/16 18:11, Dario Faggioli wrote:
> > by doing the following two things:
> > 
> >  - move TRC_SCHED_DOM_{ADD,REM}, into the functions
> >    that do the actual scheduling-related domain
> >    initialization;
> > 
> >  - add two 'generic' DOM_{ADD,REM} events. They're
> >    made part of the TRC_DOM0 tracing class, as Dom0
> >    is, usually, from where domains are created and
> >    destroyed.
> > 
> > Signed-off-by: Dario Faggioli <dario.faggioli@citrix.com>
> 
> Reviewed-by: George Dunlap <george.dunlap@citrix.com>
> 
> Since this changes domain.c, I guess this would need an ack from "The
> Rest" -- probably either from Jan or Ian, since they're somewhat
> familiar with this code...?
> 
Ping (Ian, Jan)?

Also, George, I haven't seen any comment from you on patch 16 ("PATCH
v2 16/16] xenalyze: handle DOM0 operaions events",
<20160216181331.27876.31120.stgit@Solace.station> )... Is that because
you want to see others' opinion on this patch first?

As far as I can tell, these two patches (i.e., 03/16 and 16/16) is all
that is preventing this series to be checked in (with the exception of
patch 15, which I'll resend as part of another, follow-up, series, as
agreed with George).

Thanks and Regards,
Dario
-- 
<<This happens because I choose it to happen!>> (Raistlin Majere)
-----------------------------------------------------------------
Dario Faggioli, Ph.D, http://about.me/dario.faggioli
Senior Software Engineer, Citrix Systems R&D Ltd., Cambridge (UK)


[-- Attachment #1.2: This is a digitally signed message part --]
[-- Type: application/pgp-signature, Size: 181 bytes --]

[-- Attachment #2: Type: text/plain, Size: 126 bytes --]

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

^ permalink raw reply	[flat|nested] 51+ messages in thread

* Re: [PATCH v2 03/16] xen: sched: improve domain creation tracing
  2016-02-24 11:21     ` Dario Faggioli
@ 2016-02-24 11:52       ` Jan Beulich
  2016-02-24 13:20         ` Dario Faggioli
  0 siblings, 1 reply; 51+ messages in thread
From: Jan Beulich @ 2016-02-24 11:52 UTC (permalink / raw)
  To: Dario Faggioli; +Cc: George Dunlap, xen-devel, George Dunlap, Ian Campbell

>>> On 24.02.16 at 12:21, <dario.faggioli@citrix.com> wrote:
> On Thu, 2016-02-18 at 11:04 +0000, George Dunlap wrote:
>> On 16/02/16 18:11, Dario Faggioli wrote:
>> > by doing the following two things:
>> > 
>> >  - move TRC_SCHED_DOM_{ADD,REM}, into the functions
>> >    that do the actual scheduling-related domain
>> >    initialization;
>> > 
>> >  - add two 'generic' DOM_{ADD,REM} events. They're
>> >    made part of the TRC_DOM0 tracing class, as Dom0
>> >    is, usually, from where domains are created and
>> >    destroyed.
>> > 
>> > Signed-off-by: Dario Faggioli <dario.faggioli@citrix.com>
>> 
>> Reviewed-by: George Dunlap <george.dunlap@citrix.com>
>> 
>> Since this changes domain.c, I guess this would need an ack from "The
>> Rest" -- probably either from Jan or Ian, since they're somewhat
>> familiar with this code...?
>> 
> Ping (Ian, Jan)?

This has even passed the push gate already.

Jan

^ permalink raw reply	[flat|nested] 51+ messages in thread

* Re: [PATCH v2 03/16] xen: sched: improve domain creation tracing
  2016-02-24 11:52       ` Jan Beulich
@ 2016-02-24 13:20         ` Dario Faggioli
  0 siblings, 0 replies; 51+ messages in thread
From: Dario Faggioli @ 2016-02-24 13:20 UTC (permalink / raw)
  To: Jan Beulich; +Cc: George Dunlap, xen-devel, George Dunlap, Ian Campbell


[-- Attachment #1.1: Type: text/plain, Size: 2109 bytes --]

On Wed, 2016-02-24 at 04:52 -0700, Jan Beulich wrote:
> > > > On 24.02.16 at 12:21, <dario.faggioli@citrix.com> wrote:
> > On Thu, 2016-02-18 at 11:04 +0000, George Dunlap wrote:
> > > On 16/02/16 18:11, Dario Faggioli wrote:
> > > > by doing the following two things:
> > > > 
> > > >  - move TRC_SCHED_DOM_{ADD,REM}, into the functions
> > > >    that do the actual scheduling-related domain
> > > >    initialization;
> > > > 
> > > >  - add two 'generic' DOM_{ADD,REM} events. They're
> > > >    made part of the TRC_DOM0 tracing class, as Dom0
> > > >    is, usually, from where domains are created and
> > > >    destroyed.
> > > > 
> > > > Signed-off-by: Dario Faggioli <dario.faggioli@citrix.com>
> > > 
> > > Reviewed-by: George Dunlap <george.dunlap@citrix.com>
> > > 
> > > Since this changes domain.c, I guess this would need an ack from
> > > "The
> > > Rest" -- probably either from Jan or Ian, since they're somewhat
> > > familiar with this code...?
> > > 
> > Ping (Ian, Jan)?
> 
> This has even passed the push gate already.
> 
Ah, good to hear that! :-)

I see it now:

commit 7d42c7615045e75b9231a309ec452d7543099773
Author: Dario Faggioli <dario.faggioli@citrix.com>
Date:   Thu Feb 18 15:03:34 2016 +0100
....
....
Signed-off-by: Dario Faggioli <dario.faggioli@citrix.com>
Reviewed-by: George Dunlap <george.dunlap@citrix.com>
Acked-by: Jan Beulich <jbeulich@suse.com>

So, it looks like you've acked it and, I presume, checked it in.

My bad not double checking if it was in... I just didn't think that
could be the case, as I thought an answer to George's suggestion of an
Ack would hit the mailing list, if only for the sake of
archives/history (unless I've also missed such email! :-P).

In any case, sorry for the noise.

Thanks and Regards,
Dario
-- 
<<This happens because I choose it to happen!>> (Raistlin Majere)
-----------------------------------------------------------------
Dario Faggioli, Ph.D, http://about.me/dario.faggioli
Senior Software Engineer, Citrix Systems R&D Ltd., Cambridge (UK)


[-- Attachment #1.2: This is a digitally signed message part --]
[-- Type: application/pgp-signature, Size: 181 bytes --]

[-- Attachment #2: Type: text/plain, Size: 126 bytes --]

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

^ permalink raw reply	[flat|nested] 51+ messages in thread

* Re: [PATCH v2 00/16] Scheduling related tracing improvements
  2016-02-16 18:11 [PATCH v2 00/16] Scheduling related tracing improvements Dario Faggioli
                   ` (15 preceding siblings ...)
  2016-02-16 18:13 ` [PATCH v2 16/16] xenalyze: handle DOM0 operaions events Dario Faggioli
@ 2016-03-04 18:25 ` Dario Faggioli
  2016-03-04 19:52   ` Konrad Rzeszutek Wilk
  2016-03-07 10:50   ` Jan Beulich
  16 siblings, 2 replies; 51+ messages in thread
From: Dario Faggioli @ 2016-03-04 18:25 UTC (permalink / raw)
  To: xen-devel, Konrad Rzeszutek Wilk, Jan Beulich, George Dunlap
  Cc: Ian Jackson, Tianyang Chen, Wei Liu, Meng Xu


[-- Attachment #1.1: Type: text/plain, Size: 2999 bytes --]

Hello committers, George,

This is basically a ping for this series, as I think most of it can
actually go in, unless I've missed something.

So, let me try to recap:

On Tue, 2016-02-16 at 19:11 +0100, Dario Faggioli wrote:
> 
> Dario Faggioli (16):
>       xen: sched: __runq_tickle takes a useless cpu parameter
>       xen: sched: move up the trace record for vcpu_wake and
> vcpu_sleep
>       xen: sched: improve domain creation tracing
>       xen: credit2: pack trace data better for xentrace_format
>       xen: RTDS: pack trace data better for xentrace_format
>       xen: sched: tracing: enable TSC tracing for all events
>
Until here, it's in already.

>       xentrace: formats: update format of scheduling events
>       xentrace: formats: add events from Credit scheduler
>       xentrace: formats: add events from Credit2 scheduler
>       xentrace: formats: add events from RTDS scheduler
>       xentrace: formats: add domain create and destroy events.
>
About these, they've got Konrad's Reviewed-by, and George said:

"I haven't reviewed the formats file changes, but all of them look
reasonable; so for patches 7-11:
Acked-by: George Dunlap <george.dunlap@citrix.com>"

>       xenalyze: handle scheduling events
>
Reviewed-by: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>
Acked-by: George Dunlap <george.dunlap@citrix.com>

>       xenalyze: handle Credit1 scheduler events
>
Reviewed-by: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>
Acked-by: George Dunlap <george.dunlap@citrix.com>

>       xenalyze: handle Credit2 scheduler events
>
Reviewed-by: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>
Acked-by: George Dunlap <george.dunlap@citrix.com>

>       xenalyze: handle RTDS scheduler events
>
This should be skipped. In fact, we agreed with George that the plan
would be:

"I think most of these patches can be checked in now.  What about
checking in the other patches, then sending a follow-up series with the
struct changed in the scheduler, and then this patch with the resulting
changes?"

So, just ignore this patch.

>       xenalyze: handle DOM0 operaions events
> 
This one is actually missing Georges's Ack.

I'd be fine with this being skipped as well, and I will resubmit as
separate patch, or as part of the followup series mentioned above.

Or George can Ack it, and it just can go in now.

But this is not a big deal.

What I would like, if possible, is for patches until 14 to be checked
in, so I can submit the follow up (together with other patches that I
have stacked on top of that).

Thanks and regards,
Dario
-- 
<<This happens because I choose it to happen!>> (Raistlin Majere)
-----------------------------------------------------------------
Dario Faggioli, Ph.D, http://about.me/dario.faggioli
Senior Software Engineer, Citrix Systems R&D Ltd., Cambridge (UK)


[-- Attachment #1.2: This is a digitally signed message part --]
[-- Type: application/pgp-signature, Size: 181 bytes --]

[-- Attachment #2: Type: text/plain, Size: 126 bytes --]

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

^ permalink raw reply	[flat|nested] 51+ messages in thread

* Re: [PATCH v2 00/16] Scheduling related tracing improvements
  2016-03-04 18:25 ` [PATCH v2 00/16] Scheduling related tracing improvements Dario Faggioli
@ 2016-03-04 19:52   ` Konrad Rzeszutek Wilk
  2016-03-07 10:50   ` Jan Beulich
  1 sibling, 0 replies; 51+ messages in thread
From: Konrad Rzeszutek Wilk @ 2016-03-04 19:52 UTC (permalink / raw)
  To: Dario Faggioli
  Cc: Wei Liu, Tianyang Chen, Ian Jackson, George Dunlap, Meng Xu,
	Jan Beulich, xen-devel

On Fri, Mar 04, 2016 at 07:25:30PM +0100, Dario Faggioli wrote:
> Hello committers, George,
> 
> This is basically a ping for this series, as I think most of it can
> actually go in, unless I've missed something.
> 
> So, let me try to recap:
> 
> On Tue, 2016-02-16 at 19:11 +0100, Dario Faggioli wrote:
> > 
> > Dario Faggioli (16):
> >       xen: sched: __runq_tickle takes a useless cpu parameter
> >       xen: sched: move up the trace record for vcpu_wake and
> > vcpu_sleep
> >       xen: sched: improve domain creation tracing
> >       xen: credit2: pack trace data better for xentrace_format
> >       xen: RTDS: pack trace data better for xentrace_format
> >       xen: sched: tracing: enable TSC tracing for all events
> >
> Until here, it's in already.
> 
> >       xentrace: formats: update format of scheduling events
> >       xentrace: formats: add events from Credit scheduler
> >       xentrace: formats: add events from Credit2 scheduler
> >       xentrace: formats: add events from RTDS scheduler
> >       xentrace: formats: add domain create and destroy events.
> >
> About these, they've got Konrad's Reviewed-by, and George said:
> 
> "I haven't reviewed the formats file changes, but all of them look
> reasonable; so for patches 7-11:
> Acked-by: George Dunlap <george.dunlap@citrix.com>"
> 
> >       xenalyze: handle scheduling events
> >
> Reviewed-by: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>
> Acked-by: George Dunlap <george.dunlap@citrix.com>
> 
> >       xenalyze: handle Credit1 scheduler events
> >
> Reviewed-by: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>
> Acked-by: George Dunlap <george.dunlap@citrix.com>
> 
> >       xenalyze: handle Credit2 scheduler events
> >
> Reviewed-by: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>
> Acked-by: George Dunlap <george.dunlap@citrix.com>
> 
> >       xenalyze: handle RTDS scheduler events
> >
> This should be skipped. In fact, we agreed with George that the plan
> would be:
> 
> "I think most of these patches can be checked in now.  What about
> checking in the other patches, then sending a follow-up series with the
> struct changed in the scheduler, and then this patch with the resulting
> changes?"
> 
> So, just ignore this patch.
> 
> >       xenalyze: handle DOM0 operaions events
> > 
> This one is actually missing Georges's Ack.
> 
> I'd be fine with this being skipped as well, and I will resubmit as
> separate patch, or as part of the followup series mentioned above.
> 
> Or George can Ack it, and it just can go in now.
> 
> But this is not a big deal.
> 
> What I would like, if possible, is for patches until 14 to be checked
> in, so I can submit the follow up (together with other patches that I
> have stacked on top of that).

Could you put them in a git tree please?

> 
> Thanks and regards,
> Dario
> -- 
> <<This happens because I choose it to happen!>> (Raistlin Majere)
> -----------------------------------------------------------------
> Dario Faggioli, Ph.D, http://about.me/dario.faggioli
> Senior Software Engineer, Citrix Systems R&D Ltd., Cambridge (UK)
> 



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

^ permalink raw reply	[flat|nested] 51+ messages in thread

* Re: [PATCH v2 00/16] Scheduling related tracing improvements
  2016-03-04 18:25 ` [PATCH v2 00/16] Scheduling related tracing improvements Dario Faggioli
  2016-03-04 19:52   ` Konrad Rzeszutek Wilk
@ 2016-03-07 10:50   ` Jan Beulich
  2016-03-07 10:54     ` Wei Liu
  1 sibling, 1 reply; 51+ messages in thread
From: Jan Beulich @ 2016-03-07 10:50 UTC (permalink / raw)
  To: Dario Faggioli
  Cc: Wei Liu, Tianyang Chen, IanJackson, George Dunlap, Meng Xu, xen-devel

>>> On 04.03.16 at 19:25, <dario.faggioli@citrix.com> wrote:
> Hello committers, George,
> 
> This is basically a ping for this series, as I think most of it can
> actually go in, unless I've missed something.
> 
> So, let me try to recap:
> 
> On Tue, 2016-02-16 at 19:11 +0100, Dario Faggioli wrote:
>> 
>> Dario Faggioli (16):
>>       xen: sched: __runq_tickle takes a useless cpu parameter
>>       xen: sched: move up the trace record for vcpu_wake and
>> vcpu_sleep
>>       xen: sched: improve domain creation tracing
>>       xen: credit2: pack trace data better for xentrace_format
>>       xen: RTDS: pack trace data better for xentrace_format
>>       xen: sched: tracing: enable TSC tracing for all events
>>
> Until here, it's in already.

And that's the part I could reasonably take care of. I generally avoid
committing larger chunks of tools/ stuff, with the expectation that
Ian would take deal with those.

Jan


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

^ permalink raw reply	[flat|nested] 51+ messages in thread

* Re: [PATCH v2 00/16] Scheduling related tracing improvements
  2016-03-07 10:50   ` Jan Beulich
@ 2016-03-07 10:54     ` Wei Liu
  2016-03-07 11:21       ` Jan Beulich
  0 siblings, 1 reply; 51+ messages in thread
From: Wei Liu @ 2016-03-07 10:54 UTC (permalink / raw)
  To: Jan Beulich
  Cc: Wei Liu, Dario Faggioli, Tianyang Chen, IanJackson,
	George Dunlap, Meng Xu, xen-devel

On Mon, Mar 07, 2016 at 03:50:20AM -0700, Jan Beulich wrote:
> >>> On 04.03.16 at 19:25, <dario.faggioli@citrix.com> wrote:
> > Hello committers, George,
> > 
> > This is basically a ping for this series, as I think most of it can
> > actually go in, unless I've missed something.
> > 
> > So, let me try to recap:
> > 
> > On Tue, 2016-02-16 at 19:11 +0100, Dario Faggioli wrote:
> >> 
> >> Dario Faggioli (16):
> >>       xen: sched: __runq_tickle takes a useless cpu parameter
> >>       xen: sched: move up the trace record for vcpu_wake and
> >> vcpu_sleep
> >>       xen: sched: improve domain creation tracing
> >>       xen: credit2: pack trace data better for xentrace_format
> >>       xen: RTDS: pack trace data better for xentrace_format
> >>       xen: sched: tracing: enable TSC tracing for all events
> >>
> > Until here, it's in already.
> 
> And that's the part I could reasonably take care of. I generally avoid
> committing larger chunks of tools/ stuff, with the expectation that
> Ian would take deal with those.
> 

Ian is away this week. To avoid having no tools stuff committed this
whole week, I can prepare a branch for you to pull if you think that's
OK.

Wei.

> Jan
> 

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

^ permalink raw reply	[flat|nested] 51+ messages in thread

* Re: [PATCH v2 00/16] Scheduling related tracing improvements
  2016-03-07 10:54     ` Wei Liu
@ 2016-03-07 11:21       ` Jan Beulich
  2016-03-07 11:27         ` Wei Liu
  0 siblings, 1 reply; 51+ messages in thread
From: Jan Beulich @ 2016-03-07 11:21 UTC (permalink / raw)
  To: Wei Liu
  Cc: Dario Faggioli, Tianyang Chen, IanJackson, George Dunlap,
	Meng Xu, xen-devel

>>> On 07.03.16 at 11:54, <wei.liu2@citrix.com> wrote:
> On Mon, Mar 07, 2016 at 03:50:20AM -0700, Jan Beulich wrote:
>> >>> On 04.03.16 at 19:25, <dario.faggioli@citrix.com> wrote:
>> > Hello committers, George,
>> > 
>> > This is basically a ping for this series, as I think most of it can
>> > actually go in, unless I've missed something.
>> > 
>> > So, let me try to recap:
>> > 
>> > On Tue, 2016-02-16 at 19:11 +0100, Dario Faggioli wrote:
>> >> 
>> >> Dario Faggioli (16):
>> >>       xen: sched: __runq_tickle takes a useless cpu parameter
>> >>       xen: sched: move up the trace record for vcpu_wake and
>> >> vcpu_sleep
>> >>       xen: sched: improve domain creation tracing
>> >>       xen: credit2: pack trace data better for xentrace_format
>> >>       xen: RTDS: pack trace data better for xentrace_format
>> >>       xen: sched: tracing: enable TSC tracing for all events
>> >>
>> > Until here, it's in already.
>> 
>> And that's the part I could reasonably take care of. I generally avoid
>> committing larger chunks of tools/ stuff, with the expectation that
>> Ian would take deal with those.
>> 
> 
> Ian is away this week. To avoid having no tools stuff committed this
> whole week, I can prepare a branch for you to pull if you think that's
> OK.

Well, if these were urgent I'd say yes. But I don't think they are,
so I'd leave it to either Konrad (who has basically asked for what
you offer) if he wants to deal with it, of wait for Ian's return.

Jan


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

^ permalink raw reply	[flat|nested] 51+ messages in thread

* Re: [PATCH v2 00/16] Scheduling related tracing improvements
  2016-03-07 11:21       ` Jan Beulich
@ 2016-03-07 11:27         ` Wei Liu
  2016-03-07 14:21           ` Dario Faggioli
  0 siblings, 1 reply; 51+ messages in thread
From: Wei Liu @ 2016-03-07 11:27 UTC (permalink / raw)
  To: Jan Beulich
  Cc: Wei Liu, Dario Faggioli, Tianyang Chen, IanJackson,
	George Dunlap, Meng Xu, xen-devel

On Mon, Mar 07, 2016 at 04:21:22AM -0700, Jan Beulich wrote:
> >>> On 07.03.16 at 11:54, <wei.liu2@citrix.com> wrote:
> > On Mon, Mar 07, 2016 at 03:50:20AM -0700, Jan Beulich wrote:
> >> >>> On 04.03.16 at 19:25, <dario.faggioli@citrix.com> wrote:
> >> > Hello committers, George,
> >> > 
> >> > This is basically a ping for this series, as I think most of it can
> >> > actually go in, unless I've missed something.
> >> > 
> >> > So, let me try to recap:
> >> > 
> >> > On Tue, 2016-02-16 at 19:11 +0100, Dario Faggioli wrote:
> >> >> 
> >> >> Dario Faggioli (16):
> >> >>       xen: sched: __runq_tickle takes a useless cpu parameter
> >> >>       xen: sched: move up the trace record for vcpu_wake and
> >> >> vcpu_sleep
> >> >>       xen: sched: improve domain creation tracing
> >> >>       xen: credit2: pack trace data better for xentrace_format
> >> >>       xen: RTDS: pack trace data better for xentrace_format
> >> >>       xen: sched: tracing: enable TSC tracing for all events
> >> >>
> >> > Until here, it's in already.
> >> 
> >> And that's the part I could reasonably take care of. I generally avoid
> >> committing larger chunks of tools/ stuff, with the expectation that
> >> Ian would take deal with those.
> >> 
> > 
> > Ian is away this week. To avoid having no tools stuff committed this
> > whole week, I can prepare a branch for you to pull if you think that's
> > OK.
> 
> Well, if these were urgent I'd say yes. But I don't think they are,
> so I'd leave it to either Konrad (who has basically asked for what
> you offer) if he wants to deal with it, of wait for Ian's return.
> 

It's not urgent, but I would like to avoid wasting any test cycle. No
matter how innocent a patch looks, there is always risk that it breaks
something.

Konrad, your call.

Wei.

> Jan
> 

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

^ permalink raw reply	[flat|nested] 51+ messages in thread

* Re: [PATCH v2 00/16] Scheduling related tracing improvements
  2016-03-07 11:27         ` Wei Liu
@ 2016-03-07 14:21           ` Dario Faggioli
  2016-03-07 15:36             ` Konrad Rzeszutek Wilk
  0 siblings, 1 reply; 51+ messages in thread
From: Dario Faggioli @ 2016-03-07 14:21 UTC (permalink / raw)
  To: Wei Liu, Konrad Rzeszutek Wilk
  Cc: Tianyang Chen, IanJackson, George Dunlap, Meng Xu, Jan Beulich,
	xen-devel


[-- Attachment #1.1: Type: text/plain, Size: 1166 bytes --]

On Mon, 2016-03-07 at 11:27 +0000, Wei Liu wrote:
> On Mon, Mar 07, 2016 at 04:21:22AM -0700, Jan Beulich wrote:
> > > > > On 07.03.16 at 11:54, <wei.liu2@citrix.com> wrote:
> > > 
> > Well, if these were urgent I'd say yes. But I don't think they are,
> > so I'd leave it to either Konrad (who has basically asked for what
> > you offer) if he wants to deal with it, of wait for Ian's return.
> > 
> It's not urgent, but I would like to avoid wasting any test cycle. No
> matter how innocent a patch looks, there is always risk that it
> breaks
> something.
> 
> Konrad, your call.
> 
In any case, and as far as these patches are concerned, here it is:

 git://xenbits.xen.org/people/dariof/xen.git  tracing/sched-events-improvements

 http://xenbits.xen.org/gitweb/?p=people/dariof/xen.git;a=shortlog;h=refs/heads/tracing/sched-events-improvements

Thanks and Regards,
Dario
-- 
<<This happens because I choose it to happen!>> (Raistlin Majere)
-----------------------------------------------------------------
Dario Faggioli, Ph.D, http://about.me/dario.faggioli
Senior Software Engineer, Citrix Systems R&D Ltd., Cambridge (UK)


[-- Attachment #1.2: This is a digitally signed message part --]
[-- Type: application/pgp-signature, Size: 181 bytes --]

[-- Attachment #2: Type: text/plain, Size: 126 bytes --]

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

^ permalink raw reply	[flat|nested] 51+ messages in thread

* Re: [PATCH v2 00/16] Scheduling related tracing improvements
  2016-03-07 14:21           ` Dario Faggioli
@ 2016-03-07 15:36             ` Konrad Rzeszutek Wilk
  0 siblings, 0 replies; 51+ messages in thread
From: Konrad Rzeszutek Wilk @ 2016-03-07 15:36 UTC (permalink / raw)
  To: Dario Faggioli
  Cc: Wei Liu, Tianyang Chen, IanJackson, George Dunlap, Meng Xu,
	Jan Beulich, xen-devel

On Mon, Mar 07, 2016 at 03:21:46PM +0100, Dario Faggioli wrote:
> On Mon, 2016-03-07 at 11:27 +0000, Wei Liu wrote:
> > On Mon, Mar 07, 2016 at 04:21:22AM -0700, Jan Beulich wrote:
> > > > > > On 07.03.16 at 11:54, <wei.liu2@citrix.com> wrote:
> > > > 
> > > Well, if these were urgent I'd say yes. But I don't think they are,
> > > so I'd leave it to either Konrad (who has basically asked for what
> > > you offer) if he wants to deal with it, of wait for Ian's return.
> > > 
> > It's not urgent, but I would like to avoid wasting any test cycle. No
> > matter how innocent a patch looks, there is always risk that it
> > breaks
> > something.
> > 
> > Konrad, your call.
> > 
> In any case, and as far as these patches are concerned, here it is:
> 
>  git://xenbits.xen.org/people/dariof/xen.git  tracing/sched-events-improvements
> 
>  http://xenbits.xen.org/gitweb/?p=people/dariof/xen.git;a=shortlog;h=refs/heads/tracing/sched-events-improvements

Let me put them in staging.
> 
> Thanks and Regards,
> Dario
> -- 
> <<This happens because I choose it to happen!>> (Raistlin Majere)
> -----------------------------------------------------------------
> Dario Faggioli, Ph.D, http://about.me/dario.faggioli
> Senior Software Engineer, Citrix Systems R&D Ltd., Cambridge (UK)
> 



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

^ permalink raw reply	[flat|nested] 51+ messages in thread

end of thread, other threads:[~2016-03-07 15:36 UTC | newest]

Thread overview: 51+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2016-02-16 18:11 [PATCH v2 00/16] Scheduling related tracing improvements Dario Faggioli
2016-02-16 18:11 ` [PATCH v2 01/16] xen: sched: __runq_tickle takes a useless cpu parameter Dario Faggioli
2016-02-18 10:33   ` George Dunlap
2016-02-16 18:11 ` [PATCH v2 02/16] xen: sched: move up the trace record for vcpu_wake and vcpu_sleep Dario Faggioli
2016-02-18 10:34   ` George Dunlap
2016-02-16 18:11 ` [PATCH v2 03/16] xen: sched: improve domain creation tracing Dario Faggioli
2016-02-18 11:04   ` George Dunlap
2016-02-24 11:21     ` Dario Faggioli
2016-02-24 11:52       ` Jan Beulich
2016-02-24 13:20         ` Dario Faggioli
2016-02-16 18:11 ` [PATCH v2 04/16] xen: credit2: pack trace data better for xentrace_format Dario Faggioli
2016-02-18 11:10   ` George Dunlap
2016-02-18 13:42     ` Dario Faggioli
2016-02-16 18:11 ` [PATCH v2 05/16] xen: RTDS: " Dario Faggioli
2016-02-18 11:12   ` George Dunlap
2016-02-18 14:43   ` Meng Xu
2016-02-16 18:11 ` [PATCH v2 06/16] xen: sched: tracing: enable TSC tracing for all events Dario Faggioli
2016-02-16 18:21   ` Meng Xu
2016-02-17  9:52     ` Dario Faggioli
2016-02-17 15:26       ` Meng Xu
2016-02-18 11:43       ` George Dunlap
2016-02-18 16:52         ` Dario Faggioli
2016-02-22 11:02           ` George Dunlap
2016-02-16 18:12 ` [PATCH v2 07/16] xentrace: formats: update format of scheduling events Dario Faggioli
2016-02-18 12:28   ` George Dunlap
2016-02-16 18:12 ` [PATCH v2 08/16] xentrace: formats: add events from Credit scheduler Dario Faggioli
2016-02-16 18:12 ` [PATCH v2 09/16] xentrace: formats: add events from Credit2 scheduler Dario Faggioli
2016-02-16 18:12 ` [PATCH v2 10/16] xentrace: formats: add events from RTDS scheduler Dario Faggioli
2016-02-16 18:12 ` [PATCH v2 11/16] xentrace: formats: add domain create and destroy events Dario Faggioli
2016-02-16 18:12 ` [PATCH v2 12/16] xenalyze: handle scheduling events Dario Faggioli
2016-02-18 15:18   ` George Dunlap
2016-02-16 18:12 ` [PATCH v2 13/16] xenalyze: handle Credit1 scheduler events Dario Faggioli
2016-02-18 15:28   ` George Dunlap
2016-02-18 15:31   ` George Dunlap
2016-02-18 16:58     ` Dario Faggioli
2016-02-16 18:13 ` [PATCH v2 14/16] xenalyze: handle Credit2 " Dario Faggioli
2016-02-18 15:17   ` George Dunlap
2016-02-16 18:13 ` [PATCH v2 15/16] xenalyze: handle RTDS " Dario Faggioli
2016-02-18 15:28   ` George Dunlap
2016-02-18 17:02     ` Dario Faggioli
2016-02-18 17:06       ` George Dunlap
2016-02-18 17:10         ` Dario Faggioli
2016-02-16 18:13 ` [PATCH v2 16/16] xenalyze: handle DOM0 operaions events Dario Faggioli
2016-03-04 18:25 ` [PATCH v2 00/16] Scheduling related tracing improvements Dario Faggioli
2016-03-04 19:52   ` Konrad Rzeszutek Wilk
2016-03-07 10:50   ` Jan Beulich
2016-03-07 10:54     ` Wei Liu
2016-03-07 11:21       ` Jan Beulich
2016-03-07 11:27         ` Wei Liu
2016-03-07 14:21           ` Dario Faggioli
2016-03-07 15:36             ` Konrad Rzeszutek Wilk

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.