OLD | NEW |
1 // Copyright 2015 The Chromium Authors. All rights reserved. | 1 // Copyright 2015 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 exporting to ETW. | 5 // This file contains the Windows-specific exporting to ETW. |
6 #ifndef BASE_TRACE_EVENT_TRACE_EVENT_ETW_EXPORT_WIN_H_ | 6 #ifndef BASE_TRACE_EVENT_TRACE_EVENT_ETW_EXPORT_WIN_H_ |
7 #define BASE_TRACE_EVENT_TRACE_EVENT_ETW_EXPORT_WIN_H_ | 7 #define BASE_TRACE_EVENT_TRACE_EVENT_ETW_EXPORT_WIN_H_ |
8 | 8 |
9 #include <map> | 9 #include <map> |
10 | 10 |
11 #include "base/base_export.h" | 11 #include "base/base_export.h" |
12 #include "base/strings/string_piece.h" | 12 #include "base/strings/string_piece.h" |
13 #include "base/trace_event/trace_event_impl.h" | 13 #include "base/trace_event/trace_event_impl.h" |
14 | 14 |
15 // Fwd. | 15 // Fwd. |
16 template <typename Type> | 16 template <typename Type> |
17 struct StaticMemorySingletonTraits; | 17 struct StaticMemorySingletonTraits; |
18 | 18 |
19 namespace { | |
20 class ETWKeywordUpdateThread; | |
21 } | |
22 | |
23 namespace base { | 19 namespace base { |
24 namespace trace_event { | 20 namespace trace_event { |
25 | 21 |
26 class BASE_EXPORT TraceEventETWExport { | 22 class BASE_EXPORT TraceEventETWExport { |
27 public: | 23 public: |
28 ~TraceEventETWExport(); | 24 ~TraceEventETWExport(); |
29 | 25 |
30 // Retrieves the singleton. | 26 // Retrieves the singleton. |
31 // Note that this may return NULL post-AtExit processing. | 27 // Note that this may return NULL post-AtExit processing. |
32 static TraceEventETWExport* GetInstance(); | 28 static TraceEventETWExport* GetInstance(); |
(...skipping 32 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
65 const char* arg_name_3, | 61 const char* arg_name_3, |
66 const char* arg_value_3); | 62 const char* arg_value_3); |
67 | 63 |
68 // Returns true if any category in the group is enabled. | 64 // Returns true if any category in the group is enabled. |
69 static bool IsCategoryGroupEnabled(const char* category_group_name); | 65 static bool IsCategoryGroupEnabled(const char* category_group_name); |
70 | 66 |
71 private: | 67 private: |
72 // Ensure only the provider can construct us. | 68 // Ensure only the provider can construct us. |
73 friend struct StaticMemorySingletonTraits<TraceEventETWExport>; | 69 friend struct StaticMemorySingletonTraits<TraceEventETWExport>; |
74 // To have access to UpdateKeyword(). | 70 // To have access to UpdateKeyword(). |
75 friend class ETWKeywordUpdateThread; | 71 class ETWKeywordUpdateThread; |
76 TraceEventETWExport(); | 72 TraceEventETWExport(); |
77 | 73 |
78 // Updates the list of enabled categories by consulting the ETW keyword. | 74 // Updates the list of enabled categories by consulting the ETW keyword. |
79 // Returns true if there was a change, false otherwise. | 75 // Returns true if there was a change, false otherwise. |
80 bool UpdateEnabledCategories(); | 76 bool UpdateEnabledCategories(); |
81 | 77 |
82 // Returns true if the category is enabled. | 78 // Returns true if the category is enabled. |
83 bool IsCategoryEnabled(const char* category_name) const; | 79 bool IsCategoryEnabled(const char* category_name) const; |
84 | 80 |
85 // Called back by the update thread to check for potential changes to the | 81 // Called back by the update thread to check for potential changes to the |
(...skipping 14 matching lines...) Expand all Loading... |
100 scoped_ptr<ETWKeywordUpdateThread> keyword_update_thread_; | 96 scoped_ptr<ETWKeywordUpdateThread> keyword_update_thread_; |
101 PlatformThreadHandle keyword_update_thread_handle_; | 97 PlatformThreadHandle keyword_update_thread_handle_; |
102 | 98 |
103 DISALLOW_COPY_AND_ASSIGN(TraceEventETWExport); | 99 DISALLOW_COPY_AND_ASSIGN(TraceEventETWExport); |
104 }; | 100 }; |
105 | 101 |
106 } // namespace trace_event | 102 } // namespace trace_event |
107 } // namespace base | 103 } // namespace base |
108 | 104 |
109 #endif // BASE_TRACE_EVENT_TRACE_EVENT_ETW_EXPORT_WIN_H_ | 105 #endif // BASE_TRACE_EVENT_TRACE_EVENT_ETW_EXPORT_WIN_H_ |
OLD | NEW |