From: "Jan Beulich" Subject: [PATCH] add event channel information to domain dump Date: Fri, 19 Sep 2008 14:15:49 +0100 Message-ID: <48D3C225.76E4.0078.0@novell.com> Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: quoted-printable Return-path: Content-Disposition: inline List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Sender: xen-devel-bounces@lists.xensource.com Errors-To: xen-devel-bounces@lists.xensource.com To: xen-devel@lists.xensource.com List-Id: xen-devel@lists.xenproject.org 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 Index: 2008-09-19/xen/common/event_channel.c =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- 2008-09-19.orig/xen/common/event_channel.c 2008-09-08 12:57:38.0000000= 00 +0200 +++ 2008-09-19/xen/common/event_channel.c 2008-09-19 13:59:54.0000000= 00 +0200 @@ -1079,6 +1079,56 @@ void evtchn_destroy(struct domain *d) spin_unlock(&d->evtchn_lock); } =20 +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 =3D 1; port < MAX_EVTCHNS(d); ++port ) + { + const struct evtchn *chn; + + if ( !port_is_valid(d, port) ) + continue; + chn =3D evtchn_from_port(d, port); + if ( chn->state =3D=3D ECS_FREE ) + continue; + + printk(" %4u[%d/%d]: s=3D%d n=3D%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=3D%d", chn->u.unbound.remote_domid); + break; + case ECS_INTERDOMAIN: + printk(" d=3D%d p=3D%d", + chn->u.interdomain.remote_dom->domain_id, + chn->u.interdomain.remote_port); + break; + case ECS_PIRQ: + printk(" p=3D%d", chn->u.pirq); + break; + case ECS_VIRQ: + printk(" v=3D%d", chn->u.virq); + break; + } + printk(" x=3D%d\n", chn->consumer_is_xen); + } + + spin_unlock(&d->evtchn_lock); +} + /* * Local variables: * mode: C Index: 2008-09-19/xen/common/keyhandler.c =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- 2008-09-19.orig/xen/common/keyhandler.c 2008-09-19 13:59:19.0000000= 00 +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=3D%c] flags=3D%lx " + printk(" VCPU%d: CPU%d [has=3D%c] flags=3D%lx poll=3D%d " "upcall_pend =3D %02x, upcall_mask =3D %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); } =20 rcu_read_unlock(&domlist_read_lock); Index: 2008-09-19/xen/include/xen/event.h =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- 2008-09-19.orig/xen/include/xen/event.h 2008-09-16 15:56:35.0000000= 00 +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 ) =20 +void dump_evtchn_info(struct domain *); + #endif /* __XEN_EVENT_H__ */