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

Unified Diff: base/debug/trace_event_win.h

Issue 6933035: Revert 84284 - Merge gpu_trace_event back into base/debug/trace_event.Initial land attempt at htt... (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: Created 9 years, 8 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
« no previous file with comments | « base/debug/trace_event_unittest.cc ('k') | base/debug/trace_event_win.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: base/debug/trace_event_win.h
===================================================================
--- base/debug/trace_event_win.h (revision 84291)
+++ base/debug/trace_event_win.h (working copy)
@@ -10,9 +10,29 @@
#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;
@@ -22,8 +42,14 @@
// This EtwTraceProvider subclass implements ETW logging
// for the macros above on Windows.
-class BASE_API TraceEventETWProvider : public base::win::EtwTraceProvider {
+class BASE_API TraceLog : 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();
@@ -37,14 +63,14 @@
// be used for length.
static void Trace(const char* name,
size_t name_len,
- TraceEventPhase type,
+ EventType 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,
- TraceEventPhase type,
+ EventType type,
const void* id,
const std::string& extra) {
return Trace(name, -1, type, id, extra.c_str(), extra.length());
@@ -53,7 +79,7 @@
// Allows passing extra as a const char* to avoid constructing temporary
// std::string instances where not needed.
static void Trace(const char* name,
- TraceEventPhase type,
+ EventType type,
const void* id,
const char* extra) {
return Trace(name, -1, type, id, extra, -1);
@@ -61,7 +87,7 @@
// Retrieves the singleton.
// Note that this may return NULL post-AtExit processing.
- static TraceEventETWProvider* GetInstance();
+ static TraceLog* GetInstance();
// Returns true iff tracing is turned on.
bool IsTracing() {
@@ -75,7 +101,7 @@
// string will be used.
void TraceEvent(const char* name,
size_t name_len,
- TraceEventPhase type,
+ EventType type,
const void* id,
const char* extra,
size_t extra_len);
@@ -86,10 +112,10 @@
private:
// Ensure only the provider can construct us.
- friend struct StaticMemorySingletonTraits<TraceEventETWProvider>;
- TraceEventETWProvider();
+ friend struct StaticMemorySingletonTraits<TraceLog>;
+ TraceLog();
- DISALLOW_COPY_AND_ASSIGN(TraceEventETWProvider);
+ DISALLOW_COPY_AND_ASSIGN(TraceLog);
};
// The ETW trace provider GUID.
« no previous file with comments | « base/debug/trace_event_unittest.cc ('k') | base/debug/trace_event_win.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698