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

[Xen-devel] [PATCH] add event channel information to domain dump



Given the existance of lsevtchn, perhaps this should be done only for
Dom0, where the information may be necessary but unavailable (i.e.
because the domain is hanging).

Signed-off-by: Jan Beulich <jbeulich@xxxxxxxxxx>

Index: 2008-09-19/xen/common/event_channel.c
===================================================================
--- 2008-09-19.orig/xen/common/event_channel.c  2008-09-08 12:57:38.000000000 
+0200
+++ 2008-09-19/xen/common/event_channel.c       2008-09-19 13:59:54.000000000 
+0200
@@ -1079,6 +1079,56 @@ void evtchn_destroy(struct domain *d)
     spin_unlock(&d->evtchn_lock);
 }
 
+void dump_evtchn_info(struct domain *d)
+{
+    unsigned int port;
+
+    printk("Domain %d polling vCPUs: %08lx\n", d->domain_id, d->poll_mask[0]);
+
+    if ( !spin_trylock(&d->evtchn_lock) )
+        return;
+
+    printk("Event channel information for domain %d:\n",
+           d->domain_id);
+
+    for ( port = 1; port < MAX_EVTCHNS(d); ++port )
+    {
+        const struct evtchn *chn;
+
+        if ( !port_is_valid(d, port) )
+            continue;
+        chn = evtchn_from_port(d, port);
+        if ( chn->state == ECS_FREE )
+            continue;
+
+        printk("    %4u[%d/%d]: s=%d n=%d",
+               port,
+               test_bit(port, &shared_info(d, evtchn_pending)),
+               test_bit(port, &shared_info(d, evtchn_mask)),
+               chn->state, chn->notify_vcpu_id);
+        switch ( chn->state )
+        {
+        case ECS_UNBOUND:
+            printk(" d=%d", chn->u.unbound.remote_domid);
+            break;
+        case ECS_INTERDOMAIN:
+            printk(" d=%d p=%d",
+                   chn->u.interdomain.remote_dom->domain_id,
+                   chn->u.interdomain.remote_port);
+            break;
+        case ECS_PIRQ:
+            printk(" p=%d", chn->u.pirq);
+            break;
+        case ECS_VIRQ:
+            printk(" v=%d", chn->u.virq);
+            break;
+        }
+        printk(" x=%d\n", chn->consumer_is_xen);
+    }
+
+    spin_unlock(&d->evtchn_lock);
+}
+
 /*
  * Local variables:
  * mode: C
Index: 2008-09-19/xen/common/keyhandler.c
===================================================================
--- 2008-09-19.orig/xen/common/keyhandler.c     2008-09-19 13:59:19.000000000 
+0200
+++ 2008-09-19/xen/common/keyhandler.c  2008-09-19 13:59:54.000000000 +0200
@@ -205,11 +205,11 @@ static void dump_domains(unsigned char k
         printk("VCPU information and callbacks for domain %u:\n",
                d->domain_id);
         for_each_vcpu ( d, v ) {
-            printk("    VCPU%d: CPU%d [has=%c] flags=%lx "
+            printk("    VCPU%d: CPU%d [has=%c] flags=%lx poll=%d "
                    "upcall_pend = %02x, upcall_mask = %02x ",
                    v->vcpu_id, v->processor,
                    v->is_running ? 'T':'F',
-                   v->pause_flags,
+                   v->pause_flags, v->poll_evtchn,
                    vcpu_info(v, evtchn_upcall_pending),
                    vcpu_info(v, evtchn_upcall_mask));
             cpuset_print(tmpstr, sizeof(tmpstr), v->vcpu_dirty_cpumask);
@@ -230,6 +230,8 @@ static void dump_domains(unsigned char k
                             &vcpu_info(v, evtchn_pending_sel)));
             send_guest_vcpu_virq(v, VIRQ_DEBUG);
         }
+
+        dump_evtchn_info(d);
     }
 
     rcu_read_unlock(&domlist_read_lock);
Index: 2008-09-19/xen/include/xen/event.h
===================================================================
--- 2008-09-19.orig/xen/include/xen/event.h     2008-09-16 15:56:35.000000000 
+0200
+++ 2008-09-19/xen/include/xen/event.h  2008-09-19 13:59:54.000000000 +0200
@@ -79,4 +79,6 @@ void notify_via_xen_event_channel(int lp
         mb(); /* set blocked status /then/ caller does his work */      \
     } while ( 0 )
 
+void dump_evtchn_info(struct domain *);
+
 #endif /* __XEN_EVENT_H__ */




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


 


Rackspace

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