michael@0: /* michael@0: * Copyright © 2007 Red Hat, Inc. michael@0: * michael@0: * Permission to use, copy, modify, distribute, and sell this software and its michael@0: * documentation for any purpose is hereby granted without fee, provided that michael@0: * the above copyright notice appear in all copies and that both that michael@0: * copyright notice and this permission notice appear in supporting michael@0: * documentation, and that the name of Red Hat not be used in advertising or michael@0: * publicity pertaining to distribution of the software without specific, michael@0: * written prior permission. Red Hat makes no representations about the michael@0: * suitability of this software for any purpose. It is provided "as is" michael@0: * without express or implied warranty. michael@0: * michael@0: * RED HAT DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING ALL michael@0: * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL RED HAT michael@0: * BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES michael@0: * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION michael@0: * OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN michael@0: * CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. michael@0: */ michael@0: michael@0: #ifdef HAVE_CONFIG_H michael@0: #include michael@0: #endif michael@0: michael@0: #include michael@0: #include michael@0: #include "pixman-private.h" michael@0: michael@0: #ifdef PIXMAN_TIMERS michael@0: michael@0: static pixman_timer_t *timers; michael@0: michael@0: static void michael@0: dump_timers (void) michael@0: { michael@0: pixman_timer_t *timer; michael@0: michael@0: for (timer = timers; timer != NULL; timer = timer->next) michael@0: { michael@0: printf ("%s: total: %llu n: %llu avg: %f\n", michael@0: timer->name, michael@0: timer->total, michael@0: timer->n_times, michael@0: timer->total / (double)timer->n_times); michael@0: } michael@0: } michael@0: michael@0: void michael@0: pixman_timer_register (pixman_timer_t *timer) michael@0: { michael@0: static int initialized; michael@0: michael@0: int atexit (void (*function)(void)); michael@0: michael@0: if (!initialized) michael@0: { michael@0: atexit (dump_timers); michael@0: initialized = 1; michael@0: } michael@0: michael@0: timer->next = timers; michael@0: timers = timer; michael@0: } michael@0: michael@0: #endif