Merge gpu_trace_event back into base/debug/trace_event.
Initial land attempt at http://codereview.chromium.org/6551019/
gpu_trace_event fork at http://codereview.chromium.org/6691013

- gpu_trace_event renamed to base/debug/trace_event and modified as appropriate for base::debug
- Unit Tests implemented for trace_event
- gpu_common library removed (was added only for gpu_trace_event)
- Existing calls to trace_event suffixed with _ETW to make ETW calls (see decisions and incremental plans at end of 6551019)
- GPU trace calls renamed to new calls.
- Tracing switch removed from test_shell, as linux log file support removed.

BUG=79509
TEST=trace_event_win_unittest and about:gpu

Committed: http://src.chromium.org/viewvc/chrome?view=rev&revision=84284

Committed: http://src.chromium.org/viewvc/chrome?view=rev&revision=84486

Review URL: http://codereview.chromium.org/6862002

git-svn-id: svn://svn.chromium.org/chrome/trunk/src@84739 0039d316-1c4b-4281-b951-d872f2087c98
diff --git a/content/browser/gpu/gpu_process_host.cc b/content/browser/gpu/gpu_process_host.cc
index 2330f390..a54fe75 100644
--- a/content/browser/gpu/gpu_process_host.cc
+++ b/content/browser/gpu/gpu_process_host.cc
@@ -5,6 +5,7 @@
 #include "content/browser/gpu/gpu_process_host.h"
 
 #include "base/command_line.h"
+#include "base/debug/trace_event.h"
 #include "base/memory/ref_counted.h"
 #include "base/metrics/histogram.h"
 #include "base/process_util.h"
@@ -18,7 +19,6 @@
 #include "content/browser/renderer_host/render_widget_host.h"
 #include "content/browser/renderer_host/render_widget_host_view.h"
 #include "content/common/gpu/gpu_messages.h"
-#include "gpu/common/gpu_trace_event.h"
 #include "ipc/ipc_channel_handle.h"
 #include "ipc/ipc_switches.h"
 #include "media/base/media_switches.h"
