]> xenbits.xensource.com Git - people/dstodden/blktap.git/commitdiff
CA-27472: Revert poll event debug code.
authorDaniel Stodden <daniel.stodden@citrix.com>
Wed, 8 Jul 2009 02:39:30 +0000 (19:39 -0700)
committerDaniel Stodden <daniel.stodden@citrix.com>
Wed, 8 Jul 2009 02:39:30 +0000 (19:39 -0700)
drivers/Makefile
drivers/scheduler.c
drivers/scheduler.h
drivers/tapdisk-event-log.c [deleted file]
drivers/tapdisk-event-log.h [deleted file]
drivers/tapdisk-server.c
drivers/tapdisk-server.h

index ca805dcae69bc684b1776162a63c122b88693ad7..83df236ca7f717a35c29a0b4f5888f9b5a562c93 100644 (file)
@@ -45,7 +45,6 @@ TAP-OBJS  += tapdisk-queue.o
 TAP-OBJS  += tapdisk-filter.o
 TAP-OBJS  += tapdisk-logfile.o
 TAP-OBJS  += tapdisk-log.o
-TAP-OBJS  += tapdisk-event-log.o
 TAP-OBJS  += tapdisk-utils.o
 TAP-OBJS  += tapdisk-syslog.o
 TAP-OBJS  += io-optimize.o
index 8289853cf135ec37314cd1c64f76890111f0048e..7eacba7684f13327fd52843591dd98e0fb2bacb3 100644 (file)
@@ -313,9 +313,6 @@ scheduler_wait_for_events(scheduler_t *s)
        if (ret < 0)
                goto out;
 
-       td_event_log_add_events(&s->event_log, ret,
-                               &s->read_fds, &s->write_fds, &s->except_fds);
-
        ret = scheduler_check_events(s, ret);
 
        s->timeout     = SCHEDULER_MAX_TIMEOUT;
@@ -343,6 +340,4 @@ scheduler_initialize(scheduler_t *s)
        FD_ZERO(&s->except_fds);
 
        INIT_LIST_HEAD(&s->events);
-
-       td_event_log_init(&s->event_log);
 }
index c6d2a013176abbfeea21108089dd64e83649634d..523325b7380cc059c46b06bf752fdb431cc12ad8 100644 (file)
@@ -31,7 +31,6 @@
 #include <sys/select.h>
 
 #include "list.h"
-#include "tapdisk-event-log.h"
 
 #define SCHEDULER_POLL_READ_FD       0x1
 #define SCHEDULER_POLL_WRITE_FD      0x2
@@ -53,8 +52,6 @@ typedef struct scheduler {
        int                          timeout;
        int                          max_timeout;
        int                          depth;
-
-       struct event_log             event_log;
 } scheduler_t;
 
 void scheduler_initialize(scheduler_t *);
