summaryrefslogtreecommitdiffstats
path: root/base/debug/trace_event_win.cc
diff options
context:
space:
mode:
authorscheib@chromium.org <scheib@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2011-05-06 20:04:13 +0000
committerscheib@chromium.org <scheib@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2011-05-06 20:04:13 +0000
commit820d851f56e3712a2f9ac7db545601d1b0355718 (patch)
tree18f4af5173da3f78086b409fa4ae9ceefb3f9f71 /base/debug/trace_event_win.cc
parent91c3c300069d27c6ec8749636fec1c4c9018b29f (diff)
downloadchromium_src-820d851f56e3712a2f9ac7db545601d1b0355718.zip
chromium_src-820d851f56e3712a2f9ac7db545601d1b0355718.tar.gz
chromium_src-820d851f56e3712a2f9ac7db545601d1b0355718.tar.bz2
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 Review URL: http://codereview.chromium.org/6862002 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@84486 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'base/debug/trace_event_win.cc')
-rw-r--r--base/debug/trace_event_win.cc47
1 files changed, 24 insertions, 23 deletions
diff --git a/base/debug/trace_event_win.cc b/base/debug/trace_event_win.cc
index 4929944..bba4713 100644
--- a/base/debug/trace_event_win.cc
+++ b/base/debug/trace_event_win.cc
@@ -1,7 +1,6 @@
// Copyright (c) 2011 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
-
#include "base/debug/trace_event_win.h"
#include "base/logging.h"
@@ -27,24 +26,26 @@ const GUID kTraceEventClass64 = {
0x97be602d, 0x2930, 0x4ac3, 0x80, 0x46, 0xb6, 0x76, 0x3b, 0x63, 0x1d, 0xfe};
-TraceLog::TraceLog() : EtwTraceProvider(kChromeTraceProviderName) {
+TraceEventETWProvider::TraceEventETWProvider() :
+ EtwTraceProvider(kChromeTraceProviderName) {
Register();
}
-TraceLog* TraceLog::GetInstance() {
- return Singleton<TraceLog, StaticMemorySingletonTraits<TraceLog> >::get();
+TraceEventETWProvider* TraceEventETWProvider::GetInstance() {
+ return Singleton<TraceEventETWProvider,
+ StaticMemorySingletonTraits<TraceEventETWProvider> >::get();
}
-bool TraceLog::StartTracing() {
+bool TraceEventETWProvider::StartTracing() {
return true;
}
-void TraceLog::TraceEvent(const char* name,
- size_t name_len,
- EventType type,
- const void* id,
- const char* extra,
- size_t extra_len) {
+void TraceEventETWProvider::TraceEvent(const char* name,
+ size_t name_len,
+ TraceEventPhase type,
+ const void* id,
+ const char* extra,
+ size_t extra_len) {
// Make sure we don't touch NULL.
if (name == NULL)
name = "";
@@ -53,14 +54,14 @@ void TraceLog::TraceEvent(const char* name,
EtwEventType etw_type = 0;
switch (type) {
- case TraceLog::EVENT_BEGIN:
+ case TRACE_EVENT_PHASE_BEGIN:
etw_type = kTraceEventTypeBegin;
break;
- case TraceLog::EVENT_END:
+ case TRACE_EVENT_PHASE_END:
etw_type = kTraceEventTypeEnd;
break;
- case TraceLog::EVENT_INSTANT:
+ case TRACE_EVENT_PHASE_INSTANT:
etw_type = kTraceEventTypeInstant;
break;
@@ -93,13 +94,13 @@ void TraceLog::TraceEvent(const char* name,
Log(event.get());
}
-void TraceLog::Trace(const char* name,
- size_t name_len,
- EventType type,
- const void* id,
- const char* extra,
- size_t extra_len) {
- TraceLog* provider = TraceLog::GetInstance();
+void TraceEventETWProvider::Trace(const char* name,
+ size_t name_len,
+ TraceEventPhase type,
+ const void* id,
+ const char* extra,
+ size_t extra_len) {
+ TraceEventETWProvider* provider = TraceEventETWProvider::GetInstance();
if (provider && provider->IsTracing()) {
// Compute the name & extra lengths if not supplied already.
if (name_len == -1)
@@ -111,8 +112,8 @@ void TraceLog::Trace(const char* name,
}
}
-void TraceLog::Resurrect() {
- StaticMemorySingletonTraits<TraceLog>::Resurrect();
+void TraceEventETWProvider::Resurrect() {
+ StaticMemorySingletonTraits<TraceEventETWProvider>::Resurrect();
}
} // namespace debug