X-Git-Url: http://git.onelab.eu/?a=blobdiff_plain;f=lib%2Fpoll-loop.c;h=7e328bc24ce486b2243cdfce1929c5464f513b02;hb=bc098fda3387245f4e273b869e8b9e7d312f2004;hp=516cf13d1db321925a80c71dfd63de6bfd1de646;hpb=1e3f34c7693bcabae8e443ac1b246680ef9b60e2;p=sliver-openvswitch.git diff --git a/lib/poll-loop.c b/lib/poll-loop.c index 516cf13d1..7e328bc24 100644 --- a/lib/poll-loop.c +++ b/lib/poll-loop.c @@ -157,6 +157,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 +201,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);