Fix performance issue (gettimeofday() moved)
authorHaegeun Park <haegeun.park@samsung.com>
Wed, 2 May 2012 06:38:47 +0000 (23:38 -0700)
committerHaegeun Park <haegeun.park@samsung.com>
Wed, 2 May 2012 06:38:47 +0000 (23:38 -0700)
src/coregl_internal.h
src/coregl_trace.c

index 57e10a2..220f331 100644 (file)
@@ -68,8 +68,8 @@ typedef struct _Trace_Data Trace_Data;
 # define _COREGL_TRACE_API_OUTPUT(force_output) \
    trace_output(force_output);
 #else
-# define _COREGL_TRACE_API_BEGIN(api, trace_total_time)
-# define _COREGL_TRACE_API_END(api, trace_total_time)
+# define _COREGL_TRACE_API_BEGIN(api, hint, trace_total_time) NULL;
+# define _COREGL_TRACE_API_END(api, hint, trace_total_time)
 # define _COREGL_TRACE_API_OUTPUT(force_output)
 #endif
 
index 1622652..b262649 100644 (file)
@@ -258,15 +258,15 @@ trace_end(const char *funcname, void *hint, int trace_total_time)
        Trace_Data *ftd = NULL;
        struct timeval t = TIMEVAL_INIT;
 
-       ftd = (Trace_Data *)hint;
-
-       AST(gettimeofday(&t, NULL) == 0);
-
        if (trace_api_flag == 1)
        {
                GLThreadState *tstate = NULL;
                struct timeval elapsed_time = TIMEVAL_INIT;
 
+               ftd = (Trace_Data *)hint;
+
+               AST(gettimeofday(&t, NULL) == 0);
+
                if (ftd == NULL)
                {
                        tstate = get_current_thread_state();