xenoprof: Fix support for active domains
authorKeir Fraser <keir.fraser@citrix.com>
Wed, 16 Dec 2009 12:20:08 +0000 (12:20 +0000)
committerKeir Fraser <keir.fraser@citrix.com>
Wed, 16 Dec 2009 12:20:08 +0000 (12:20 +0000)
If a user tries to use opcontrol with option --active-domains in dom0
and then run opcontrol in a guest, no samples are generated. When the
guest calls the xenoprof interface it resets the internal Xenoprof
state machine and profiling does not start

Signed-off-by: Jose Renato Santos <jsantos@hpl.hp.com>
xen/common/xenoprof.c

index ec29e1a1a0092c20b4827245c686676ed14c0a5e..9390d8dc9b96bc1742263c74d85e97386faee488 100644 (file)
@@ -693,7 +693,8 @@ int do_xenoprof_op(int op, XEN_GUEST_HANDLE(void) arg)
     {
     case XENOPROF_init:
         ret = xenoprof_op_init(arg);
-        if ( !ret )
+        if ( (ret == 0) &&
+             (current->domain == xenoprof_primary_profiler) )
             xenoprof_state = XENOPROF_INITIALIZED;
         break;