[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Xen-changelog] [xen-unstable] tools/libvchan: Remove unwanted debugging code



# HG changeset patch
# User Olaf Hering <olaf@xxxxxxxxx>
# Date 1334683129 -3600
# Node ID 1ff80750ce31a4f628b2e6830d273fa95f1364c4
# Parent  6092641e364428e7be20c9e23497d7a1fc535112
tools/libvchan: Remove unwanted debugging code

-O2 -Wall -Werror triggers these warnings:

io.c: In function 'do_send':
io.c:196: warning: ignoring return value of 'writev', declared with attribute 
warn_unused_result
io.c: In function 'do_recv':
io.c:287: warning: ignoring return value of 'writev', declared with attribute 
warn_unused_result

writev to -1 will always fail, silence the warning by removing the offending
(disabled) debug code.

Signed-off-by: Olaf Hering <olaf@xxxxxxxxx>
Acked-by: Ian Jackson <ian.jackson@xxxxxxxxxxxxx>
Committed-by: Ian Jackson <ian.jackson@xxxxxxxxxxxxx>
---


diff -r 6092641e3644 -r 1ff80750ce31 tools/libvchan/io.c
--- a/tools/libvchan/io.c       Tue Apr 17 15:05:05 2012 +0200
+++ b/tools/libvchan/io.c       Tue Apr 17 18:18:49 2012 +0100
@@ -49,11 +49,6 @@
 #define PAGE_SIZE 4096
 #endif
 
-// allow vchan data to be easily observed in strace by doing a
-// writev() to FD -1 with the data being read/written.
-#ifndef VCHAN_DEBUG
-#define VCHAN_DEBUG 0
-#endif
 
 static inline uint32_t rd_prod(struct libxenvchan *ctrl)
 {
@@ -186,15 +181,6 @@ static int do_send(struct libxenvchan *c
 {
        int real_idx = wr_prod(ctrl) & (wr_ring_size(ctrl) - 1);
        int avail_contig = wr_ring_size(ctrl) - real_idx;
-       if (VCHAN_DEBUG) {
-               char metainfo[32];
-               struct iovec iov[2];
-               iov[0].iov_base = metainfo;
-               iov[0].iov_len = snprintf(metainfo, 32, "vchan@%p wr", ctrl);
-               iov[1].iov_base = (void *)data;
-               iov[1].iov_len = size;
-               writev(-1, iov, 2);
-       }
        if (avail_contig > size)
                avail_contig = size;
        xen_mb(); /* read indexes /then/ write data */
@@ -277,15 +263,6 @@ static int do_recv(struct libxenvchan *c
        }
        xen_mb(); /* consume /then/ notify */
        rd_cons(ctrl) += size;
-       if (VCHAN_DEBUG) {
-               char metainfo[32];
-               struct iovec iov[2];
-               iov[0].iov_base = metainfo;
-               iov[0].iov_len = snprintf(metainfo, 32, "vchan@%p rd", ctrl);
-               iov[1].iov_base = data;
-               iov[1].iov_len = size;
-               writev(-1, iov, 2);
-       }
        if (send_notify(ctrl, VCHAN_NOTIFY_READ))
                return -1;
        return size;

_______________________________________________
Xen-changelog mailing list
Xen-changelog@xxxxxxxxxxxxx
http://lists.xensource.com/xen-changelog


 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.