1 // Copyright (c) 2012 The ANGLE Project Authors. All rights reserved. 2 // Use of this source code is governed by a BSD-style license that can be 3 // found in the LICENSE file. 4 5 #ifndef COMMON_EVENT_TRACER_H_ 6 #define COMMON_EVENT_TRACER_H_ 7 8 #if !defined(TRACE_ENTRY) 9 #if defined(_WIN32) 10 #define TRACE_ENTRY __stdcall 11 #else 12 #define TRACE_ENTRY 13 #endif // // _WIN32 14 #endif //TRACE_ENTRY 15 16 extern "C" { 17 18 typedef const unsigned char* (*GetCategoryEnabledFlagFunc)(const char* name); 19 typedef void (*AddTraceEventFunc)(char phase, const unsigned char* categoryGroupEnabled, const char* name, 20 unsigned long long id, int numArgs, const char** argNames, 21 const unsigned char* argTypes, const unsigned long long* argValues, 22 unsigned char flags); 23 24 // extern "C" so that it has a reasonable name for GetProcAddress. 25 void TRACE_ENTRY SetTraceFunctionPointers(GetCategoryEnabledFlagFunc get_category_enabled_flag, 26 AddTraceEventFunc add_trace_event_func); 27 28 } 29 30 namespace gl 31 { 32 33 const unsigned char* TraceGetTraceCategoryEnabledFlag(const char* name); 34 35 void TraceAddTraceEvent(char phase, const unsigned char* categoryGroupEnabled, const char* name, unsigned long long id, 36 int numArgs, const char** argNames, const unsigned char* argTypes, 37 const unsigned long long* argValues, unsigned char flags); 38 39 } 40 41 #endif // COMMON_EVENT_TRACER_H_ 42