Fix the ANGLE_ENABLE_TRACE build.

We needed to include angleutils.cpp in libtranslator for this to
compile. Also allow the event helpers to record API calls even
if ANGLE_ENABLE_PERF is off.

BUG=angle:513

Change-Id: I2646d5ebeae536a4a7f1cd7ecaf0ce019ce5ff76
Reviewed-on: https://chromium-review.googlesource.com/219756
Tested-by: Jamie Madill <jmadill@chromium.org>
Reviewed-by: Geoff Lang <geofflang@chromium.org>
Reviewed-by: Shannon Woods <shannonwoods@chromium.org>
diff --git a/projects/src/translator_lib.vcxproj b/projects/src/translator_lib.vcxproj
index 259d91a..f10985d 100644
--- a/projects/src/translator_lib.vcxproj
+++ b/projects/src/translator_lib.vcxproj
@@ -307,6 +307,7 @@
     <ClCompile Include="..\..\src\common\RefCountObject.cpp"/>
     <ClCompile Include="..\..\src\common\mathutil.cpp"/>
     <ClCompile Include="..\..\src\common\debug.cpp"/>
+    <ClCompile Include="..\..\src\common\angleutils.cpp"/>
     <ClCompile Include="..\..\src\common\blocklayout.cpp"/>
     <ClCompile Include="..\..\src\compiler\translator\InfoSink.cpp"/>
     <ClCompile Include="..\..\src\compiler\translator\OutputESSL.cpp"/>
diff --git a/projects/src/translator_lib.vcxproj.filters b/projects/src/translator_lib.vcxproj.filters
index 0a85957..6f10b79 100644
--- a/projects/src/translator_lib.vcxproj.filters
+++ b/projects/src/translator_lib.vcxproj.filters
@@ -99,6 +99,9 @@
     <ClInclude Include="..\..\src\common\utilities.h">
       <Filter>src\common</Filter>
     </ClInclude>
+    <ClCompile Include="..\..\src\common\angleutils.cpp">
+      <Filter>src\common</Filter>
+    </ClCompile>
     <ClCompile Include="..\..\src\common\blocklayout.cpp">
       <Filter>src\common</Filter>
     </ClCompile>
diff --git a/src/common/debug.cpp b/src/common/debug.cpp
index dcad327..41e8b00 100644
--- a/src/common/debug.cpp
+++ b/src/common/debug.cpp
@@ -87,7 +87,6 @@
 
 ScopedPerfEventHelper::ScopedPerfEventHelper(const char* format, ...)
 {
-#if defined(ANGLE_ENABLE_PERF)
 #if !defined(ANGLE_ENABLE_TRACE)
     if (!perfActive())
     {
@@ -96,9 +95,12 @@
 #endif // !ANGLE_ENABLE_TRACE
     va_list vararg;
     va_start(vararg, format);
+#if defined(ANGLE_ENABLE_PERF)
     output(true, reinterpret_cast<PerfOutputFunction>(D3DPERF_BeginEvent), format, vararg);
-    va_end(vararg);
+#else
+    output(true, NULL, format, vararg);
 #endif // ANGLE_ENABLE_PERF
+    va_end(vararg);
 }
 
 ScopedPerfEventHelper::~ScopedPerfEventHelper()
diff --git a/src/compiler.gypi b/src/compiler.gypi
index dadc4ca..68e4462 100644
--- a/src/compiler.gypi
+++ b/src/compiler.gypi
@@ -24,6 +24,7 @@
             'common/RefCountObject.cpp',
             'common/RefCountObject.h',
             'common/angleutils.h',
+            'common/angleutils.cpp',
             'common/blocklayout.cpp',
             'common/blocklayout.h',
             'common/debug.cpp',