@@ -286,7 +286,7 @@
     int renderer_id,
     EstablishChannelCallback *callback) {
   DCHECK(CalledOnValidThread());
-  GPU_TRACE_EVENT0("gpu", "GpuProcessHostUIShim::EstablishGpuChannel");
+  TRACE_EVENT0("gpu", "GpuProcessHostUIShim::EstablishGpuChannel");
   linked_ptr<EstablishChannelCallback> wrapped_callback(callback);
 
   // If GPU features are already blacklisted, no need to establish the channel.
diff --git a/content/browser/gpu/gpu_process_host_ui_shim.cc b/content/browser/gpu/gpu_process_host_ui_shim.cc
index 5fcf8805..0d50d68 100644
--- a/content/browser/gpu/gpu_process_host_ui_shim.cc
+++ b/content/browser/gpu/gpu_process_host_ui_shim.cc
@@ -16,7 +16,6 @@
 #include "content/browser/renderer_host/render_widget_host_view.h"
 #include "content/common/content_switches.h"
 #include "content/common/gpu/gpu_messages.h"
-#include "gpu/common/gpu_trace_event.h"
 
 #if defined(OS_LINUX)
 // These two #includes need to come after gpu_messages.h.
diff --git a/content/browser/renderer_host/render_widget_host.cc b/content/browser/renderer_host/render_widget_host.cc
index 4b462dc..4fab721 100644
--- a/content/browser/renderer_host/render_widget_host.cc
+++ b/content/browser/renderer_host/render_widget_host.cc
@@ -6,6 +6,7 @@
 
 #include "base/auto_reset.h"
 #include "base/command_line.h"
+#include "base/debug/trace_event.h"
 #include "base/message_loop.h"
 #include "base/metrics/histogram.h"
 #include "chrome/browser/accessibility/browser_accessibility_state.h"
@@ -22,7 +23,6 @@
 #include "content/common/notification_service.h"
 #include "content/common/result_codes.h"
 #include "content/common/view_messages.h"
-#include "gpu/common/gpu_trace_event.h"
 #include "third_party/WebKit/Source/WebKit/chromium/public/WebCompositionUnderline.h"
 #include "ui/base/keycodes/keyboard_codes.h"
 #include "webkit/glue/webcursor.h"
@@ -837,7 +837,7 @@
 
 void RenderWidgetHost::OnMsgUpdateRect(
     const ViewHostMsg_UpdateRect_Params& params) {
-  GPU_TRACE_EVENT0("renderer_host", "RenderWidgetHost::OnMsgUpdateRect");
+  TRACE_EVENT0("renderer_host", "RenderWidgetHost::OnMsgUpdateRect");
   TimeTicks paint_start = TimeTicks::Now();
 
   NotificationService::current()->Notify(
diff --git a/content/browser/trace_controller.cc b/content/browser/trace_controller.cc
index 5bf2efab..f04f4b24 100644
--- a/content/browser/trace_controller.cc
+++ b/content/browser/trace_controller.cc
@@ -4,11 +4,12 @@
 
 #include "content/browser/trace_controller.h"
 
+#include "base/bind.h"
+#include "base/debug/trace_event.h"
 #include "base/task.h"
 #include "content/browser/browser_message_filter.h"
 #include "content/browser/trace_message_filter.h"
 #include "content/common/child_process_messages.h"
-#include "gpu/common/gpu_trace_event.h"
 
 
 TraceController::TraceController() :
@@ -17,12 +18,14 @@
     pending_bpf_ack_count_(0),
     maximum_bpf_(0.0f),
     is_tracing_(false) {
-  gpu::TraceLog::GetInstance()->SetOutputCallback(
-      NewCallback(this, &TraceController::OnTraceDataCollected));
+  base::debug::TraceLog::GetInstance()->SetOutputCallback(
+      base::Bind(&TraceController::OnTraceDataCollected,
+                 base::Unretained(this)));
 }
 
 TraceController::~TraceController() {
-  gpu::TraceLog::GetInstance()->SetOutputCallback(NULL);
+  if (base::debug::TraceLog* trace_log = base::debug::TraceLog::GetInstance())
+    trace_log->SetOutputCallback(base::debug::TraceLog::OutputCallback());
 }
 
 //static
@@ -41,7 +44,7 @@
 
   // Enable tracing
   is_tracing_ = true;
-  gpu::TraceLog::GetInstance()->SetEnabled(true);
+  base::debug::TraceLog::GetInstance()->SetEnabled(true);
 
   // Notify all child processes.
   for (FilterMap::iterator it = filters_.begin(); it != filters_.end(); ++it) {
@@ -92,7 +95,7 @@
   // Handle special case of zero child processes.
   if (pending_bpf_ack_count_ == 1) {
     // Ack asynchronously now, because we don't have any children to wait for.
-    float bpf = gpu::TraceLog::GetInstance()->GetBufferPercentFull();
+    float bpf = base::debug::TraceLog::GetInstance()->GetBufferPercentFull();
     BrowserThread::PostTask(BrowserThread::UI, FROM_HERE,
         NewRunnableMethod(this,
                           &TraceController::OnTraceBufferPercentFullReply,
@@ -161,7 +164,7 @@
     // called with the last of the local trace data. Since we are on the UI
     // thread, the call to OnTraceDataCollected will be synchronous, so we can
     // immediately call OnEndTracingComplete below.
-    gpu::TraceLog::GetInstance()->SetEnabled(false);
+    base::debug::TraceLog::GetInstance()->SetEnabled(false);
 
     // Trigger callback if one is set.
     if (subscriber_) {
@@ -179,17 +182,21 @@
   }
 }
 
-void TraceController::OnTraceDataCollected(const std::string& data) {
+void TraceController::OnTraceDataCollected(
+    const scoped_refptr<base::debug::TraceLog::RefCountedString>&
+        json_events_str_ptr) {
   // OnTraceDataCollected may be called from any browser thread, either by the
   // local event trace system or from child processes via TraceMessageFilter.
   if (!BrowserThread::CurrentlyOn(BrowserThread::UI)) {
     BrowserThread::PostTask(BrowserThread::UI, FROM_HERE,
-        NewRunnableMethod(this, &TraceController::OnTraceDataCollected, data));
+        NewRunnableMethod(this,
+                          &TraceController::OnTraceDataCollected,
+                          json_events_str_ptr));
     return;
   }
 
   if (subscriber_)
-    subscriber_->OnTraceDataCollected(data);
+    subscriber_->OnTraceDataCollected(json_events_str_ptr->data);
 }
 
 void TraceController::OnTraceBufferFull() {
@@ -229,7 +236,7 @@
   if (pending_bpf_ack_count_ == 1) {
     // The last ack represents local trace, so we need to ack it now. Note that
     // this code only executes if there were child processes.
-    float bpf = gpu::TraceLog::GetInstance()->GetBufferPercentFull();
+    float bpf = base::debug::TraceLog::GetInstance()->GetBufferPercentFull();
     BrowserThread::PostTask(BrowserThread::UI, FROM_HERE,
         NewRunnableMethod(this,
                           &TraceController::OnTraceBufferPercentFullReply,
diff --git a/content/browser/trace_controller.h b/content/browser/trace_controller.h
index 4308e823..33e14c6e 100644
--- a/content/browser/trace_controller.h
+++ b/content/browser/trace_controller.h
@@ -8,6 +8,7 @@
 #include <set>
 #include <string>
 
+#include "base/debug/trace_event.h"
 #include "base/memory/ref_counted.h"
 #include "base/memory/singleton.h"
 #include "base/task.h"
@@ -110,7 +111,9 @@
   void AddFilter(TraceMessageFilter* filter);
   void RemoveFilter(TraceMessageFilter* filter);
   void OnEndTracingAck();
-  void OnTraceDataCollected(const std::string& data);
+  void OnTraceDataCollected(
+      const scoped_refptr<base::debug::TraceLog::RefCountedString>&
+          json_events_str_ptr);
   void OnTraceBufferFull();
   void OnTraceBufferPercentFullReply(float percent_full);
 
diff --git a/content/browser/trace_message_filter.cc b/content/browser/trace_message_filter.cc
index e23fc26..a1bd1d0e 100644
--- a/content/browser/trace_message_filter.cc
+++ b/content/browser/trace_message_filter.cc
@@ -82,7 +82,8 @@
 }
 
 void TraceMessageFilter::OnTraceDataCollected(const std::string& data) {
-  TraceController::GetInstance()->OnTraceDataCollected(data);
+  TraceController::GetInstance()->OnTraceDataCollected(
+      make_scoped_refptr(new base::debug::TraceLog::RefCountedString(data)));
 }
 
 void TraceMessageFilter::OnTraceBufferFull() {
diff --git a/content/common/child_trace_message_filter.cc b/content/common/child_trace_message_filter.cc
index ccc2b03..629aea5 100644
--- a/content/common/child_trace_message_filter.cc
+++ b/content/common/child_trace_message_filter.cc
@@ -4,26 +4,33 @@
 
 #include "content/common/child_trace_message_filter.h"
 
+#include "base/bind.h"
+#include "base/debug/trace_event.h"
 #include "base/message_loop.h"
 #include "content/common/child_process.h"
 #include "content/common/child_process_messages.h"
-#include "gpu/common/gpu_trace_event.h"
 
 
 ChildTraceMessageFilter::ChildTraceMessageFilter() : channel_(NULL) {
 }
 
 ChildTraceMessageFilter::~ChildTraceMessageFilter() {
-  gpu::TraceLog::GetInstance()->SetOutputCallback(NULL);
-  gpu::TraceLog::GetInstance()->SetBufferFullCallback(NULL);
 }
 
 void ChildTraceMessageFilter::OnFilterAdded(IPC::Channel* channel) {
   channel_ = channel;
-  gpu::TraceLog::GetInstance()->SetOutputCallback(
-      NewCallback(this, &ChildTraceMessageFilter::OnTraceDataCollected));
-  gpu::TraceLog::GetInstance()->SetBufferFullCallback(
-      NewCallback(this, &ChildTraceMessageFilter::OnTraceBufferFull));
+  base::debug::TraceLog::GetInstance()->SetOutputCallback(
+      base::Bind(&ChildTraceMessageFilter::OnTraceDataCollected, this));
+  base::debug::TraceLog::GetInstance()->SetBufferFullCallback(
+      base::Bind(&ChildTraceMessageFilter::OnTraceBufferFull, this));
+}
+
+void ChildTraceMessageFilter::OnFilterRemoved()
+{
+  base::debug::TraceLog::GetInstance()->SetOutputCallback(
+      base::debug::TraceLog::OutputCallback());
+  base::debug::TraceLog::GetInstance()->SetBufferFullCallback(
+      base::debug::TraceLog::BufferFullCallback());
 }
 
 bool ChildTraceMessageFilter::OnMessageReceived(const IPC::Message& message) {
@@ -39,7 +46,7 @@
 }
 
 void ChildTraceMessageFilter::OnBeginTracing() {
-  gpu::TraceLog::GetInstance()->SetEnabled(true);
+  base::debug::TraceLog::GetInstance()->SetEnabled(true);
 }
 
 void ChildTraceMessageFilter::OnEndTracing() {
@@ -48,26 +55,29 @@
   // EndTracingAck below.
   // We are already on the IO thread, so it is guaranteed that
   // OnTraceDataCollected is not deferred.
-  gpu::TraceLog::GetInstance()->SetEnabled(false);
+  base::debug::TraceLog::GetInstance()->SetEnabled(false);
 
   channel_->Send(new ChildProcessHostMsg_EndTracingAck);
 }
 
 void ChildTraceMessageFilter::OnGetTraceBufferPercentFull() {
-  float bpf = gpu::TraceLog::GetInstance()->GetBufferPercentFull();
+  float bpf = base::debug::TraceLog::GetInstance()->GetBufferPercentFull();
 
   channel_->Send(new ChildProcessHostMsg_TraceBufferPercentFullReply(bpf));
 }
 
-void ChildTraceMessageFilter::OnTraceDataCollected(const std::string& data) {
+void ChildTraceMessageFilter::OnTraceDataCollected(
+    const scoped_refptr<base::debug::TraceLog::RefCountedString>&
+        json_events_str_ptr) {
   if (MessageLoop::current() != ChildProcess::current()->io_message_loop()) {
     ChildProcess::current()->io_message_loop()->PostTask(FROM_HERE,
         NewRunnableMethod(this, &ChildTraceMessageFilter::OnTraceDataCollected,
-                          data));
+                          json_events_str_ptr));
     return;
   }
 
-  channel_->Send(new ChildProcessHostMsg_TraceDataCollected(data));
+  channel_->Send(new ChildProcessHostMsg_TraceDataCollected(
+    json_events_str_ptr->data));
 }
 
 void ChildTraceMessageFilter::OnTraceBufferFull() {
diff --git a/content/common/child_trace_message_filter.h b/content/common/child_trace_message_filter.h
index ae74ff5e..705df6f1 100644
--- a/content/common/child_trace_message_filter.h
+++ b/content/common/child_trace_message_filter.h
@@ -7,6 +7,7 @@
 
 #include <string>
 
+#include "base/debug/trace_event.h"
 #include "base/process.h"
 #include "ipc/ipc_channel_proxy.h"
 
@@ -18,6 +19,7 @@
 
   // IPC::ChannelProxy::MessageFilter implementation.
   virtual void OnFilterAdded(IPC::Channel* channel);
+  virtual void OnFilterRemoved();
   virtual bool OnMessageReceived(const IPC::Message& message);
 
  private:
@@ -27,7 +29,9 @@
   void OnGetTraceBufferPercentFull();
 
   // Callback from trace subsystem.
-  void OnTraceDataCollected(const std::string& data);
+  void OnTraceDataCollected(
+      const scoped_refptr<base::debug::TraceLog::RefCountedString>&
+          json_events_str_ptr);
   void OnTraceBufferFull();
 
   IPC::Channel* channel_;
diff --git a/content/common/gpu/gpu_command_buffer_stub.cc b/content/common/gpu/gpu_command_buffer_stub.cc
index f61ebe02..f4e0ddc 100644
--- a/content/common/gpu/gpu_command_buffer_stub.cc
+++ b/content/common/gpu/gpu_command_buffer_stub.cc
@@ -5,6 +5,7 @@
 #if defined(ENABLE_GPU)
 
 #include "base/bind.h"
+#include "base/debug/trace_event.h"
 #include "base/process_util.h"
 #include "base/shared_memory.h"
 #include "build/build_config.h"
@@ -15,7 +16,6 @@
 #include "content/common/gpu/gpu_messages.h"
 #include "content/common/gpu/gpu_watchdog.h"
 #include "gpu/command_buffer/common/constants.h"
-#include "gpu/common/gpu_trace_event.h"
 #include "ui/gfx/gl/gl_context.h"
 #include "ui/gfx/gl/gl_surface.h"
 
@@ -200,7 +200,7 @@
 void GpuCommandBufferStub::OnFlush(int32 put_offset,
                                    int32 last_known_get,
                                    IPC::Message* reply_message) {
-  GPU_TRACE_EVENT0("gpu", "GpuCommandBufferStub::OnFlush");
+  TRACE_EVENT0("gpu", "GpuCommandBufferStub::OnFlush");
   gpu::CommandBuffer::State state = command_buffer_->FlushSync(put_offset,
                                                                last_known_get);
   if (state.error == gpu::error::kLostContext &&
@@ -212,7 +212,7 @@
 }
 
 void GpuCommandBufferStub::OnAsyncFlush(int32 put_offset) {
-  GPU_TRACE_EVENT0("gpu", "GpuCommandBufferStub::OnAsyncFlush");
+  TRACE_EVENT0("gpu", "GpuCommandBufferStub::OnAsyncFlush");
   command_buffer_->Flush(put_offset);
   // TODO(piman): Do this everytime the scheduler finishes processing a batch of
   // commands.
@@ -291,7 +291,7 @@
 }
 
 void GpuCommandBufferStub::OnSwapBuffers() {
-  GPU_TRACE_EVENT0("gpu", "GpuCommandBufferStub::OnSwapBuffers");
+  TRACE_EVENT0("gpu", "GpuCommandBufferStub::OnSwapBuffers");
   ReportState();
   Send(new GpuCommandBufferMsg_SwapBuffers(route_id_));
 }
diff --git a/content/renderer/command_buffer_proxy.cc b/content/renderer/command_buffer_proxy.cc
index 6a1c06c..e50f0e4a 100644
--- a/content/renderer/command_buffer_proxy.cc
+++ b/content/renderer/command_buffer_proxy.cc
@@ -4,6 +4,7 @@
 
 #include "content/renderer/command_buffer_proxy.h"
 
+#include "base/debug/trace_event.h"
 #include "base/logging.h"
 #include "base/process_util.h"
 #include "base/shared_memory.h"
@@ -14,7 +15,6 @@
 #include "content/renderer/plugin_channel_host.h"
 #include "content/renderer/render_thread.h"
 #include "gpu/command_buffer/common/cmd_buffer_common.h"
-#include "gpu/common/gpu_trace_event.h"
 #include "ui/gfx/size.h"
 
 using gpu::Buffer;
@@ -158,7 +158,7 @@
 
 gpu::CommandBuffer::State CommandBufferProxy::FlushSync(int32 put_offset,
                                                         int32 last_known_get) {
-  GPU_TRACE_EVENT0("gpu", "CommandBufferProxy::FlushSync");
+  TRACE_EVENT0("gpu", "CommandBufferProxy::FlushSync");
   if (last_known_get == last_state_.get_offset) {
     // Send will flag state with lost context if IPC fails.
     if (last_state_.error == gpu::error::kNoError) {
diff --git a/content/renderer/render_thread.cc b/content/renderer/render_thread.cc
index 9471a99a..c9a7052 100644
--- a/content/renderer/render_thread.cc
+++ b/content/renderer/render_thread.cc
@@ -137,7 +137,7 @@
 }
 
 void RenderThread::Init() {
-  TRACE_EVENT_BEGIN("RenderThread::Init", 0, "");
+  TRACE_EVENT_BEGIN_ETW("RenderThread::Init", 0, "");
 
 #if defined(OS_MACOSX)
   // On Mac, the select popups are rendered by the browser.
@@ -169,7 +169,7 @@
 
   content::GetContentClient()->renderer()->RenderThreadStarted();
 
-  TRACE_EVENT_END("RenderThread::Init", 0, "");
+  TRACE_EVENT_END_ETW("RenderThread::Init", 0, "");
 }
 
 RenderThread::~RenderThread() {
diff --git a/content/renderer/render_widget.cc b/content/renderer/render_widget.cc
index 6b190b3..2597ad6 100644
--- a/content/renderer/render_widget.cc
+++ b/content/renderer/render_widget.cc
@@ -5,6 +5,7 @@
 #include "content/renderer/render_widget.h"
 
 #include "base/command_line.h"
+#include "base/debug/trace_event.h"
 #include "base/logging.h"
 #include "base/memory/scoped_ptr.h"
 #include "base/message_loop.h"
@@ -15,7 +16,6 @@
 #include "content/renderer/render_process.h"
 #include "content/renderer/render_thread.h"
 #include "content/renderer/renderer_webkitclient_impl.h"
-#include "gpu/common/gpu_trace_event.h"
 #include "ipc/ipc_sync_message.h"
 #include "skia/ext/platform_canvas.h"
 #include "third_party/skia/include/core/SkShader.h"
@@ -305,7 +305,7 @@
 }
 
 void RenderWidget::OnUpdateRectAck() {
-  GPU_TRACE_EVENT0("renderer", "RenderWidget::OnUpdateRectAck");
+  TRACE_EVENT0("renderer", "RenderWidget::OnUpdateRectAck");
   DCHECK(update_reply_pending());
   update_reply_pending_ = false;
 
@@ -553,7 +553,7 @@
 }
 
 void RenderWidget::DoDeferredUpdate() {
-  GPU_TRACE_EVENT0("renderer", "RenderWidget::DoDeferredUpdate");
+  TRACE_EVENT0("renderer", "RenderWidget::DoDeferredUpdate");
 
   if (!webwidget_ || update_reply_pending())
     return;
diff --git a/content/renderer/renderer_gl_context.cc b/content/renderer/renderer_gl_context.cc
index 8d559c4..b0a28be 100644
--- a/content/renderer/renderer_gl_context.cc
+++ b/content/renderer/renderer_gl_context.cc
@@ -4,6 +4,7 @@
 
 #include "content/renderer/renderer_gl_context.h"
 
+#include "base/debug/trace_event.h"
 #include "base/lazy_instance.h"
 #include "base/memory/ref_counted.h"
 #include "base/memory/scoped_ptr.h"
@@ -27,7 +28,6 @@
 #include "gpu/command_buffer/client/gles2_implementation.h"
 #include "gpu/command_buffer/client/gles2_lib.h"
 #include "gpu/command_buffer/common/constants.h"
-#include "gpu/common/gpu_trace_event.h"
 #include "gpu/GLES2/gles2_command_buffer.h"
 #endif  // ENABLE_GPU
 
@@ -293,7 +293,7 @@
 }
 
 bool RendererGLContext::SwapBuffers() {
-  GPU_TRACE_EVENT0("gpu", "RendererGLContext::SwapBuffers");
+  TRACE_EVENT0("gpu", "RendererGLContext::SwapBuffers");
   // Don't request latest error status from service. Just use the locally cached
   // information from the last flush.
   if (command_buffer_->GetLastState().error != gpu::error::kNoError)
@@ -376,7 +376,7 @@
                                    const int32* attrib_list,
                                    const GURL& active_url) {
   DCHECK(size.width() >= 0 && size.height() >= 0);
-  GPU_TRACE_EVENT2("gpu", "RendererGLContext::Initialize",
+  TRACE_EVENT2("gpu", "RendererGLContext::Initialize",
                    "on_screen", onscreen, "num_pixels", size.GetArea());
 
   if (channel_->state() != GpuChannelHost::kConnected)
diff --git a/content/renderer/renderer_main.cc b/content/renderer/renderer_main.cc
index dbb0e34..e5e6984 100644
--- a/content/renderer/renderer_main.cc
+++ b/content/renderer/renderer_main.cc
@@ -129,7 +129,7 @@
 
 // mainline routine for running as the Renderer process
 int RendererMain(const MainFunctionParams& parameters) {
-  TRACE_EVENT_BEGIN("RendererMain", 0, "");
+  TRACE_EVENT_BEGIN_ETW("RendererMain", 0, "");
 
   const CommandLine& parsed_command_line = parameters.command_line_;
   base::mac::ScopedNSAutoreleasePool* pool = parameters.autorelease_pool_;
@@ -229,12 +229,12 @@
     if (run_loop) {
       if (pool)
         pool->Recycle();
-      TRACE_EVENT_BEGIN("RendererMain.START_MSG_LOOP", 0, 0);
+      TRACE_EVENT_BEGIN_ETW("RendererMain.START_MSG_LOOP", 0, 0);
       MessageLoop::current()->Run();
-      TRACE_EVENT_END("RendererMain.START_MSG_LOOP", 0, 0);
+      TRACE_EVENT_END_ETW("RendererMain.START_MSG_LOOP", 0, 0);
     }
   }
   platform.PlatformUninitialize();
-  TRACE_EVENT_END("RendererMain", 0, "");
+  TRACE_EVENT_END_ETW("RendererMain", 0, "");
   return 0;
 }