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][XenMon]Hypervisor changes for XenMon

To: xen-devel <xen-devel@xxxxxxxxxxxxxxxxxxx>
Subject: [Xen-devel] [PATCH][XenMon]Hypervisor changes for XenMon
From: Rob Gardner <rob.gardner@xxxxxx>
Date: Fri, 11 Nov 2005 16:24:26 -0700
Delivery-date: Fri, 11 Nov 2005 23:24:36 +0000
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/cgi-bin/mailman/listinfo/xen-devel>, <mailto:xen-devel-request@lists.xensource.com?subject=subscribe>
List-unsubscribe: <http://lists.xensource.com/cgi-bin/mailman/listinfo/xen-devel>, <mailto:xen-devel-request@lists.xensource.com?subject=unsubscribe>
Sender: xen-devel-bounces@xxxxxxxxxxxxxxxxxxx
User-agent: Mozilla Thunderbird 1.0.2 (Windows/20050317)
This patch is only the small changes needed in the hypervisor to support XenMon. The user space tools will be sent out as another patch very shortly.

This has been tested on x86-32 and x86-64, and x86-32/smp.

Signed-off-by: Rob Gardner <rob.gardner@xxxxxx>

# HG changeset patch
# User rob.gardner@xxxxxx
# Node ID f8bdbd78249667b300a9b73a2c4b9e5909eaa9e7
# Parent  1444adb1c407d6030a2c294976991414b47487d5
Several new trace calls added to support XenMon.

diff -r 1444adb1c407 -r f8bdbd782496 xen/common/grant_table.c
--- a/xen/common/grant_table.c    Fri Nov 11 16:04:17 2005
+++ b/xen/common/grant_table.c    Fri Nov 11 23:13:49 2005
@@ -29,6 +29,7 @@
#include <xen/shadow.h>
#include <xen/mm.h>
#include <acm/acm_hooks.h>
+#include <xen/trace.h>

#if defined(CONFIG_X86_64)
#define GRANT_PTE_FLAGS (_PAGE_PRESENT|_PAGE_ACCESSED|_PAGE_DIRTY|_PAGE_USER)
@@ -379,6 +380,8 @@
        }
    }

+    TRACE_1D(TRC_MEM_PAGE_FLIP, dom);
+
    ld->grant_table->maptrack[handle].domid         = dom;
    ld->grant_table->maptrack[handle].ref_and_flags =
        (ref << MAPTRACK_REF_SHIFT) |
@@ -462,6 +465,8 @@
        (void)__put_user(GNTST_bad_domain, &uop->status);
        return GNTST_bad_domain;
    }
+
+    TRACE_1D(TRC_MEM_PAGE_FLIP, dom);

    act = &rd->grant_table->active[ref];
    sha = &rd->grant_table->shared[ref];
diff -r 1444adb1c407 -r f8bdbd782496 xen/common/schedule.c
--- a/xen/common/schedule.c    Fri Nov 11 16:04:17 2005
+++ b/xen/common/schedule.c    Fri Nov 11 23:13:49 2005
@@ -398,6 +398,9 @@

    prev->cpu_time += now - prev->lastschd;

+    TRACE_2D(TRC_SCHED_SWITCH_INFPREV,
+ prev->domain->domain_id, (unsigned long)(now - prev->lastschd));
+
    /* get policy-specific decision on scheduling... */
    next_slice = ops.do_schedule(now);

@@ -413,13 +416,31 @@
    if ( unlikely(prev == next) )
    {
        spin_unlock_irq(&schedule_data[cpu].schedule_lock);
+        TRACE_3D(TRC_SCHED_SWITCH_INFNEXT,
+                 next->domain->domain_id, 0, r_time);
        return continue_running(prev);
    }
+    else {
+        TRACE_3D(TRC_SCHED_SWITCH_INFNEXT,
+ next->domain->domain_id, (unsigned long)(now - next->wokenup), r_time);
+     }

    clear_bit(_VCPUF_running, &prev->vcpu_flags);
    set_bit(_VCPUF_running, &next->vcpu_flags);

    perfc_incrc(sched_ctx);
