add event channel information to domain dump
PATCH 1/1 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 <[email protected]>
xen/common/event_channel.c +50 -0
@@ -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
xen/common/keyhandler.c +4 -2
@@ -205,11 +205,11 @@ static void dump_domains(unsigned char kprintk ("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);
xen/include/xen/event.h +2 -0
@@ -79,4 +79,6 @@ void notify_via_xen_event_channel(int lpmb ();/* set blocked status /then/ caller does his work */ \ } while ( 0 ) +void dump_evtchn_info(struct domain *); +#endif /* __XEN_EVENT_H__ */
Quoted 5 lines · Jan Beulich
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 <[email protected]>
I think this can go on a new debug key, as it could be pretty lengthy. So I checked it in as debug key 'e'.
-- Keir