| OLD | NEW |
| 1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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 provider class, to allow using | 5 // Declaration of a Windows event trace provider class, to allow using |
| 6 // Windows Event Tracing for logging transport and control. | 6 // Windows Event Tracing for logging transport and control. |
| 7 #ifndef BASE_WIN_EVENT_TRACE_PROVIDER_H_ | 7 #ifndef BASE_WIN_EVENT_TRACE_PROVIDER_H_ |
| 8 #define BASE_WIN_EVENT_TRACE_PROVIDER_H_ | 8 #define BASE_WIN_EVENT_TRACE_PROVIDER_H_ |
| 9 #pragma once | 9 #pragma once |
| 10 | 10 |
| 11 #include <windows.h> | 11 #include <windows.h> |
| 12 #include <wmistr.h> | 12 #include <wmistr.h> |
| 13 #include <evntrace.h> | 13 #include <evntrace.h> |
| 14 | 14 |
| 15 #include "base/base_api.h" | 15 #include "base/base_export.h" |
| 16 #include "base/basictypes.h" | 16 #include "base/basictypes.h" |
| 17 | 17 |
| 18 namespace base { | 18 namespace base { |
| 19 namespace win { | 19 namespace win { |
| 20 | 20 |
| 21 typedef GUID EtwEventClass; | 21 typedef GUID EtwEventClass; |
| 22 typedef UCHAR EtwEventType; | 22 typedef UCHAR EtwEventType; |
| 23 typedef UCHAR EtwEventLevel; | 23 typedef UCHAR EtwEventLevel; |
| 24 typedef USHORT EtwEventVersion; | 24 typedef USHORT EtwEventVersion; |
| 25 typedef ULONG EtwEventFlags; | 25 typedef ULONG EtwEventFlags; |
| (...skipping 49 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 75 }; | 75 }; |
| 76 | 76 |
| 77 // Trace provider with Event Tracing for Windows. The trace provider | 77 // Trace provider with Event Tracing for Windows. The trace provider |
| 78 // registers with ETW by its name which is a GUID. ETW calls back to | 78 // registers with ETW by its name which is a GUID. ETW calls back to |
| 79 // the object whenever the trace level or enable flags for this provider | 79 // the object whenever the trace level or enable flags for this provider |
| 80 // name changes. | 80 // name changes. |
| 81 // Users of this class can test whether logging is currently enabled at | 81 // Users of this class can test whether logging is currently enabled at |
| 82 // a particular trace level, and whether particular enable flags are set, | 82 // a particular trace level, and whether particular enable flags are set, |
| 83 // before other resources are consumed to generate and issue the log | 83 // before other resources are consumed to generate and issue the log |
| 84 // messages themselves. | 84 // messages themselves. |
| 85 class BASE_API EtwTraceProvider { | 85 class BASE_EXPORT EtwTraceProvider { |
| 86 public: | 86 public: |
| 87 // Creates an event trace provider identified by provider_name, which | 87 // Creates an event trace provider identified by provider_name, which |
| 88 // will be the name registered with Event Tracing for Windows (ETW). | 88 // will be the name registered with Event Tracing for Windows (ETW). |
| 89 explicit EtwTraceProvider(const GUID& provider_name); | 89 explicit EtwTraceProvider(const GUID& provider_name); |
| 90 | 90 |
| 91 // Creates an unnamed event trace provider, the provider must be given | 91 // Creates an unnamed event trace provider, the provider must be given |
| 92 // a name before registration. | 92 // a name before registration. |
| 93 EtwTraceProvider(); | 93 EtwTraceProvider(); |
| 94 virtual ~EtwTraceProvider(); | 94 virtual ~EtwTraceProvider(); |
| 95 | 95 |
| (...skipping 71 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 167 // RegisterTraceGuids. Non-const, because that's how the API needs it. | 167 // RegisterTraceGuids. Non-const, because that's how the API needs it. |
| 168 static TRACE_GUID_REGISTRATION obligatory_guid_registration_; | 168 static TRACE_GUID_REGISTRATION obligatory_guid_registration_; |
| 169 | 169 |
| 170 DISALLOW_COPY_AND_ASSIGN(EtwTraceProvider); | 170 DISALLOW_COPY_AND_ASSIGN(EtwTraceProvider); |
| 171 }; | 171 }; |
| 172 | 172 |
| 173 } // namespace win | 173 } // namespace win |
| 174 } // namespace base | 174 } // namespace base |
| 175 | 175 |
| 176 #endif // BASE_WIN_EVENT_TRACE_PROVIDER_H_ | 176 #endif // BASE_WIN_EVENT_TRACE_PROVIDER_H_ |
| OLD | NEW |