+
+    /*
+     * Logic of wokenup field in domain struct:
+     * Used by XenMon to calculate "waiting time", which is the time that a
+     * domain spends being "runnable", but not actually running. wokenup is
+ * set whenever a domain wakes from sleeping, and also whenever a domain
+     * *stops* running. Perhaps a better thing to call it for this purpose
+ * would be "time_when_domain_became_runnable". If wokenup is not set here
+     * when a domain stops running, then it will retain its stale value and
+     * ruin the calculation.
+     */
+    prev->wokenup = NOW();

#if defined(WAKE_HISTO)
    if ( !is_idle_task(next->domain) && next->wokenup )
diff -r 1444adb1c407 -r f8bdbd782496 xen/include/public/trace.h
--- a/xen/include/public/trace.h    Fri Nov 11 16:04:17 2005
+++ b/xen/include/public/trace.h    Fri Nov 11 23:13:49 2005
@@ -14,6 +14,7 @@
#define TRC_SCHED   0x0002f000    /* Xen Scheduler trace      */
#define TRC_DOM0OP  0x0004f000    /* Xen DOM0 operation trace */
#define TRC_VMX     0x0008f000    /* Xen VMX trace            */
+#define TRC_MEM     0x000af000    /* Xen memory trace         */
#define TRC_ALL     0xfffff000

/* Trace subclasses */
@@ -40,6 +41,13 @@
#define TRC_SCHED_S_TIMER_FN    (TRC_SCHED + 11)
#define TRC_SCHED_T_TIMER_FN    (TRC_SCHED + 12)
#define TRC_SCHED_DOM_TIMER_FN  (TRC_SCHED + 13)
+#define TRC_SCHED_BVT_INFO      (TRC_SCHED + 14)
+#define TRC_SCHED_SWITCH_INFPREV (TRC_SCHED + 15)
+#define TRC_SCHED_SWITCH_INFNEXT (TRC_SCHED + 16)
+
+#define TRC_DOM0OP_DOM0WORK     (TRC_DOM0OP + 1)
+
+#define TRC_MEM_PAGE_FLIP       (TRC_MEM + 1)

/* trace events per subclass */
#define TRC_VMX_VMEXIT          (TRC_VMXEXIT + 1)

# HG changeset patch
# User rob.gardner@xxxxxx
# Node ID f8bdbd78249667b300a9b73a2c4b9e5909eaa9e7
# Parent  1444adb1c407d6030a2c294976991414b47487d5
Several new trace calls added to support XenMon.

diff -r 1444adb1c407 -r f8bdbd782496 xen/common/grant_table.c
--- a/xen/common/grant_table.c  Fri Nov 11 16:04:17 2005
+++ b/xen/common/grant_table.c  Fri Nov 11 23:13:49 2005
@@ -29,6 +29,7 @@
 #include <xen/shadow.h>
 #include <xen/mm.h>
 #include <acm/acm_hooks.h>
+#include <xen/trace.h>
 
 #if defined(CONFIG_X86_64)
 #define GRANT_PTE_FLAGS (_PAGE_PRESENT|_PAGE_ACCESSED|_PAGE_DIRTY|_PAGE_USER)
@@ -379,6 +380,8 @@
         }
     }
 
+    TRACE_1D(TRC_MEM_PAGE_FLIP, dom);
+
     ld->grant_table->maptrack[handle].domid         = dom;
     ld->grant_table->maptrack[handle].ref_and_flags =
         (ref << MAPTRACK_REF_SHIFT) |
@@ -462,6 +465,8 @@
         (void)__put_user(GNTST_bad_domain, &uop->status);
         return GNTST_bad_domain;
     }
+
+    TRACE_1D(TRC_MEM_PAGE_FLIP, dom);
 
     act = &rd->grant_table->active[ref];
     sha = &rd->grant_table->shared[ref];
