OLD | NEW |
1 // Copyright (c) 2009 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2009 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 // Declaration of a Windows event trace controller class. | 5 // Declaration of a Windows event trace controller class. |
6 // The controller takes care of creating and manipulating event trace | 6 // The controller takes care of creating and manipulating event trace |
7 // sessions. | 7 // sessions. |
8 // | 8 // |
9 // Event tracing for Windows is a system-provided service that provides | 9 // Event tracing for Windows is a system-provided service that provides |
10 // logging control and high-performance transport for generic, binary trace | 10 // logging control and high-performance transport for generic, binary trace |
11 // events. Event trace providers register with the system by their name, | 11 // events. Event trace providers register with the system by their name, |
12 // which is a GUID, and can from that point forward receive callbacks that | 12 // which is a GUID, and can from that point forward receive callbacks that |
13 // start or end tracing and that change their trace level and enable mask. | 13 // start or end tracing and that change their trace level and enable mask. |
14 // | 14 // |
15 // A trace controller can create an event tracing session, which either | 15 // A trace controller can create an event tracing session, which either |
16 // sends events to a binary file, or to a realtime consumer, or both. | 16 // sends events to a binary file, or to a realtime consumer, or both. |
17 // | 17 // |
18 // A trace consumer consumes events from zero or one realtime session, | 18 // A trace consumer consumes events from zero or one realtime session, |
19 // as well as potentially from multiple binary trace files. | 19 // as well as potentially from multiple binary trace files. |
20 #ifndef BASE_EVENT_TRACE_CONTROLLER_WIN_H_ | 20 #ifndef BASE_WIN_EVENT_TRACE_CONTROLLER_H_ |
21 #define BASE_EVENT_TRACE_CONTROLLER_WIN_H_ | 21 #define BASE_WIN_EVENT_TRACE_CONTROLLER_H_ |
22 #pragma once | 22 #pragma once |
23 | 23 |
24 #include <windows.h> | 24 #include <windows.h> |
25 #include <wmistr.h> | 25 #include <wmistr.h> |
26 #include <evntrace.h> | 26 #include <evntrace.h> |
27 #include <string> | 27 #include <string> |
28 #include "base/basictypes.h" | 28 #include "base/basictypes.h" |
29 | 29 |
| 30 namespace base { |
| 31 namespace win { |
| 32 |
30 // Utility class to make it easier to work with EVENT_TRACE_PROPERTIES. | 33 // Utility class to make it easier to work with EVENT_TRACE_PROPERTIES. |
31 // The EVENT_TRACE_PROPERTIES structure contains information about an | 34 // The EVENT_TRACE_PROPERTIES structure contains information about an |
32 // event tracing session. | 35 // event tracing session. |
33 class EtwTraceProperties { | 36 class EtwTraceProperties { |
34 public: | 37 public: |
35 EtwTraceProperties(); | 38 EtwTraceProperties(); |
36 | 39 |
37 EVENT_TRACE_PROPERTIES* get() { | 40 EVENT_TRACE_PROPERTIES* get() { |
38 return &properties_; | 41 return &properties_; |
39 } | 42 } |
(...skipping 94 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
134 TRACEHANDLE session() const { return session_; } | 137 TRACEHANDLE session() const { return session_; } |
135 const wchar_t* session_name() const { return session_name_.c_str(); } | 138 const wchar_t* session_name() const { return session_name_.c_str(); } |
136 | 139 |
137 private: | 140 private: |
138 std::wstring session_name_; | 141 std::wstring session_name_; |
139 TRACEHANDLE session_; | 142 TRACEHANDLE session_; |
140 | 143 |
141 DISALLOW_COPY_AND_ASSIGN(EtwTraceController); | 144 DISALLOW_COPY_AND_ASSIGN(EtwTraceController); |
142 }; | 145 }; |
143 | 146 |
144 #endif // BASE_EVENT_TRACE_CONTROLLER_WIN_H_ | 147 } // namespace win |
| 148 } // namespace base |
| 149 |
| 150 #endif // BASE_WIN_EVENT_TRACE_CONTROLLER_H_ |
OLD | NEW |