X-Git-Url: http://git.onelab.eu/?a=blobdiff_plain;f=lib%2Fpoll-loop.c;h=fca1dfa46c0410cbdbd762644fa41ce3b48f1293;hb=eb857b4824d2a62e1cc1b85c30a3da007d4942c9;hp=516cf13d1db321925a80c71dfd63de6bfd1de646;hpb=1e3f34c7693bcabae8e443ac1b246680ef9b60e2;p=sliver-openvswitch.git diff --git a/lib/poll-loop.c b/lib/poll-loop.c index 516cf13d1..fca1dfa46 100644 --- a/lib/poll-loop.c +++ b/lib/poll-loop.c @@ -16,7 +16,6 @@ #include #include "poll-loop.h" -#include #include #include #include @@ -157,6 +156,7 @@ poll_immediate_wake(const char *where) static void log_wakeup(const char *where, const struct pollfd *pollfd, int timeout) { + static struct vlog_rate_limit trace_rl = VLOG_RATE_LIMIT_INIT(1, 1); static struct vlog_rate_limit rl = VLOG_RATE_LIMIT_INIT(10, 10); enum vlog_level level; int cpu_usage; @@ -200,6 +200,11 @@ log_wakeup(const char *where, const struct pollfd *pollfd, int timeout) } if (cpu_usage >= 0) { ds_put_format(&s, " (%d%% CPU usage)", cpu_usage); + + if (!vlog_should_drop(THIS_MODULE, level, &trace_rl)) { + ds_put_char(&s, '\n'); + format_backtraces(&s, 2); + } } VLOG(level, "%s", ds_cstr(&s)); ds_destroy(&s); @@ -283,7 +288,7 @@ static struct poll_waiter * new_waiter(int fd, short int events, const char *where) { struct poll_waiter *waiter = xzalloc(sizeof *waiter); - assert(fd >= 0); + ovs_assert(fd >= 0); waiter->fd = fd; waiter->events = events; waiter->where = where;