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

[Xen-changelog] [xen-unstable] xenoprof: flush remaining smples when sampling is stopped.



# HG changeset patch
# User Keir Fraser <keir.fraser@xxxxxxxxxx>
# Date 1197627900 0
# Node ID 8aa377fb1b1fe4e5f46a983b925073f3e9e6f619
# Parent  75b56d086b26ac01fb563dd9128995d544c15e6f
xenoprof: flush remaining smples when sampling is stopped.

Xenoprof notifies guest kernel via VIRQ_XENOPROF when sampled.
But it does coarsly based on heuristic so that sometimes VIRQ_XENOPROF
isn't delivered resulting in that oprofile daemon collects no sample.
To avoid that situation, always send VIRQ_XENOPROF when sampling is
stopped.

Signed-off-by: Isaku Yamahata <yamahata@xxxxxxxxxxxxx>
---
 xen/common/xenoprof.c |   17 +++++++++++++++++
 1 files changed, 17 insertions(+)

diff -r 75b56d086b26 -r 8aa377fb1b1f xen/common/xenoprof.c
--- a/xen/common/xenoprof.c     Fri Dec 14 10:22:08 2007 +0000
+++ b/xen/common/xenoprof.c     Fri Dec 14 10:25:00 2007 +0000
@@ -12,6 +12,7 @@
 #ifndef COMPAT
 #include <xen/guest_access.h>
 #include <xen/sched.h>
+#include <xen/event.h>
 #include <public/xenoprof.h>
 #include <xen/paging.h>
 #include <xsm/xsm.h>
@@ -747,14 +748,30 @@ int do_xenoprof_op(int op, XEN_GUEST_HAN
         break;
 
     case XENOPROF_stop:
+    {
+        struct domain *d;
+        struct vcpu *v;
+        int i;
+
         if ( xenoprof_state != XENOPROF_PROFILING )
         {
             ret = -EPERM;
             break;
         }
         xenoprof_arch_stop();
+
+        /* Flush remaining samples. */
+        for ( i = 0; i < adomains; i++ )
+        {
+            if ( !active_ready[i] )
+                continue;
+            d = active_domains[i];
+            for_each_vcpu(d, v)
+                send_guest_vcpu_virq(v, VIRQ_XENOPROF);
+        }
         xenoprof_state = XENOPROF_READY;
         break;
+    }
 
     case XENOPROF_disable_virq:
     {

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


 


Rackspace

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