lguest: Debugging patch for lguest network performance
---
 Documentation/lguest/lguest.c |    8 ++++++++
 1 file changed, 8 insertions(+)

diff -r 25b4016f1ba1 Documentation/lguest/lguest.c
--- a/Documentation/lguest/lguest.c	Tue Jul 29 19:37:32 2008 +1000
+++ b/Documentation/lguest/lguest.c	Tue Jul 29 20:10:07 2008 +1000
@@ -173,6 +173,8 @@ struct virtqueue
 	/* Is this blocked awaiting a timer? */
 	bool blocked;
 };
+
+static unsigned int net_xmit_notify, net_recv_notify, net_recv_notify, net_timeout;
 
 /* Remember the arguments to the program so we can "reboot" */
 static char **main_args;
@@ -866,6 +868,9 @@ static bool handle_console_input(int fd,
 				/* Just in case Waker is blocked in BREAK, send
 				 * unbreak now. */
 				write(fd, args, sizeof(args));
+				printf("network xmit %u recv %u timeout %u usec %u\n",
+				       net_xmit_notify, net_recv_notify,
+				       net_timeout, timeout_usec);
 				exit(2);
 			}
 			abort->count = 0;
@@ -885,6 +890,8 @@ static void handle_console_output(int fd
 	unsigned int head, out, in;
 	int len;
 	struct iovec iov[vq->vring.num];
+
+	net_xmit_notify++;
 
 	/* Keep getting output buffers from the Guest until we run out. */
 	while ((head = get_vq_desc(vq, iov, &out, &in)) != vq->vring.num) {
@@ -1001,6 +1008,7 @@ static void enable_fd(int fd, struct vir
 
 static void net_enable_fd(int fd, struct virtqueue *vq, bool timeout)
 {
+	net_recv_notify++;
 	/* We don't need to know again when Guest refills receive buffer. */
 	vq->vring.used->flags |= VRING_USED_F_NO_NOTIFY;
 	enable_fd(fd, vq, timeout);
