- * Copyright (c) 2008, 2009, 2010 Nicira Networks.
+ * Copyright (c) 2008, 2009, 2010, 2011 Nicira Networks.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
struct list node; /* Element in global waiters list. */
int fd; /* File descriptor. */
short int events; /* Events to wait for (POLLIN, POLLOUT). */
struct list node; /* Element in global waiters list. */
int fd; /* File descriptor. */
short int events; /* Events to wait for (POLLIN, POLLOUT). */
/* Set only when poll_block() is called. */
struct pollfd *pollfd; /* Pointer to element of the pollfds array. */
/* Set only when poll_block() is called. */
struct pollfd *pollfd; /* Pointer to element of the pollfds array. */
-/* Backtrace of 'timeout''s registration, if debugging is enabled. */
-static struct backtrace timeout_backtrace;
+/* Location where waiter created. */
+static const char *timeout_where;
/* Registers 'fd' as waiting for the specified 'events' (which should be POLLIN
* or POLLOUT or POLLIN | POLLOUT). The following call to poll_block() will
/* Registers 'fd' as waiting for the specified 'events' (which should be POLLIN
* or POLLOUT or POLLIN | POLLOUT). The following call to poll_block() will
*
* The event registration is one-shot: only the following call to poll_block()
* is affected. The event will need to be re-registered after poll_block() is
*
* The event registration is one-shot: only the following call to poll_block()
* is affected. The event will need to be re-registered after poll_block() is
*
* The timer registration is one-shot: only the following call to poll_block()
* is affected. The timer will need to be re-registered after poll_block() is
*
* The timer registration is one-shot: only the following call to poll_block()
* is affected. The timer will need to be re-registered after poll_block() is
*
* The timer registration is one-shot: only the following call to poll_block()
* is affected. The timer will need to be re-registered after poll_block() is
*
* The timer registration is one-shot: only the following call to poll_block()
* is affected. The timer will need to be re-registered after poll_block() is
- if (backtrace) {
- int i;
-
- ds_put_char(&ds, ':');
- for (i = 0; i < backtrace->n_frames; i++) {
- ds_put_format(&ds, " 0x%"PRIxPTR, backtrace->frames[i]);
- }
+ if (where) {
+ ds_put_format(&ds, " at %s", where);
static struct vlog_rate_limit rl = VLOG_RATE_LIMIT_INIT(1, 5);
VLOG_ERR_RL(&rl, "poll: %s", strerror(-retval));
} else if (!retval && VLOG_IS_DBG_ENABLED()) {
static struct vlog_rate_limit rl = VLOG_RATE_LIMIT_INIT(1, 5);
VLOG_ERR_RL(&rl, "poll: %s", strerror(-retval));
} else if (!retval && VLOG_IS_DBG_ENABLED()) {
}
LIST_FOR_EACH_SAFE (pw, next, node, &waiters) {
if (pw->pollfd->revents && VLOG_IS_DBG_ENABLED()) {
}
LIST_FOR_EACH_SAFE (pw, next, node, &waiters) {
if (pw->pollfd->revents && VLOG_IS_DBG_ENABLED()) {
- log_wakeup(pw->backtrace, "%s%s%s%s%s on fd %d",
+ char *description = describe_fd(pw->fd);
+ log_wakeup(pw->where, "%s%s%s%s%s on fd %d (%s)",
pw->pollfd->revents & POLLIN ? "[POLLIN]" : "",
pw->pollfd->revents & POLLOUT ? "[POLLOUT]" : "",
pw->pollfd->revents & POLLERR ? "[POLLERR]" : "",
pw->pollfd->revents & POLLHUP ? "[POLLHUP]" : "",
pw->pollfd->revents & POLLNVAL ? "[POLLNVAL]" : "",
pw->pollfd->revents & POLLIN ? "[POLLIN]" : "",
pw->pollfd->revents & POLLOUT ? "[POLLOUT]" : "",
pw->pollfd->revents & POLLERR ? "[POLLERR]" : "",
pw->pollfd->revents & POLLHUP ? "[POLLHUP]" : "",
pw->pollfd->revents & POLLNVAL ? "[POLLNVAL]" : "",