[ovs-dev] [PATCH 3/3] poll-loop: Log backtraces when CPU usage is high.
Ben Pfaff
blp at nicira.com
Wed Oct 24 23:58:31 UTC 2012
On Wed, Oct 24, 2012 at 01:49:09PM -0700, Ethan Jackson wrote:
> Often when debugging Open vSwitch, one will see in the logs that
> CPU usage has been high for some period of time, but it's totally
> unclear why. In an attempt to remedy the situation, this patch
> logs backtraces taken at regular intervals as a poor man's
> profiling alternative.
>
> Signed-off-by: Ethan Jackson <ethan at nicira.com>
I only have a minor cosmetic suggestion. Here:
> if (cpu_usage >= 0) {
> ds_put_format(&s, " (%d%% CPU usage)", cpu_usage);
> +
> + if (!vlog_should_drop(THIS_MODULE, level, &trace_rl)) {
> + ds_put_cstr(&s, "\nBacktraces:\n");
> + format_backtraces(&s, 2);
> + }
it might make sense to drop "Backtraces:\n" (you probably want to keep
the newline) because otherwise if there aren't any repeated backtraces
or if we're on a system without backtrace() then you'll get a
funny-looking two-line log message without any additional detail.
Otherwise I think (hope, anyway) that this will be very useful.
More information about the dev
mailing list