Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(2014)

Unified Diff: base/debug/trace_event_win.h

Issue 6551019: Trace_event upgrades (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: More gooder js thanks to arv. Created 9 years, 10 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: base/debug/trace_event_win.h
diff --git a/base/debug/trace_event_win.h b/base/debug/trace_event_win.h
index a1c79ba0d31c90284f180a894271934d3f0adf69..dea71892a22d04f72f38705e81a79e6280f45c35 100644
--- a/base/debug/trace_event_win.h
+++ b/base/debug/trace_event_win.h
@@ -8,29 +8,9 @@
#pragma once
#include <string>
+#include "base/debug/trace_event.h"
#include "base/win/event_trace_provider.h"
-#define TRACE_EVENT_BEGIN(name, id, extra) \
- base::debug::TraceLog::Trace( \
- name, \
- base::debug::TraceLog::EVENT_BEGIN, \
- reinterpret_cast<const void*>(id), \
- extra);
-
-#define TRACE_EVENT_END(name, id, extra) \
- base::debug::TraceLog::Trace( \
- name, \
- base::debug::TraceLog::EVENT_END, \
- reinterpret_cast<const void*>(id), \
- extra);
-
-#define TRACE_EVENT_INSTANT(name, id, extra) \
- base::debug::TraceLog::Trace( \
- name, \
- base::debug::TraceLog::EVENT_INSTANT, \
- reinterpret_cast<const void*>(id), \
- extra);
-
// Fwd.
template <typename Type>
struct StaticMemorySingletonTraits;
@@ -40,14 +20,8 @@ namespace debug {
// This EtwTraceProvider subclass implements ETW logging
// for the macros above on Windows.
-class TraceLog : public base::win::EtwTraceProvider {
+class TraceEventETWProvider : public base::win::EtwTraceProvider {
public:
- enum EventType {
- EVENT_BEGIN,
- EVENT_END,
- EVENT_INSTANT
- };
-
// Start logging trace events.
// This is a noop in this implementation.
static bool StartTracing();
@@ -61,14 +35,14 @@ class TraceLog : public base::win::EtwTraceProvider {
// be used for length.
static void Trace(const char* name,
size_t name_len,
- EventType type,
+ TraceEventPhase type,
const void* id,
const char* extra,
size_t extra_len);
// Allows passing extra as a std::string for convenience.
static void Trace(const char* name,
- EventType type,
+ TraceEventPhase type,
const void* id,
const std::string& extra) {
return Trace(name, -1, type, id, extra.c_str(), extra.length());
@@ -77,7 +51,7 @@ class TraceLog : public base::win::EtwTraceProvider {
// Allows passing extra as a const char* to avoid constructing temporary
// std::string instances where not needed.
static void Trace(const char* name,
- EventType type,
+ TraceEventPhase type,
const void* id,
const char* extra) {
return Trace(name, -1, type, id, extra, -1);
@@ -85,7 +59,7 @@ class TraceLog : public base::win::EtwTraceProvider {
// Retrieves the singleton.
// Note that this may return NULL post-AtExit processing.
- static TraceLog* GetInstance();
+ static TraceEventETWProvider* GetInstance();
// Returns true iff tracing is turned on.
bool IsTracing() {
@@ -99,7 +73,7 @@ class TraceLog : public base::win::EtwTraceProvider {
// string will be used.
void TraceEvent(const char* name,
size_t name_len,
- EventType type,
+ TraceEventPhase type,
const void* id,
const char* extra,
size_t extra_len);
@@ -110,10 +84,10 @@ class TraceLog : public base::win::EtwTraceProvider {
private:
// Ensure only the provider can construct us.
- friend struct StaticMemorySingletonTraits<TraceLog>;
- TraceLog();
+ friend struct StaticMemorySingletonTraits<TraceEventETWProvider>;
+ TraceEventETWProvider();
- DISALLOW_COPY_AND_ASSIGN(TraceLog);
+ DISALLOW_COPY_AND_ASSIGN(TraceEventETWProvider);
};
// The ETW trace provider GUID.

Powered by Google App Engine
This is Rietveld 408576698