X-Git-Url: https://pintos-os.org/cgi-bin/gitweb.cgi?a=blobdiff_plain;f=lib%2Fpoll-loop.c;h=7e328bc24ce486b2243cdfce1929c5464f513b02;hb=de6c85b0a2e61105d288c23b718f6599761c2a2e;hp=76fbc1d24f31af811253eb73917732b876bae216;hpb=cee03df4f53a9629f1f18b6c9948362f55a3ae27;p=openvswitch diff --git a/lib/poll-loop.c b/lib/poll-loop.c index 76fbc1d2..7e328bc2 100644 --- a/lib/poll-loop.c +++ b/lib/poll-loop.c @@ -1,5 +1,5 @@ /* - * Copyright (c) 2008, 2009, 2010, 2011 Nicira Networks. + * Copyright (c) 2008, 2009, 2010, 2011, 2012 Nicira, Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -157,7 +157,8 @@ poll_immediate_wake(const char *where) static void log_wakeup(const char *where, const struct pollfd *pollfd, int timeout) { - static struct vlog_rate_limit rl = VLOG_RATE_LIMIT_INIT(120, 120); + 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; struct ds s; @@ -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);