Commit 3011c25b by Jamie Madill

Fix event tracer linking on Linux.

We were including the cpp in multiple targets, which was causing a multiply defined error. BUG=angle:773 Change-Id: I1e31756faee2d7734f1fc6cfb086d0e7ec6519bc Reviewed-on: https://chromium-review.googlesource.com/232966Tested-by: 's avatarJamie Madill <jmadill@chromium.org> Reviewed-by: 's avatarBrandon Jones <bajones@chromium.org> Reviewed-by: 's avatarGeoff Lang <geofflang@chromium.org>
parent 4eae6dfa
...@@ -12,17 +12,6 @@ AddTraceEventFunc g_addTraceEvent; ...@@ -12,17 +12,6 @@ AddTraceEventFunc g_addTraceEvent;
} // namespace gl } // namespace gl
extern "C" {
void TRACE_ENTRY SetTraceFunctionPointers(GetCategoryEnabledFlagFunc getCategoryEnabledFlag,
AddTraceEventFunc addTraceEvent)
{
gl::g_getCategoryEnabledFlag = getCategoryEnabledFlag;
gl::g_addTraceEvent = addTraceEvent;
}
} // extern "C"
namespace gl namespace gl
{ {
......
...@@ -7,14 +7,6 @@ ...@@ -7,14 +7,6 @@
#include "common/platform.h" #include "common/platform.h"
#if !defined(TRACE_ENTRY)
# ifdef ANGLE_PLATFORM_WINDOWS
# define TRACE_ENTRY __stdcall
# else
# define TRACE_ENTRY
# endif // ANGLE_PLATFORM_WINDOWS
#endif //TRACE_ENTRY
extern "C" { extern "C" {
typedef const unsigned char* (*GetCategoryEnabledFlagFunc)(const char* name); typedef const unsigned char* (*GetCategoryEnabledFlagFunc)(const char* name);
...@@ -23,15 +15,14 @@ typedef void (*AddTraceEventFunc)(char phase, const unsigned char* categoryGroup ...@@ -23,15 +15,14 @@ typedef void (*AddTraceEventFunc)(char phase, const unsigned char* categoryGroup
const unsigned char* argTypes, const unsigned long long* argValues, const unsigned char* argTypes, const unsigned long long* argValues,
unsigned char flags); unsigned char flags);
// extern "C" so that it has a reasonable name for GetProcAddress.
void TRACE_ENTRY SetTraceFunctionPointers(GetCategoryEnabledFlagFunc get_category_enabled_flag,
AddTraceEventFunc add_trace_event_func);
} }
namespace gl namespace gl
{ {
extern GetCategoryEnabledFlagFunc g_getCategoryEnabledFlag;
extern AddTraceEventFunc g_addTraceEvent;
const unsigned char* TraceGetTraceCategoryEnabledFlag(const char* name); const unsigned char* TraceGetTraceCategoryEnabledFlag(const char* name);
void TraceAddTraceEvent(char phase, const unsigned char* categoryGroupEnabled, const char* name, unsigned long long id, void TraceAddTraceEvent(char phase, const unsigned char* categoryGroupEnabled, const char* name, unsigned long long id,
......
...@@ -14,8 +14,6 @@ ...@@ -14,8 +14,6 @@
'common/blocklayout.h', 'common/blocklayout.h',
'common/debug.cpp', 'common/debug.cpp',
'common/debug.h', 'common/debug.h',
'common/event_tracer.cpp',
'common/event_tracer.h',
'common/mathutil.cpp', 'common/mathutil.cpp',
'common/mathutil.h', 'common/mathutil.h',
'common/platform.h', 'common/platform.h',
...@@ -43,6 +41,8 @@ ...@@ -43,6 +41,8 @@
], ],
'libangle_sources': 'libangle_sources':
[ [
'common/event_tracer.cpp',
'common/event_tracer.h',
'libANGLE/AttributeMap.cpp', 'libANGLE/AttributeMap.cpp',
'libANGLE/AttributeMap.h', 'libANGLE/AttributeMap.h',
'libANGLE/BinaryStream.h', 'libANGLE/BinaryStream.h',
...@@ -565,8 +565,6 @@ ...@@ -565,8 +565,6 @@
'common/angleutils.h', 'common/angleutils.h',
'common/debug.cpp', 'common/debug.cpp',
'common/debug.h', 'common/debug.h',
'common/event_tracer.cpp',
'common/event_tracer.h',
'common/tls.cpp', 'common/tls.cpp',
'common/tls.h', 'common/tls.h',
'libGLESv2/libGLESv2.cpp', 'libGLESv2/libGLESv2.cpp',
......
...@@ -30,6 +30,7 @@ ...@@ -30,6 +30,7 @@
#include "common/utilities.h" #include "common/utilities.h"
#include "common/version.h" #include "common/version.h"
#include "common/event_tracer.h"
extern "C" extern "C"
{ {
...@@ -8819,4 +8820,11 @@ void GL_APIENTRY glFlushMappedBufferRangeEXT (GLenum target, GLintptr offset, GL ...@@ -8819,4 +8820,11 @@ void GL_APIENTRY glFlushMappedBufferRangeEXT (GLenum target, GLintptr offset, GL
} }
} }
void GL_APIENTRY SetTraceFunctionPointers(GetCategoryEnabledFlagFunc getCategoryEnabledFlag,
AddTraceEventFunc addTraceEvent)
{
gl::g_getCategoryEnabledFlag = getCategoryEnabledFlag;
gl::g_addTraceEvent = addTraceEvent;
}
} }
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment