On Thu, May 19, 2016 at 05:51:19PM -0500, Ryan Moats wrote:
>
> As I mentioned at today's IRC meeting - we have a need to include measuring
> the performance of the OVN control channel under scale as part of our CI/CD
> test suite, which is driving us to examine the feasibility of some sort of
> lightweight instrumentation of ovsdb-server, ovn-controller, and
> ovn-northd.
> While I'm familiar with the counters that are dumped during an excessive
> poll
> cycle, those don't entirely meet our needs, as I am looking for something
> that allows for the amount of clock time spent in each method as our
> starting point.
>
> The reason for the "lightweight" adjective above is that we are looking to
> run the same code base in both CI/CD and production, and that means
> attaching
> a profiler to the code base is contra-indicated. My initial thought is to
> create a new general arg (--profile) that sets a boolean (for example
> is_profiling), then define a macro like the following:
>
> #define INSTRUMENT(x) (if (is_profiling) { VLOG_DEBUG(x); })
>
> and then decorating methods with INSTRUMENT at its start and exit.
Something like this might work (GCC only):
struct instrumentation {
const char *function;
long long int start;
};
#define INSTRUMENTATION \
struct instrumentation inst __attribute__((cleanup(log_inst))) = \
{ __func__, time_msec(); }
void
log_inst(const struct instrumentation *inst)
{
VLOG_DBG("%s: %d ms", inst->function, time_msec() - inst->start);
}
and then you'd only need one line for a whole function. I haven't tried
it though.
There's a PERF macro with a different design in lib/perf-counter.h.
_______________________________________________
discuss mailing list
[email protected]
http://openvswitch.org/mailman/listinfo/discuss