xen-devel.lists.xenproject.org archive mirror
 help / color / mirror / Atom feed
From: Ian Jackson <ian.jackson@eu.citrix.com>
To: xen-devel@lists.xen.org
Cc: Ian Jackson <ian.jackson@eu.citrix.com>
Subject: [PATCH 3/4] libxl: events: debugging output for fds
Date: Fri, 18 May 2012 19:20:24 +0100	[thread overview]
Message-ID: <1337365225-11937-4-git-send-email-ian.jackson@eu.citrix.com> (raw)
In-Reply-To: <1337365225-11937-1-git-send-email-ian.jackson@eu.citrix.com>

Signed-off-by: Ian Jackson <ian.jackson@eu.citrix.com>

Changes since v1:
 * New output only occurs if you compile with -DDEBUG=1
---
 tools/libxl/libxl_event.c |   15 +++++++++++++--
 1 files changed, 13 insertions(+), 2 deletions(-)

diff --git a/tools/libxl/libxl_event.c b/tools/libxl/libxl_event.c
index 8d6fec8..ed8ed5c 100644
--- a/tools/libxl/libxl_event.c
+++ b/tools/libxl/libxl_event.c
@@ -70,6 +70,8 @@ int libxl__ev_fd_register(libxl__gc *gc, libxl__ev_fd *ev,
 
     CTX_LOCK;
 
+    DBG("ev_fd=%p register fd=%d events=%x", ev, fd, events);
+
     rc = OSEVENT_HOOK(fd_register, fd, &ev->for_app_reg, events, ev);
     if (rc) goto out;
 
@@ -93,6 +95,8 @@ int libxl__ev_fd_modify(libxl__gc *gc, libxl__ev_fd *ev, short events)
     CTX_LOCK;
     assert(libxl__ev_fd_isregistered(ev));
 
+    DBG("ev_fd=%p modify fd=%d events=%x", ev, ev->fd, events);
+
     rc = OSEVENT_HOOK(fd_modify, ev->fd, &ev->for_app_reg, events);
     if (rc) goto out;
 
@@ -108,8 +112,12 @@ void libxl__ev_fd_deregister(libxl__gc *gc, libxl__ev_fd *ev)
 {
     CTX_LOCK;
 
-    if (!libxl__ev_fd_isregistered(ev))
+    if (!libxl__ev_fd_isregistered(ev)) {
+        DBG("ev_fd=%p deregister unregistered",ev);
         goto out;
+    }
+
+    DBG("ev_fd=%p deregister fd=%d", ev, ev->fd);
 
     OSEVENT_HOOK_VOID(fd_deregister, ev->fd, ev->for_app_reg);
     LIBXL_LIST_REMOVE(ev, entry);
@@ -873,8 +881,11 @@ static void afterpoll_internal(libxl__egc *egc, libxl__poller *poller,
             continue;
 
         int revents = afterpoll_check_fd(poller,fds,nfds, efd->fd,efd->events);
-        if (revents)
+        if (revents) {
+            DBG("ev_fd=%p occurs fd=%d events=%x revents=%x",
+                efd, efd->fd, efd->events, revents);
             efd->func(egc, efd, efd->fd, efd->events, revents);
+        }
     }
 
     if (afterpoll_check_fd(poller,fds,nfds, poller->wakeup_pipe[0],POLLIN)) {
-- 
1.7.2.5

  parent reply	other threads:[~2012-05-18 18:20 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-05-18 18:20 [PATCH v2 0/4] libxl: events: debugging output Ian Jackson
2012-05-18 18:20 ` [PATCH 1/4] libxl: events: debugging output for timeouts Ian Jackson
2012-05-18 18:20 ` [PATCH 2/4] libxl: events: improve debugging output for xs watches Ian Jackson
2012-05-18 18:20 ` Ian Jackson [this message]
2012-05-18 18:20 ` [PATCH 4/4] libxl: events: debugging output relating to ao's Ian Jackson
2012-05-22 10:55 ` [PATCH v2 0/4] libxl: events: debugging output Ian Campbell
  -- strict thread matches above, loose matches on Subject: below --
2012-05-15 14:09 libxl: events: debugging improvements Ian Jackson
2012-05-15 14:09 ` [PATCH 3/4] libxl: events: debugging output for fds Ian Jackson

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=1337365225-11937-4-git-send-email-ian.jackson@eu.citrix.com \
    --to=ian.jackson@eu.citrix.com \
    --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).