summaryrefslogtreecommitdiffstats
path: root/base/debug/trace_event_win.h
diff options
context:
space:
mode:
Diffstat (limited to 'base/debug/trace_event_win.h')
-rw-r--r--base/debug/trace_event_win.h46
1 files changed, 10 insertions, 36 deletions
diff --git a/base/debug/trace_event_win.h b/base/debug/trace_event_win.h
index 9049bdb..6e6bcb4 100644
--- a/base/debug/trace_event_win.h
+++ b/base/debug/trace_event_win.h
@@ -10,29 +10,9 @@
#include <string>
#include "base/base_api.h"
+#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;
@@ -42,14 +22,8 @@ namespace debug {
// This EtwTraceProvider subclass implements ETW logging
// for the macros above on Windows.
-class BASE_API TraceLog : public base::win::EtwTraceProvider {
+class BASE_API 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();
@@ -63,14 +37,14 @@ class BASE_API 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());
@@ -79,7 +53,7 @@ class BASE_API 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);
@@ -87,7 +61,7 @@ class BASE_API 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() {
@@ -101,7 +75,7 @@ class BASE_API 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);
@@ -112,10 +86,10 @@ class BASE_API 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.