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 <[email protected]>
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.
_______________________________________________
dev mailing list
[email protected]
http://openvswitch.org/mailman/listinfo/dev