mirror of
https://github.com/openvswitch/ovs
synced 2025-08-31 06:15:47 +00:00
timeval: Remove backtrace feature.
The backtrace feature of timeval is useful because it provides a "poor man's profile" view of Open vSwitch. But it is not likely to be useful in a multithreaded process, because signal delivery doesn't necessarily follow the profile when there is more than one thread. (A signal in a multithreaded process are delivered to an arbitrary thread.) Another problem with the backtrace feature is that it is difficult for format_backtraces() to synchronize properly with the signal handler in a multithreaded process. In a single-threaded process, it can just block the signal handler, but in a multithreaded process this does not prevent signal delivery to threads other than the one running format_backtrace(). Signed-off-by: Ben Pfaff <blp@nicira.com> Acked-by: Ed Maste <emaste@freebsd.org>
This commit is contained in:
@@ -156,7 +156,6 @@ 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,11 +199,6 @@ 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);
|
||||
|
Reference in New Issue
Block a user