[ovs-git] Open vSwitch: poll-loop: Make wakeup logging more portable and easier to understand. (master)

dev at openvswitch.org dev at openvswitch.org
Fri May 13 21:39:09 UTC 2011


This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "Open vSwitch".

The branch, master has been updated
       via  f89ffb0e2f6fa8adc100192ea4b5f948170d8d57 (commit)
       via  0e6644c3880be9684f37f48da84907bb67112514 (commit)
      from  498b2a5a68dcfea734f42ba548b7c61aabd8385b (commit)

Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.

- Log -----------------------------------------------------------------
commit f89ffb0e2f6fa8adc100192ea4b5f948170d8d57
Diffs: http://openvswitch.org/cgi-bin/gitweb.cgi?p=openvswitch;a=commitdiff;h=f89ffb0e2f6fa8adc100192ea4b5f948170d8d57
Author: Ben Pfaff <blp at nicira.com>
		
poll-loop: Make wakeup logging more portable and easier to understand.
		
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


commit 0e6644c3880be9684f37f48da84907bb67112514
Diffs: http://openvswitch.org/cgi-bin/gitweb.cgi?p=openvswitch;a=commitdiff;h=0e6644c3880be9684f37f48da84907bb67112514
Author: Ben Pfaff <blp at nicira.com>
		
backtrace: Make backtrace_capture() work on more systems.
		
The backtrace_capture() implementation only worked properly with GNU C on
systems that have a simple stack frame with a frame pointer.  Notably,
the x86-64 ABI by default has no frame pointer, so this failed on x86-64.

However, glibc has a function named backtrace() that does what we want.
This commit tests for this function and uses it when it is present, fixing
x86-64 backtraces.


-----------------------------------------------------------------------

Summary of changes:
 configure.ac      |    1 +
 lib/backtrace.c   |   30 +++++++++--
 lib/jsonrpc.c     |    4 +-
 lib/poll-loop.c   |  100 +++++++++++++++++++---------------
 lib/poll-loop.h   |   30 ++++++++--
 lib/socket-util.c |  155 +++++++++++++++++++++++++++++++++++++++++++++++++++++
 lib/socket-util.h |    2 +
 lib/timer.c       |    4 +-
 lib/timer.h       |    4 +-
 lib/util.h        |    8 +++
 m4/openvswitch.m4 |    5 ++
 11 files changed, 283 insertions(+), 60 deletions(-)


hooks/post-receive
-- 
Open vSwitch



More information about the git mailing list