From: David Vrabel <david.vrabel@citrix.com>
To: xen-devel@lists.xen.org
Cc: Keir Fraser <keir@xen.org>,
David Vrabel <david.vrabel@citrix.com>,
Jan Beulich <jbeulich@suse.com>
Subject: [PATCH 03/11] evtchn: print ABI specific state with the 'e' debug key
Date: Tue, 8 Oct 2013 13:40:37 +0100 [thread overview]
Message-ID: <1381236045-27020-4-git-send-email-david.vrabel@citrix.com> (raw)
In-Reply-To: <1381236045-27020-1-git-send-email-david.vrabel@citrix.com>
From: David Vrabel <david.vrabel@citrix.com>
In the output of the 'e' debug key, print some ABI specific state in
addition to the (p)ending and (m)asked bits.
For the 2-level ABI, print the state of that event's selector
bit. e.g.,
(XEN) port [p/m/s]
(XEN) 1 [0/0/1]: s=3 n=0 x=0 d=0 p=74
(XEN) 2 [0/0/1]: s=3 n=0 x=0 d=0 p=75
Signed-off-by: David Vrabel <david.vrabel@citrix.com>
Reviewed-by: Jan Beulich <jbeulich@suse.com>
---
xen/common/event_2l.c | 10 ++++++++++
xen/common/event_channel.c | 8 +++++---
xen/include/xen/event.h | 7 +++++++
3 files changed, 22 insertions(+), 3 deletions(-)
diff --git a/xen/common/event_2l.c b/xen/common/event_2l.c
index ed6de38..5c27eab 100644
--- a/xen/common/event_2l.c
+++ b/xen/common/event_2l.c
@@ -74,6 +74,15 @@ static bool_t evtchn_2l_is_masked(struct domain *d,
return test_bit(evtchn->port, &shared_info(d, evtchn_mask));
}
+static void evtchn_2l_print_state(struct domain *d,
+ const struct evtchn *evtchn)
+{
+ struct vcpu *v = d->vcpu[evtchn->notify_vcpu_id];
+
+ printk("%d", !!test_bit(evtchn->port / BITS_PER_EVTCHN_WORD(d),
+ &vcpu_info(v, evtchn_pending_sel)));
+}
+
static const struct evtchn_port_ops evtchn_port_ops_2l =
{
.set_pending = evtchn_2l_set_pending,
@@ -81,6 +90,7 @@ static const struct evtchn_port_ops evtchn_port_ops_2l =
.unmask = evtchn_2l_unmask,
.is_pending = evtchn_2l_is_pending,
.is_masked = evtchn_2l_is_masked,
+ .print_state = evtchn_2l_print_state,
};
void evtchn_2l_init(struct domain *d)
diff --git a/xen/common/event_channel.c b/xen/common/event_channel.c
index 7290a21..f73c7a9 100644
--- a/xen/common/event_channel.c
+++ b/xen/common/event_channel.c
@@ -1232,7 +1232,7 @@ static void domain_dump_evtchn_info(struct domain *d)
d->poll_mask, d->max_vcpus);
printk("Event channel information for domain %d:\n"
"Polling vCPUs: {%s}\n"
- " port [p/m]\n", d->domain_id, keyhandler_scratch);
+ " port [p/m/s]\n", d->domain_id, keyhandler_scratch);
spin_lock(&d->event_lock);
@@ -1247,10 +1247,12 @@ static void domain_dump_evtchn_info(struct domain *d)
if ( chn->state == ECS_FREE )
continue;
- printk(" %4u [%d/%d]: s=%d n=%d x=%d",
+ printk(" %4u [%d/%d/",
port,
!!evtchn_port_is_pending(d, chn),
- !!evtchn_port_is_masked(d, chn),
+ !!evtchn_port_is_masked(d, chn));
+ evtchn_port_print_state(d, chn);
+ printk("]: s=%d n=%d x=%d",
chn->state, chn->notify_vcpu_id, chn->xen_consumer);
switch ( chn->state )
diff --git a/xen/include/xen/event.h b/xen/include/xen/event.h
index 30c59c9..2445562 100644
--- a/xen/include/xen/event.h
+++ b/xen/include/xen/event.h
@@ -115,6 +115,7 @@ struct evtchn_port_ops {
void (*unmask)(struct domain *d, struct evtchn *evtchn);
bool_t (*is_pending)(struct domain *d, const struct evtchn *evtchn);
bool_t (*is_masked)(struct domain *d, const struct evtchn *evtchn);
+ void (*print_state)(struct domain *d, const struct evtchn *evtchn);
};
static inline void evtchn_port_set_pending(struct vcpu *v,
@@ -147,4 +148,10 @@ static inline bool_t evtchn_port_is_masked(struct domain *d,
return d->evtchn_port_ops->is_masked(d, evtchn);
}
+static inline void evtchn_port_print_state(struct domain *d,
+ const struct evtchn *evtchn)
+{
+ d->evtchn_port_ops->print_state(d, evtchn);
+}
+
#endif /* __XEN_EVENT_H__ */
--
1.7.2.5
next prev parent reply other threads:[~2013-10-08 12:40 UTC|newest]
Thread overview: 19+ messages / expand[flat|nested] mbox.gz Atom feed top
2013-10-08 12:40 [PATCHv6 00/11] Xen: FIFO-based event channel ABI David Vrabel
2013-10-08 12:40 ` [PATCH 01/11] debug: remove some event channel info from the 'i' and 'q' debug keys David Vrabel
2013-10-08 12:40 ` [PATCH 02/11] evtchn: refactor low-level event channel port ops David Vrabel
2013-10-08 12:40 ` David Vrabel [this message]
2013-10-08 12:40 ` [PATCH 04/11] evtchn: use a per-domain variable for the max number of event channels David Vrabel
2013-10-08 12:40 ` [PATCH 05/11] evtchn: allow many more evtchn objects to be allocated per domain David Vrabel
2013-10-08 12:40 ` [PATCH 06/11] evtchn: add FIFO-based event channel ABI David Vrabel
2013-10-08 12:40 ` [PATCH 07/11] evtchn: implement EVTCHNOP_set_priority and add the set_priority hook David Vrabel
2013-10-08 12:40 ` [PATCH 08/11] evtchn: add FIFO-based event channel hypercalls and port ops David Vrabel
2013-10-08 14:59 ` Jan Beulich
2013-10-08 16:48 ` David Vrabel
2013-10-08 12:40 ` [PATCH 09/11] xen: Add DOMCTL to limit the number of event channels a domain may use David Vrabel
2013-10-08 12:40 ` [PATCH 10/11] libxc: add xc_domain_set_max_evtchn() David Vrabel
2013-10-08 12:40 ` [PATCH 11/11] libxl, xl: add max_event_channels option to xl configuration file David Vrabel
2013-10-08 16:51 ` [PATCHv6 00/11] Xen: FIFO-based event channel ABI David Vrabel
2013-10-14 7:29 ` Keir Fraser
-- strict thread matches above, loose matches on Subject: below --
2013-10-02 16:35 [PATCHv5 0/11] " David Vrabel
2013-10-02 16:35 ` [PATCH 03/11] evtchn: print ABI specific state with the 'e' debug key David Vrabel
2013-09-27 10:55 [PATCHv4 0/11] Xen: FIFO-based event channel ABI David Vrabel
2013-09-27 10:55 ` [PATCH 03/11] evtchn: print ABI specific state with the 'e' debug key David Vrabel
2013-09-13 16:56 [PATCHv3 0/11] Xen: FIFO-based event channel ABI David Vrabel
2013-09-13 16:56 ` [PATCH 03/11] evtchn: print ABI specific state with the 'e' debug key David Vrabel
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1381236045-27020-4-git-send-email-david.vrabel@citrix.com \
--to=david.vrabel@citrix.com \
--cc=jbeulich@suse.com \
--cc=keir@xen.org \
--cc=xen-devel@lists.xen.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).