Add debug key 'e' for event channel information

Signed-off-by: Jan Beulich <jbeulich@novell.com>
This commit is contained in:
Keir Fraser committed 2008-09-22 15:50:59 +01:00
1 parent 331fc9de53
commit 1e98b38411
2 files changed
+74 -2

No files matched your search

+72
View File
@@ -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
+2 -2
View File
@@ -204,11 +204,11 @@ static void dump_domains(unsigned char key)
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);
Reference in new issue
Block a user
Blocking a user prevents them from interacting with repositories, such as opening or commenting on pull requests or issues. Learn more about blocking a user.