13cf1f4eac8d79432626fcb8b0bc12482fafd2392Al Patrick// Copyright (c) 2012 The ANGLE Project Authors. All rights reserved.
23cf1f4eac8d79432626fcb8b0bc12482fafd2392Al Patrick// Use of this source code is governed by a BSD-style license that can be
33cf1f4eac8d79432626fcb8b0bc12482fafd2392Al Patrick// found in the LICENSE file.
43cf1f4eac8d79432626fcb8b0bc12482fafd2392Al Patrick
53cf1f4eac8d79432626fcb8b0bc12482fafd2392Al Patrick#ifndef COMMON_EVENT_TRACER_H_
63cf1f4eac8d79432626fcb8b0bc12482fafd2392Al Patrick#define COMMON_EVENT_TRACER_H_
73cf1f4eac8d79432626fcb8b0bc12482fafd2392Al Patrick
83cf1f4eac8d79432626fcb8b0bc12482fafd2392Al Patrickextern "C" {
93cf1f4eac8d79432626fcb8b0bc12482fafd2392Al Patrick
103cf1f4eac8d79432626fcb8b0bc12482fafd2392Al Patricktypedef const unsigned char* (*GetCategoryEnabledFlagFunc)(const char* name);
113cf1f4eac8d79432626fcb8b0bc12482fafd2392Al Patricktypedef void (*AddTraceEventFunc)(char phase, const unsigned char* categoryGroupEnabled, const char* name,
123cf1f4eac8d79432626fcb8b0bc12482fafd2392Al Patrick                                  unsigned long long id, int numArgs, const char** argNames,
133cf1f4eac8d79432626fcb8b0bc12482fafd2392Al Patrick                                  const unsigned char* argTypes, const unsigned long long* argValues,
143cf1f4eac8d79432626fcb8b0bc12482fafd2392Al Patrick                                  unsigned char flags);
153cf1f4eac8d79432626fcb8b0bc12482fafd2392Al Patrick
163cf1f4eac8d79432626fcb8b0bc12482fafd2392Al Patrick// extern "C" so that it has a reasonable name for GetProcAddress.
173cf1f4eac8d79432626fcb8b0bc12482fafd2392Al Patrickvoid __stdcall SetTraceFunctionPointers(GetCategoryEnabledFlagFunc get_category_enabled_flag,
183cf1f4eac8d79432626fcb8b0bc12482fafd2392Al Patrick                                        AddTraceEventFunc add_trace_event_func);
193cf1f4eac8d79432626fcb8b0bc12482fafd2392Al Patrick
203cf1f4eac8d79432626fcb8b0bc12482fafd2392Al Patrick}
213cf1f4eac8d79432626fcb8b0bc12482fafd2392Al Patrick
223cf1f4eac8d79432626fcb8b0bc12482fafd2392Al Patricknamespace gl
233cf1f4eac8d79432626fcb8b0bc12482fafd2392Al Patrick{
243cf1f4eac8d79432626fcb8b0bc12482fafd2392Al Patrick
253cf1f4eac8d79432626fcb8b0bc12482fafd2392Al Patrickconst unsigned char* TraceGetTraceCategoryEnabledFlag(const char* name);
263cf1f4eac8d79432626fcb8b0bc12482fafd2392Al Patrick
273cf1f4eac8d79432626fcb8b0bc12482fafd2392Al Patrickvoid TraceAddTraceEvent(char phase, const unsigned char* categoryGroupEnabled, const char* name, unsigned long long id,
283cf1f4eac8d79432626fcb8b0bc12482fafd2392Al Patrick                        int numArgs, const char** argNames, const unsigned char* argTypes,
293cf1f4eac8d79432626fcb8b0bc12482fafd2392Al Patrick                        const unsigned long long* argValues, unsigned char flags);
303cf1f4eac8d79432626fcb8b0bc12482fafd2392Al Patrick
313cf1f4eac8d79432626fcb8b0bc12482fafd2392Al Patrick}
323cf1f4eac8d79432626fcb8b0bc12482fafd2392Al Patrick
333cf1f4eac8d79432626fcb8b0bc12482fafd2392Al Patrick#endif  // COMMON_EVENT_TRACER_H_
34