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

Side by Side Diff: base/debug/trace_event_win.h

Issue 4517004: Move Windows-specific Event Tracing for Windows implementation to base/win. ... (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: Fixed another ETW user in Chrome Frame Created 10 years, 1 month 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 unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « base/base.gypi ('k') | base/debug/trace_event_win.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2010 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 // This file contains the Windows-specific declarations for trace_event.h. 5 // This file contains the Windows-specific declarations for trace_event.h.
6 #ifndef BASE_DEBUG_TRACE_EVENT_WIN_H_ 6 #ifndef BASE_DEBUG_TRACE_EVENT_WIN_H_
7 #define BASE_DEBUG_TRACE_EVENT_WIN_H_ 7 #define BASE_DEBUG_TRACE_EVENT_WIN_H_
8 #pragma once 8 #pragma once
9 9
10 #include <string> 10 #include <string>
11 #include "base/event_trace_provider_win.h" 11 #include "base/win/event_trace_provider.h"
12 12
13 #define TRACE_EVENT_BEGIN(name, id, extra) \ 13 #define TRACE_EVENT_BEGIN(name, id, extra) \
14 base::debug::TraceLog::Trace( \ 14 base::debug::TraceLog::Trace( \
15 name, \ 15 name, \
16 base::debug::TraceLog::EVENT_BEGIN, \ 16 base::debug::TraceLog::EVENT_BEGIN, \
17 reinterpret_cast<const void*>(id), \ 17 reinterpret_cast<const void*>(id), \
18 extra); 18 extra);
19 19
20 #define TRACE_EVENT_END(name, id, extra) \ 20 #define TRACE_EVENT_END(name, id, extra) \
21 base::debug::TraceLog::Trace( \ 21 base::debug::TraceLog::Trace( \
(...skipping 11 matching lines...) Expand all
33 33
34 // Fwd. 34 // Fwd.
35 template <typename Type> 35 template <typename Type>
36 struct StaticMemorySingletonTraits; 36 struct StaticMemorySingletonTraits;
37 37
38 namespace base { 38 namespace base {
39 namespace debug { 39 namespace debug {
40 40
41 // This EtwTraceProvider subclass implements ETW logging 41 // This EtwTraceProvider subclass implements ETW logging
42 // for the macros above on Windows. 42 // for the macros above on Windows.
43 class TraceLog : public EtwTraceProvider { 43 class TraceLog : public base::win::EtwTraceProvider {
44 public: 44 public:
45 enum EventType { 45 enum EventType {
46 EVENT_BEGIN, 46 EVENT_BEGIN,
47 EVENT_END, 47 EVENT_END,
48 EVENT_INSTANT 48 EVENT_INSTANT
49 }; 49 };
50 50
51 // Start logging trace events. 51 // Start logging trace events.
52 // This is a noop in this implementation. 52 // This is a noop in this implementation.
53 static bool StartTracing(); 53 static bool StartTracing();
(...skipping 65 matching lines...) Expand 10 before | Expand all | Expand 10 after
119 // The ETW trace provider GUID. 119 // The ETW trace provider GUID.
120 extern const GUID kChromeTraceProviderName; 120 extern const GUID kChromeTraceProviderName;
121 121
122 // The ETW event class GUID for 32 bit events. 122 // The ETW event class GUID for 32 bit events.
123 extern const GUID kTraceEventClass32; 123 extern const GUID kTraceEventClass32;
124 124
125 // The ETW event class GUID for 64 bit events. 125 // The ETW event class GUID for 64 bit events.
126 extern const GUID kTraceEventClass64; 126 extern const GUID kTraceEventClass64;
127 127
128 // The ETW event types, IDs 0x00-0x09 are reserved, so start at 0x10. 128 // The ETW event types, IDs 0x00-0x09 are reserved, so start at 0x10.
129 const EtwEventType kTraceEventTypeBegin = 0x10; 129 const base::win::EtwEventType kTraceEventTypeBegin = 0x10;
130 const EtwEventType kTraceEventTypeEnd = 0x11; 130 const base::win::EtwEventType kTraceEventTypeEnd = 0x11;
131 const EtwEventType kTraceEventTypeInstant = 0x12; 131 const base::win::EtwEventType kTraceEventTypeInstant = 0x12;
132 132
133 // If this flag is set in enable flags 133 // If this flag is set in enable flags
134 enum TraceEventFlags { 134 enum TraceEventFlags {
135 CAPTURE_STACK_TRACE = 0x0001, 135 CAPTURE_STACK_TRACE = 0x0001,
136 }; 136 };
137 137
138 // The event format consists of: 138 // The event format consists of:
139 // The "name" string as a zero-terminated ASCII string. 139 // The "name" string as a zero-terminated ASCII string.
140 // The id pointer in the machine bitness. 140 // The id pointer in the machine bitness.
141 // The "extra" string as a zero-terminated ASCII string. 141 // The "extra" string as a zero-terminated ASCII string.
142 // Optionally the stack trace, consisting of a DWORD "depth", followed 142 // Optionally the stack trace, consisting of a DWORD "depth", followed
143 // by an array of void* (machine bitness) of length "depth". 143 // by an array of void* (machine bitness) of length "depth".
144 144
145 // Forward decl. 145 // Forward decl.
146 struct TraceLogSingletonTraits; 146 struct TraceLogSingletonTraits;
147 147
148 } // nemspace debug 148 } // nemspace debug
149 } // namespace base 149 } // namespace base
150 150
151 #endif // BASE_DEBUG_TRACE_EVENT_WIN_H_ 151 #endif // BASE_DEBUG_TRACE_EVENT_WIN_H_
OLDNEW
« no previous file with comments | « base/base.gypi ('k') | base/debug/trace_event_win.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698