diff -r 1444adb1c407 -r f8bdbd782496 xen/common/schedule.c
--- a/xen/common/schedule.c     Fri Nov 11 16:04:17 2005
+++ b/xen/common/schedule.c     Fri Nov 11 23:13:49 2005
@@ -398,6 +398,9 @@
 
     prev->cpu_time += now - prev->lastschd;
 
+    TRACE_2D(TRC_SCHED_SWITCH_INFPREV,
+            prev->domain->domain_id, (unsigned long)(now - prev->lastschd));
+
     /* get policy-specific decision on scheduling... */
     next_slice = ops.do_schedule(now);
 
@@ -413,13 +416,31 @@
     if ( unlikely(prev == next) )
     {
         spin_unlock_irq(&schedule_data[cpu].schedule_lock);
+        TRACE_3D(TRC_SCHED_SWITCH_INFNEXT,
+                 next->domain->domain_id, 0, r_time);
         return continue_running(prev);
     }
+    else {
+        TRACE_3D(TRC_SCHED_SWITCH_INFNEXT,
+                 next->domain->domain_id, (unsigned long)(now - 
next->wokenup), r_time);
+     }
 
     clear_bit(_VCPUF_running, &prev->vcpu_flags);
     set_bit(_VCPUF_running, &next->vcpu_flags);
 
     perfc_incrc(sched_ctx);
+
+    /*
+     * Logic of wokenup field in domain struct:
+     * Used by XenMon to calculate "waiting time", which is the time that a
+     * domain spends being "runnable", but not actually running. wokenup is
+     * set whenever a domain wakes from sleeping, and also whenever a domain
+     * *stops* running. Perhaps a better thing to call it for this purpose
+     * would be "time_when_domain_became_runnable". If wokenup is not set here
+     * when a domain stops running, then it will retain its stale value and
+     * ruin the calculation.
+     */
+    prev->wokenup = NOW();
 
 #if defined(WAKE_HISTO)
     if ( !is_idle_task(next->domain) && next->wokenup )
diff -r 1444adb1c407 -r f8bdbd782496 xen/include/public/trace.h
--- a/xen/include/public/trace.h        Fri Nov 11 16:04:17 2005
+++ b/xen/include/public/trace.h        Fri Nov 11 23:13:49 2005
@@ -14,6 +14,7 @@
 #define TRC_SCHED   0x0002f000    /* Xen Scheduler trace      */
 #define TRC_DOM0OP  0x0004f000    /* Xen DOM0 operation trace */
 #define TRC_VMX     0x0008f000    /* Xen VMX trace            */
+#define TRC_MEM     0x000af000    /* Xen memory trace         */
 #define TRC_ALL     0xfffff000
 
 /* Trace subclasses */
@@ -40,6 +41,13 @@
 #define TRC_SCHED_S_TIMER_FN    (TRC_SCHED + 11)
 #define TRC_SCHED_T_TIMER_FN    (TRC_SCHED + 12)
 #define TRC_SCHED_DOM_TIMER_FN  (TRC_SCHED + 13)
+#define TRC_SCHED_BVT_INFO      (TRC_SCHED + 14)
+#define TRC_SCHED_SWITCH_INFPREV (TRC_SCHED + 15)
+#define TRC_SCHED_SWITCH_INFNEXT (TRC_SCHED + 16)
+
+#define TRC_DOM0OP_DOM0WORK     (TRC_DOM0OP + 1)
+
+#define TRC_MEM_PAGE_FLIP       (TRC_MEM + 1)
 
 /* trace events per subclass */
 #define TRC_VMX_VMEXIT          (TRC_VMXEXIT + 1)
_______________________________________________
Xen-devel mailing list
Xen-devel@xxxxxxxxxxxxxxxxxxx
http://lists.xensource.com/xen-devel
<Prev in Thread] Current Thread [Next in Thread>
  • [Xen-devel] [PATCH][XenMon]Hypervisor changes for XenMon, Rob Gardner <=