aboutsummaryrefslogtreecommitdiff
path: root/lib/timer.h
AgeCommit message (Collapse)Author
2011-05-19timer: Remove timer_expired_at() function.Ethan Jackson
This function has no users, and is a bit of a kludge anyway.
2011-05-13poll-loop: Make wakeup logging more portable and easier to understand.Ben Pfaff
Until now, when the poll_loop module's log level was turned up to "debug", it would log a backtrace of the call stack for the event that caused poll() to wake up in poll_block(). This was pretty useful from time to time to find out why ovs-vswitchd was using more CPU than expected, because we could find out what was causing it to wake up. But there were some issues. One is simply that the backtrace was printed as a series of hexadecimal numbers, so GDB or another debugger was needed to translate it into human-readable format. Compiler optimizations meant that even the human-readable backtrace wasn't, in my experience, as helpful as it could have been. And, of course, one needed to have the binary to interpret the backtrace. When the backtrace couldn't be interpreted or wasn't meaningful, there was essentially nothing to fall back on. This commit changes the way that "debug" logging for poll_block() wakeups works. Instead of logging a backtrace, it logs the source code file name and line number of the call to a poll_loop function, using __FILE__ and __LINE__. This is by itself much more meaningful than a sequence of hexadecimal numbers, since no additional interpretation is necessary. It can be useful even if the Open vSwitch version is only approximately known. In addition to the file and line, this commit adds, for wakeups caused by file descriptors, information about the file descriptor itself: what kind of file it is (regular file, directory, socket, etc.), the name of the file (on Linux only), and the local and remote endpoints for socket file descriptors. Here are a few examples of the new output format: 932-ms timeout at ../ofproto/in-band.c:507 [POLLIN] on fd 20 (192.168.0.20:35388<->192.168.0.3:6633) at ../lib/stream-fd.c:149 [POLLIN] on fd 7 (FIFO pipe:[48049]) at ../lib/fatal-signal.c:168
2011-05-13cfm: Replace recv_time with a flag.Ethan Jackson
This makes the code more obviously correct in my opinion. This patch also removes timer_enabled_at() along with its only user.
2011-04-07cfm: Fix broken fault logic.Ethan Jackson
If the last receive time for a remote MP was before the last fault check, the CFM code would not declare a fault. This is, of course, exactly the wrong response. Bug #5303.
2011-03-31lib: Create new timer library.Ethan Jackson
Scattered throughout the code base we use long integers to implement timers. When the result of timer_msec() is greater than the time stored, we preform some action. This commit creates a new timer library intended to replace these manually managed timers. Code using the timer library will be more obviously correct, and more consistent with other code using the library.