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 namespace base { |
| 16 |
16 template <typename Type> | 17 template <typename Type> |
17 struct StaticMemorySingletonTraits; | 18 struct StaticMemorySingletonTraits; |
18 | 19 |
19 namespace base { | |
20 namespace trace_event { | 20 namespace trace_event { |
21 | 21 |
22 class BASE_EXPORT TraceEventETWExport { | 22 class BASE_EXPORT TraceEventETWExport { |
23 public: | 23 public: |
24 ~TraceEventETWExport(); | 24 ~TraceEventETWExport(); |
25 | 25 |
26 // Retrieves the singleton. | 26 // Retrieves the singleton. |
27 // Note that this may return NULL post-AtExit processing. | 27 // Note that this may return NULL post-AtExit processing. |
28 static TraceEventETWExport* GetInstance(); | 28 static TraceEventETWExport* GetInstance(); |
29 | 29 |
(...skipping 49 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
79 bool IsCategoryEnabled(const char* category_name) const; | 79 bool IsCategoryEnabled(const char* category_name) const; |
80 | 80 |
81 // 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 |
82 // keyword. | 82 // keyword. |
83 static void UpdateETWKeyword(); | 83 static void UpdateETWKeyword(); |
84 | 84 |
85 // True if ETW is enabled. Allows hiding the exporting behind a flag. | 85 // True if ETW is enabled. Allows hiding the exporting behind a flag. |
86 bool etw_export_enabled_; | 86 bool etw_export_enabled_; |
87 | 87 |
88 // Maps category names to their status (enabled/disabled). | 88 // Maps category names to their status (enabled/disabled). |
89 std::map<base::StringPiece, bool> categories_status_; | 89 std::map<StringPiece, bool> categories_status_; |
90 | 90 |
91 // Local copy of the ETW keyword. | 91 // Local copy of the ETW keyword. |
92 uint64 etw_match_any_keyword_; | 92 uint64 etw_match_any_keyword_; |
93 | 93 |
94 // Background thread that monitors changes to the ETW keyword and updates | 94 // Background thread that monitors changes to the ETW keyword and updates |
95 // the enabled categories when a change occurs. | 95 // the enabled categories when a change occurs. |
96 scoped_ptr<ETWKeywordUpdateThread> keyword_update_thread_; | 96 scoped_ptr<ETWKeywordUpdateThread> keyword_update_thread_; |
97 PlatformThreadHandle keyword_update_thread_handle_; | 97 PlatformThreadHandle keyword_update_thread_handle_; |
98 | 98 |
99 DISALLOW_COPY_AND_ASSIGN(TraceEventETWExport); | 99 DISALLOW_COPY_AND_ASSIGN(TraceEventETWExport); |
100 }; | 100 }; |
101 | 101 |
102 } // namespace trace_event | 102 } // namespace trace_event |
103 } // namespace base | 103 } // namespace base |
104 | 104 |
105 #endif // BASE_TRACE_EVENT_TRACE_EVENT_ETW_EXPORT_WIN_H_ | 105 #endif // BASE_TRACE_EVENT_TRACE_EVENT_ETW_EXPORT_WIN_H_ |
OLD | NEW |