OLD | NEW |
(Empty) | |
| 1 // Copyright (c) 2015 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. |
| 4 |
| 5 // This file contains the Windows-specific exporting to ETW. |
| 6 #ifndef BASE_TRACE_EVENT_TRACE_ETW_EXPORT_H_ |
| 7 #define BASE_TRACE_EVENT_TRACE_ETW_EXPORT_H_ |
| 8 |
| 9 #include "base/base_export.h" |
| 10 #include "base/trace_event/trace_event_impl.h" |
| 11 |
| 12 // Fwd. |
| 13 template <typename Type> |
| 14 struct StaticMemorySingletonTraits; |
| 15 |
| 16 namespace base { |
| 17 namespace trace_event { |
| 18 |
| 19 class BASE_EXPORT TraceEventETWExport { |
| 20 public: |
| 21 ~TraceEventETWExport(); |
| 22 |
| 23 // Retrieves the singleton. |
| 24 // Note that this may return NULL post-AtExit processing. |
| 25 static TraceEventETWExport* GetInstance(); |
| 26 |
| 27 static void EnableETWExport(); |
| 28 static void DisableETWExport(); |
| 29 |
| 30 static bool isETWExportEnabled() { return GetInstance()->ETWExportEnabled_; } |
| 31 |
| 32 static void AddEvent( |
| 33 char phase, |
| 34 const unsigned char* category_group_enabled, |
| 35 const char* name, |
| 36 unsigned long long id, |
| 37 int num_args, |
| 38 const char** arg_names, |
| 39 const unsigned char* arg_types, |
| 40 const unsigned long long* arg_values, |
| 41 const scoped_refptr<ConvertableToTraceFormat>* convertable_values); |
| 42 |
| 43 static void AddCustomEvent(const char* name, |
| 44 char const* phase, |
| 45 const char* arg_name_1, |
| 46 const char* arg_value_1, |
| 47 const char* arg_name_2, |
| 48 const char* arg_value_2, |
| 49 const char* arg_name_3, |
| 50 const char* arg_value_3); |
| 51 |
| 52 void Resurrect(); |
| 53 |
| 54 private: |
| 55 bool ETWExportEnabled_; |
| 56 // Ensure only the provider can construct us. |
| 57 friend struct StaticMemorySingletonTraits<TraceEventETWExport>; |
| 58 TraceEventETWExport(); |
| 59 |
| 60 DISALLOW_COPY_AND_ASSIGN(TraceEventETWExport); |
| 61 }; |
| 62 |
| 63 } // namespace trace_event |
| 64 } // namespace base |
| 65 |
| 66 #endif // BASE_TRACE_EVENT_TRACE_ETW_EXPORT_H_ |
OLD | NEW |