WARNING - OLD ARCHIVES

This is an archived copy of the Xen.org mailing list, which we have preserved to ensure that existing links to archives are not broken. The live archive, which contains the latest emails, can be found at http://lists.xen.org/
   
 
 
Xen 
 
Home Products Support Community News
 
   
 

xen-devel

[Xen-devel] [PATCH] xenalyze: Break down "runnable" into "wake" and "pre

To: <xen-devel@xxxxxxxxxxxxxxxxxxx>
Subject: [Xen-devel] [PATCH] xenalyze: Break down "runnable" into "wake" and "preempt"
From: George Dunlap <george.dunlap@xxxxxxxxxxxxx>
Date: Wed, 1 Dec 2010 09:53:23 +0000
Cc: george.dunlap@xxxxxxxxxxxxx
Delivery-date: Wed, 01 Dec 2010 01:54:22 -0800
Envelope-to: www-data@xxxxxxxxxxxxxxxxxxx
List-help: <mailto:xen-devel-request@lists.xensource.com?subject=help>
List-id: Xen developer discussion <xen-devel.lists.xensource.com>
List-post: <mailto:xen-devel@lists.xensource.com>
List-subscribe: <http://lists.xensource.com/mailman/listinfo/xen-devel>, <mailto:xen-devel-request@lists.xensource.com?subject=subscribe>
List-unsubscribe: <http://lists.xensource.com/mailman/listinfo/xen-devel>, <mailto:xen-devel-request@lists.xensource.com?subject=unsubscribe>
Sender: xen-devel-bounces@xxxxxxxxxxxxxxxxxxx
User-agent: Mercurial-patchbomb/1.4.3
The "runnable" runstate can be reached either waiting for a cpu
when waking, or when preempted.  Keep track of these separate states
and report them under "runnable".

Signed-off-by: George Dunlap <george.dunlap@xxxxxxxxxxxxx>

diff -r 4e88187c91ba -r d8690ca24f39 xenalyze.c
--- a/xenalyze.c        Mon Nov 22 12:39:38 2010 +0000
+++ b/xenalyze.c        Wed Dec 01 09:52:58 2010 +0000
@@ -1520,6 +1520,21 @@
     [RUNSTATE_LOST]=    "lost",
 };
 
+enum {
+    RUNNABLE_STATE_INVALID,
+    RUNNABLE_STATE_WAKE,
+    RUNNABLE_STATE_PREEMPT,
+    RUNNABLE_STATE_OTHER,
+    RUNNABLE_STATE_MAX
+};
+
+char * runnable_state_name[RUNNABLE_STATE_MAX]={
+    [RUNNABLE_STATE_INVALID]="invalid", /* Should never show up */
+    [RUNNABLE_STATE_WAKE]="wake",
+    [RUNNABLE_STATE_PREEMPT]="preempt",
+    [RUNNABLE_STATE_OTHER]="other",
+};
+
 /* Memory data */
 enum {
     MEM_PAGE_GRANT_MAP = 1,
@@ -1596,6 +1611,7 @@
     /* Schedule info */
     struct {
         int state;
+        int runnable_state; /* Only valid when state==RUNSTATE_RUNNABLE */
         tsc_t tsc;
         /* TSC skew detection/correction */
         struct last_oldstate_struct {
@@ -1621,6 +1637,7 @@
     /* Summary info */
     struct cycle_framework f;
     struct cycle_summary runstates[RUNSTATE_MAX];
+    struct cycle_summary runnable_states[RUNNABLE_STATE_MAX];
     struct weighted_cpi_summary cpi;
     struct cycle_summary cpu_affinity_all,
         cpu_affinity_pcpu[MAX_CPUS];
@@ -4901,6 +4918,9 @@
         if(v->runstate.state == RUNSTATE_RUNNING)
             update_cycles(&v->d->total_time, tsc - v->runstate.tsc);
 
+        if(v->runstate.state == RUNSTATE_RUNNABLE)
+            update_cycles(v->runnable_states + v->runstate.runnable_state, tsc 
- v->runstate.tsc);
+
         /* How much did dom0 run this buffer? */
         if(v->d->did == 0) {
             int i;
@@ -4925,6 +4945,26 @@
             }
         }
     }
+
+    /* Detect "runnable" states */
+    if ( new_runstate == RUNSTATE_RUNNABLE )
+    {
+        switch(v->runstate.state)
+        {
+        case RUNSTATE_RUNNING:
+            v->runstate.runnable_state=RUNNABLE_STATE_PREEMPT;
+            break;
+        case RUNSTATE_BLOCKED:
+        case RUNSTATE_OFFLINE:
+            v->runstate.runnable_state=RUNNABLE_STATE_WAKE;
+            break;
+        default:
+            v->runstate.runnable_state=RUNNABLE_STATE_OTHER;
+            break;
+        }
+    } else
+        v->runstate.runnable_state=RUNNABLE_STATE_INVALID;
+
     v->runstate.state = new_runstate;
     v->runstate.tsc = tsc;
 
@@ -7257,6 +7297,16 @@
     for(i=0; i<RUNSTATE_MAX; i++) {
         snprintf(desc,30, "  %8s", runstate_name[i]); 
         print_cycle_summary(v->runstates+i, desc);
+        if ( i==RUNSTATE_RUNNABLE )
+        {
+            int j;
+            for(j=0; j<RUNNABLE_STATE_MAX; j++) {
+                if ( j == RUNNABLE_STATE_INVALID )
+                    continue;
+                snprintf(desc,30, "    %8s", runnable_state_name[j]); 
+                print_cycle_summary(v->runnable_states+j, desc);
+            }
+        }
     }
     print_cpi_summary(&v->cpi);
     print_cpu_affinity(&v->cpu_affinity_all, " cpu affinity");

_______________________________________________
Xen-devel mailing list
Xen-devel@xxxxxxxxxxxxxxxxxxx
http://lists.xensource.com/xen-devel

<Prev in Thread] Current Thread [Next in Thread>
  • [Xen-devel] [PATCH] xenalyze: Break down "runnable" into "wake" and "preempt", George Dunlap <=