Upstream version 9.38.198.0
[platform/framework/web/crosswalk.git] / src / third_party / angle / src / common / event_tracer.h
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 #include "common/platform.h"
9
10 #if !defined(TRACE_ENTRY)
11 #   ifdef ANGLE_PLATFORM_WINDOWS
12 #       define TRACE_ENTRY __stdcall
13 #   else
14 #       define TRACE_ENTRY
15 #   endif // ANGLE_PLATFORM_WINDOWS
16 #endif //TRACE_ENTRY
17
18 extern "C" {
19
20 typedef const unsigned char* (*GetCategoryEnabledFlagFunc)(const char* name);
21 typedef void (*AddTraceEventFunc)(char phase, const unsigned char* categoryGroupEnabled, const char* name,
22                                   unsigned long long id, int numArgs, const char** argNames,
23                                   const unsigned char* argTypes, const unsigned long long* argValues,
24                                   unsigned char flags);
25
26 // extern "C" so that it has a reasonable name for GetProcAddress.
27 void TRACE_ENTRY SetTraceFunctionPointers(GetCategoryEnabledFlagFunc get_category_enabled_flag,
28                                           AddTraceEventFunc add_trace_event_func);
29
30 }
31
32 namespace gl
33 {
34
35 const unsigned char* TraceGetTraceCategoryEnabledFlag(const char* name);
36
37 void TraceAddTraceEvent(char phase, const unsigned char* categoryGroupEnabled, const char* name, unsigned long long id,
38                         int numArgs, const char** argNames, const unsigned char* argTypes,
39                         const unsigned long long* argValues, unsigned char flags);
40
41 }
42
43 #endif  // COMMON_EVENT_TRACER_H_