-#ifndef COREGL_TRACEPATH_H\r
-#define COREGL_TRACEPATH_H\r
-\r
-#include "../coregl_module.h"\r
-\r
-#ifndef COREGL_USE_MODULE_TRACEPATH\r
-#error "COREGL_USE_MODULE_TRACEPATH must defined!!!"\r
-#endif\r
-\r
-#define MY_MODULE_ID COREGL_MODULE_TRACEPATH\r
-#define MY_MODULE_TSTATE Tracepath_ThreadState\r
-\r
-#include "../../coregl_internal.h"\r
-#include "../../coregl_export.h"\r
-\r
-#define _COREGL_SYMBOL(IS_EXTENSION, RET_TYPE, FUNC_NAME, PARAM_LIST) extern RET_TYPE (*_orig_tracepath_##FUNC_NAME) PARAM_LIST;\r
-# include "../../headers/sym.h"\r
-#undef _COREGL_SYMBOL\r
-\r
-// Symbol definition for tracepath\r
-#define _COREGL_SYMBOL(IS_EXTENSION, RET_TYPE, FUNC_NAME, PARAM_LIST) extern RET_TYPE (tracepath_##FUNC_NAME) PARAM_LIST;\r
-# include "../../headers/sym.h"\r
-#undef _COREGL_SYMBOL\r
-\r
+#ifndef COREGL_TRACEPATH_H
+#define COREGL_TRACEPATH_H
+
+#include "../coregl_module.h"
+
+#ifndef COREGL_USE_MODULE_TRACEPATH
+#error "COREGL_USE_MODULE_TRACEPATH must defined!!!"
+#endif
+
+#define MY_MODULE_ID COREGL_MODULE_TRACEPATH
+#define MY_MODULE_TSTATE Tracepath_ThreadState
+
+#include "../../coregl_internal.h"
+#include "../../coregl_export.h"
+
+#define _COREGL_SYMBOL(RET_TYPE, FUNC_NAME, PARAM_LIST) extern RET_TYPE (*_orig_tracepath_##FUNC_NAME) PARAM_LIST;
+# include "../../headers/sym.h"
+#undef _COREGL_SYMBOL
+
+// Symbol definition for tracepath
+#define _COREGL_SYMBOL(RET_TYPE, FUNC_NAME, PARAM_LIST) extern RET_TYPE (tracepath_##FUNC_NAME) PARAM_LIST;
+# include "../../headers/sym.h"
+#undef _COREGL_SYMBOL
+
#define MAX_TRACE_NAME_LENGTH 256
#define MAX_TRACE_TABLE_SIZE 65536
-\r
-#define COREGL_TRACEPATH_TRACE_ALL\r
-
-#ifdef COREGL_TRACEPATH_TRACE_ALL\r
-#define COREGL_TRACEPATH_TRACE_CONTEXT_INFO // Context state & thread state & Glue-context info\r
-#define COREGL_TRACEPATH_TRACE_STATE_INFO // Glue-context state info\r
-#define COREGL_TRACEPATH_TRACE_APICALL_INFO // API call frequency info\r
-#define COREGL_TRACEPATH_TRACE_MEMUSE_INFO // Memory usage info\r
-#define COREGL_TRACEPATH_TRACE_SURFACE_INFO // Surface dump info\r
+
+#define COREGL_TRACEPATH_TRACE_ALL
+
+#ifdef COREGL_TRACEPATH_TRACE_ALL
+#define COREGL_TRACEPATH_TRACE_CONTEXT_INFO // Context state & thread state & Glue-context info
+#define COREGL_TRACEPATH_TRACE_STATE_INFO // Glue-context state info
+#define COREGL_TRACEPATH_TRACE_APICALL_INFO // API call frequency & each frame call info
+#define COREGL_TRACEPATH_TRACE_MEMUSE_INFO // Memory usage info
+#define COREGL_TRACEPATH_TRACE_SURFACE_INFO // Surface dump info
#endif
-#ifdef COREGL_TRACEPATH_TRACE_APICALL_INFO\r
+#ifdef COREGL_TRACEPATH_TRACE_APICALL_INFO
# define _COREGL_TRACE_API_BEGIN(api, hint, trace_total_time) \
- tracepath_api_trace_begin(api, hint, trace_total_time);\r
+ tracepath_api_trace_begin(api, hint, trace_total_time);
# define _COREGL_TRACE_API_END(api, hint, trace_total_time) \
- tracepath_api_trace_end(api, hint, trace_total_time);\r
+ tracepath_api_trace_end(api, hint, trace_total_time);
# define _COREGL_TRACE_API_OUTPUT(force_output) \
- tracepath_api_trace_output(force_output);\r
+ tracepath_api_trace_output(force_output);
+# define _COREGL_TRACE_API_RESET_FRAME() \
+ tracepath_api_trace_reset_frame();
#else
# 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)
+# define _COREGL_TRACE_API_RESET_FRAME()
#endif
-\r
-#ifdef COREGL_TRACEPATH_TRACE_MEMUSE_INFO\r
-# define _COREGL_TRACE_MEM_ADD(desc, alloc_size) \\r
- tracepath_mem_trace_add(desc, alloc_size);\r
-# define _COREGL_TRACE_MEM_REMOVE(desc, alloc_size) \\r
- tracepath_mem_trace_remove(desc, alloc_size);\r
-# define _COREGL_TRACE_MEM_OUTPUT(force_output) \\r
- tracepath_mem_trace_output(force_output);\r
+
+#ifdef COREGL_TRACEPATH_TRACE_MEMUSE_INFO
+# define _COREGL_TRACE_MEM_ADD(desc, alloc_size) \
+ tracepath_mem_trace_add(desc, alloc_size);
+# define _COREGL_TRACE_MEM_REMOVE(desc, alloc_size) \
+ tracepath_mem_trace_remove(desc, alloc_size);
+# define _COREGL_TRACE_MEM_OUTPUT(force_output) \
+ tracepath_mem_trace_output(force_output);
#else
-# define _COREGL_TRACE_MEM_ADD(desc, alloc_size)\r
-# define _COREGL_TRACE_MEM_REMOVE(desc, alloc_size)\r
-# define _COREGL_TRACE_MEM_OUTPUT(force_output)\r
+# define _COREGL_TRACE_MEM_ADD(desc, alloc_size)
+# define _COREGL_TRACE_MEM_REMOVE(desc, alloc_size)
+# define _COREGL_TRACE_MEM_OUTPUT(force_output)
#endif
-\r
-#ifdef COREGL_TRACEPATH_TRACE_SURFACE_INFO\r
-# define _COREGL_TRACE_SURFACE(force_output, position) \\r
- tracepath_surface_trace(force_output, position);\r
+
+#ifdef COREGL_TRACEPATH_TRACE_SURFACE_INFO
+# define _COREGL_TRACE_SURFACE(force_output, type, position) \
+ tracepath_surface_trace(force_output, type, position);
#else
-# define _COREGL_TRACE_SURFACE(force_output, position)\r
+# define _COREGL_TRACE_SURFACE(force_output, type, position)
#endif
-\r
-#define _COREGL_TRACEPATH_FUNC_BEGIN() \\r
+
+#define _COREGL_TRACEPATH_FUNC_BEGIN() \
if (unlikely(trace_api_flag == 1)) \
_COREGL_TRACE_API_BEGIN(__func__, NULL, 1);
-#define _COREGL_TRACEPATH_FUNC_END() \\r
+#define _COREGL_TRACEPATH_FUNC_END() \
if (unlikely(trace_api_flag == 1)) \
_COREGL_TRACE_API_END(__func__, NULL, 1);
-\r
+
typedef struct _Trace_Data Trace_Data;
-typedef struct _Apicall_Data Apicall_Data;\r
-typedef struct _Memuse_Data Memuse_Data;\r
-typedef struct _Surface_Data Surface_Data;\r
-\r
-#define MTD_GLBUF_HASH_ARRAY 10000\r
-\r
-typedef struct _Glbuf_Data Glbuf_Data;\r
-typedef struct _Sostate_Data\r
-{\r
- int ref_count;\r
-\r
- Glbuf_Data *glbuf_tex[MTD_GLBUF_HASH_ARRAY];\r
- Glbuf_Data *glbuf_rb[MTD_GLBUF_HASH_ARRAY];\r
-} Sostate_Data;\r
-\r
-typedef struct _Ctx_Data\r
-{\r
- GLDisplay dpy;\r
- GLContext handle;\r
- int ref_count;\r
- int mc_count;\r
- Sostate_Data *sostate;\r
-\r
- struct _Ctx_Data *next;\r
-} Ctx_Data;\r
-\r
-extern Mutex ctx_access_mutex;\r
-\r
-extern Mutex access_mutex;\r
-extern Memuse_Data **table;\r
-\r
-typedef struct _Tracepath_ThreadState\r
-{
- Apicall_Data **ftd_table;\r
- Ctx_Data *ctx;\r
-\r
- GLSurface *surf_draw;\r
- GLSurface *surf_read;\r
-} Tracepath_ThreadState;\r
-\r
-extern void init_modules_tracepath();\r
-extern void deinit_modules_tracepath();\r
-extern void init_modules_tstate_tracepath(GLThreadState *tstate);\r
-extern void deinit_modules_tstate_tracepath(GLThreadState *tstate);\r
-\r
-\r
-extern void tracepath_apply_overrides();\r
-extern void tracepath_apply_overrides_egl();\r
-extern void tracepath_apply_overrides_gl();\r
-\r
-extern void tracepath_dump_context_states(int force_output);\r
-\r
-extern void *tracepath_api_trace_begin(const char *name, void *hint, int trace_total_time);\r
-extern void *tracepath_api_trace_end(const char *name, void *hint, int trace_total_time);\r
-extern void tracepath_api_trace_output(int force_output);\r
-\r
-extern void tracepath_mem_trace_add(const char *desc, int alloc_size);\r
-extern void tracepath_mem_trace_remove(const char *desc, int alloc_size);\r
-extern void tracepath_mem_trace_output(int force_output);\r
-\r
-extern void tracepath_surface_trace_add(const char *desc, GLDisplay dpy, GLContext ctx, GLSurface surf, GLint fbo, GLint tex, GLint rb, GLint tex_w, GLint tex_h, GLint tex_format);\r
-extern void tracepath_surface_trace(int force_output, const char *position);\r
-\r
-extern void tracepath_glbuf_clear(Glbuf_Data **glbuf);\r
-\r
-#endif // COREGL_TRACEPATH_H\r
-\r
+typedef struct _Apicall_Data Apicall_Data;
+typedef struct _Memuse_Data Memuse_Data;
+typedef struct _Surface_Data Surface_Data;
+
+#define MTD_GLBUF_HASH_ARRAY 10000
+
+typedef struct _Glbuf_Data Glbuf_Data;
+typedef struct _Sostate_Data {
+ int ref_count;
+
+ Glbuf_Data *glbuf_tex[MTD_GLBUF_HASH_ARRAY];
+ Glbuf_Data *glbuf_rb[MTD_GLBUF_HASH_ARRAY];
+} Sostate_Data;
+
+typedef struct _Ctx_Data {
+ GLDisplay dpy;
+ GLContext handle;
+ int ref_count;
+ int mc_count;
+ Sostate_Data *sostate;
+
+ struct _Ctx_Data *next;
+} Ctx_Data;
+
+extern Mutex ctx_access_mutex;
+
+extern Mutex access_mutex;
+extern Memuse_Data **table;
+
+typedef struct _Tracepath_ThreadState {
+ Apicall_Data **ftd_table;
+ Ctx_Data *ctx;
+
+ GLSurface *surf_draw;
+ GLSurface *surf_read;
+} Tracepath_ThreadState;
+
+extern void init_modules_tracepath();
+extern void deinit_modules_tracepath();
+extern void init_modules_tstate_tracepath(GLThreadState *tstate);
+extern void deinit_modules_tstate_tracepath(
+ GLThreadState *tstate);
+
+
+extern void tracepath_apply_overrides();
+extern void tracepath_apply_overrides_egl(int enable);
+extern void tracepath_apply_overrides_gl(int enable);
+extern void tracepath_dump_context_states(int force_output);
+
+extern void *tracepath_api_trace_begin(const char *name,
+ void *hint, int trace_total_time);
+extern void *tracepath_api_trace_end(const char *name, void *hint,
+ int trace_total_time);
+extern void tracepath_api_trace_output(int force_output);
+extern void tracepath_api_trace_reset_frame();
+
+extern void tracepath_mem_trace_add(const char *desc,
+ int alloc_size);
+extern void tracepath_mem_trace_remove(const char *desc,
+ int alloc_size);
+extern void tracepath_mem_trace_output(int force_output);
+
+extern void tracepath_surface_trace_add(const char *desc,
+ GLDisplay dpy, GLContext ctx, GLSurface surf, GLint fbo, GLint tex, GLint rb,
+ GLint tex_w, GLint tex_h, GLint tex_format, const char *dump);
+extern void tracepath_surface_trace(int force_output, int type,
+ const char *position);
+
+extern void tracepath_glbuf_clear(Glbuf_Data **glbuf);
+
+#endif // COREGL_TRACEPATH_H
+