diff --git a/drivers/tapdisk-event-log.c b/drivers/tapdisk-event-log.c
deleted file mode 100644 (file)
index f6942e5..0000000
+++ /dev/null
@@ -1,133 +0,0 @@
-/* 
- * Copyright (c) 2009, XenSource Inc.
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- *     * Redistributions of source code must retain the above copyright
- *       notice, this list of conditions and the following disclaimer.
- *     * Redistributions in binary form must reproduce the above copyright
- *       notice, this list of conditions and the following disclaimer in the
- *       documentation and/or other materials provided with the distribution.
- *     * Neither the name of XenSource Inc. nor the names of its contributors
- *       may be used to endorse or promote products derived from this software
- *       without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
- * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
- * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
- * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER
- * OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
- * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
- * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
- * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
- * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
- * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
- * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- */
-
-#include <stdio.h>
-#include <string.h>
-#include <time.h>
-#include <sys/time.h>
-
-#include "tapdisk-event-log.h"
-#include "tapdisk-log.h"
-
-#ifndef MIN
-#define MIN(a, b) ((a) <= (b) ? (a) : (b))
-#endif
-
-void
-td_event_log_init(struct event_log *log)
-{
-       memset(log, 0, sizeof(struct event_log));
-}
-
-static struct event_log_entry*
-td_event_log_add(struct event_log *log)
-{
-       struct event_log_entry *entry;
-
-       entry = __td_event_log_entry(log->count, log);
-
-       gettimeofday(&entry->ts, NULL);
-       entry->fds = 0;
-
-       log->count++;
-
-       return entry;
-}
-
-
-void
-td_event_log_add_events(struct event_log *log, int nfds,
-                       const fd_set *rdfds, const fd_set *wrfds,
-                       const fd_set *exfds)
-{
-       struct event_log_entry *entry;
-       int i;
-
-       if (nfds < 0)
-               return;
-
-       entry = td_event_log_add(log);
-
-       if (!nfds)
-               return;
-
-       for (i = 0; i < sizeof(entry->fds) * 8; ++i) {
-               int count =
-                       (rdfds ? FD_ISSET(i, rdfds) : 0) +
-                       (wrfds ? FD_ISSET(i, wrfds) : 0) +
-                       (exfds ? FD_ISSET(i, exfds) : 0);
-               if (!count)
-                       continue;
-
-               entry->fds |= (1<<i);
-
-               nfds -= count;
-               if (!nfds)
-                       break;
-       }
-
-       if (nfds)
-               entry->fds |= TD_EVENT_LOG_OTHER;
-}
-
-void
-td_event_log_write(struct event_log *log, int level)
-{
-       int i, j, N;
-       struct event_log_entry *prev;
-
-       N = td_event_log_num_entries(log);
-
-       prev = NULL;
-
-       for (i = 0; i < N; i += j) {
-               char buf[256], *pos = buf;
-
-               for (j = 0; j < 8 && i+j < N; ++j) {
-                       struct event_log_entry *entry;
-                       struct timeval delta;
-
-                       delta.tv_sec = delta.tv_usec = 0;
-
-                       entry = td_event_log_entry(i+j, log);
-
-                       if (prev)
-                               timersub(&entry->ts, &prev->ts, &delta);
-
-                       pos += snprintf(pos, buf + sizeof(buf) - pos,
-                                       " %ld.%06ld:%lx",
-                                       delta.tv_sec, delta.tv_usec,
-                                       entry->fds);
-
-                       prev = entry;
-               }
-
-               tlog_write(level, "[%lld/%lld]:%s\n",
-                          log->count - N + i, log->count, buf);
-       }
-}
diff --git a/drivers/tapdisk-event-log.h b/drivers/tapdisk-event-log.h
deleted file mode 100644 (file)
index e7f820a..0000000
+++ /dev/null
@@ -1,71 +0,0 @@
-/*
- * Copyright (c) 2008, XenSource Inc.
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- *     * Redistributions of source code must retain the above copyright
- *       notice, this list of conditions and the following disclaimer.
- *     * Redistributions in binary form must reproduce the above copyright
- *       notice, this list of conditions and the following disclaimer in the
- *       documentation and/or other materials provided with the distribution.
- *     * Neither the name of XenSource Inc. nor the names of its contributors
- *       may be used to endorse or promote products derived from this software
- *       without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
- * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
- * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
- * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER
- * OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
- * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
- * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
- * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
- * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
- * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
- * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- */
-
-#ifndef _EVENT_LOG_H_
-#define _EVENT_LOG_H_
-
-#include <sys/select.h>
-
-#define TD_EVENT_LOG_N_ENTRIES 128
-
-struct event_log_entry {
-       struct timeval          ts;
-       long                    fds;
-};
-
-struct event_log {
-       struct event_log_entry  ring[TD_EVENT_LOG_N_ENTRIES];
-       unsigned long long      count;
-};
-
-/* NB. Reuse low fds <= 2, these are dupd to /dev/null */
-#define TD_EVENT_LOG_OTHER      (1<<0)
-
-#define td_event_log_num_entries(_s)                   \
-       MIN((_s)->count, TD_EVENT_LOG_N_ENTRIES)
-
-#define td_event_log_first(_s)                         \
-       ((_s)->count < TD_EVENT_LOG_N_ENTRIES           \
-        ? 0                                            \
-        : (_s)->count % TD_EVENT_LOG_N_ENTRIES)
-
-#define __td_event_log_entry(_i, _s)                   \
-       &(_s)->ring[(_i) % TD_EVENT_LOG_N_ENTRIES]
-
-#define td_event_log_entry(_n, _s)                     \
-       __td_event_log_entry(td_event_log_first(_s) + (_n), _s)
-
-void td_event_log_init(struct event_log *log);
-
-void td_event_log_add_events(struct event_log *log, int nfds,
-                            const fd_set *rdfds, const fd_set *wrfds,
-                            const fd_set *exfds);
-
-void td_event_log_write(struct event_log *log, int level);
-
-#endif /* _EVENT_LOG_H_ */
index 5546e4fdd44cc9e94f7294cc142d510d73f8ad7c..95eab37cdae753da252998775f74c632fc569ba0 100644 (file)
@@ -423,20 +423,3 @@ tapdisk_server_run()
 
        return 0;
 }
-
-void
-tapdisk_server_log_events(void)
-{
-       td_vbd_t *vbd, *next;
-       int i;
-
-       tlog_write(TLOG_WARN, "index: ipc rfd:%x wfd:%x aio:%x other:%x\n",
-                  1<<server.ipc.rfd, 1<<server.ipc.wfd, 1<<server.aio_queue.poll_fd,
-                  1<<TD_EVENT_LOG_OTHER);
-
-       i = 0;
-       tapdisk_server_for_each_vbd(vbd, next)
-               tlog_write(TLOG_WARN, "index: vbd [%d]:%x\n", i++, 1<<vbd->ring.fd);
-
-       td_event_log_write(&server.scheduler.event_log, TLOG_WARN);
-}
index da654019c2cca5985bf77e3224d3c7612170a12b..83f4b54165a03b30c8bd7dd0bc284c4ce3bb646d 100644 (file)
@@ -51,7 +51,6 @@ void tapdisk_server_set_max_timeout(int);
 int tapdisk_server_initialize(const char *, const char *);
 int tapdisk_server_run(void);
 void tapdisk_server_iterate(void);
-void tapdisk_server_log_events(void);
 
 int tapdisk_server_openlog(const char *, int, int);
 void tapdisk_server_closelog(void);