Previously, the callers were stopping and starting the counter outside
of the call to metrics_end_frame. There's less code duplication and
more robustness by moving the counter stop and counter start into the
metrics_end_frame function itself.
EGLWRAP_DEFER_WITH_RETURN (ret, eglSwapBuffers, dpy, surface);
EGLWRAP_DEFER_WITH_RETURN (ret, eglSwapBuffers, dpy, surface);
- context_counter_stop ();
-
- context_counter_start ();
-
{
GLWRAP_DEFER (glXSwapBuffers, dpy, drawable);
{
GLWRAP_DEFER (glXSwapBuffers, dpy, drawable);
- context_counter_stop ();
-
-
- context_counter_start ();
}
/* glXGetProcAddressARB is a function which accepts a string and
}
/* glXGetProcAddressARB is a function which accepts a string and
static int initialized = 0;
static struct timeval tv_start, tv_now;
static int initialized = 0;
static struct timeval tv_start, tv_now;
+ /* Don't leave any counters running over work we do here. */
+ metrics_counter_stop (metrics);
+
if (! initialized) {
gettimeofday (&tv_start, NULL);
if (getenv ("FIPS_VERBOSE"))
if (! initialized) {
gettimeofday (&tv_start, NULL);
if (getenv ("FIPS_VERBOSE"))
print_program_metrics (metrics);
}
print_program_metrics (metrics);
}
+
+ /* Start the counter up again now that we're done. */
+ metrics_counter_start (metrics);