# HG changeset patch
# User Keir Fraser <keir.fraser@xxxxxxxxxx>
# Date 1222095059 -3600
# Node ID 81483e49c74c314ae3ed098c1373dfc3f2d3f31e
# Parent ae29cd95ba7d7f5cdcbb32509575b83e9fb3d43c
Add debug key 'e' for event channel information
Signed-off-by: Jan Beulich <jbeulich@xxxxxxxxxx>
---
xen/common/event_channel.c | 72 +++++++++++++++++++++++++++++++++++++++++++++
xen/common/keyhandler.c | 4 +-
2 files changed, 74 insertions(+), 2 deletions(-)
diff -r ae29cd95ba7d -r 81483e49c74c xen/common/event_channel.c
--- a/xen/common/event_channel.c Mon Sep 22 15:33:42 2008 +0100
+++ b/xen/common/event_channel.c Mon Sep 22 15:50:59 2008 +0100
@@ -25,6 +25,7 @@
#include <xen/iocap.h>
#include <xen/compat.h>
#include <xen/guest_access.h>
+#include <xen/keyhandler.h>
#include <asm/current.h>
#include <public/xen.h>
@@ -1079,6 +1080,77 @@ void evtchn_destroy(struct domain *d)
spin_unlock(&d->evtchn_lock);
}
+static void domain_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);
+}
+
+static void dump_evtchn_info(unsigned char key)
+{
+ struct domain *d;
+
+ printk("'%c' pressed -> dumping event-channel info\n", key);
+
+ rcu_read_lock(&domlist_read_lock);
+
+ for_each_domain ( d )
+ domain_dump_evtchn_info(d);
+
+ rcu_read_unlock(&domlist_read_lock);
+}
+
+static int __init dump_evtchn_info_key_init(void)
+{
+ register_keyhandler('e', dump_evtchn_info, "dump evtchn info");
+ return 0;
+}
+__initcall(dump_evtchn_info_key_init);
+
/*
* Local variables:
* mode: C
diff -r ae29cd95ba7d -r 81483e49c74c xen/common/keyhandler.c
--- a/xen/common/keyhandler.c Mon Sep 22 15:33:42 2008 +0100
+++ b/xen/common/keyhandler.c Mon Sep 22 15:50:59 2008 +0100
@@ -204,11 +204,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);
_______________________________________________
Xen-changelog mailing list
Xen-changelog@xxxxxxxxxxxxxxxxxxx
http://lists.xensource.com/xen-changelog
|