Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(621)

Unified Diff: base/trace_event/trace_event_etw_export_win.h

Issue 1279353002: [ETW Export] Add polling for ETW keyword. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Fix nit. Created 5 years, 4 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | base/trace_event/trace_event_etw_export_win.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: base/trace_event/trace_event_etw_export_win.h
diff --git a/base/trace_event/trace_event_etw_export_win.h b/base/trace_event/trace_event_etw_export_win.h
index 9f73d781f73585c3d42c6da1a9abe733c59f83cb..523c44b1d1da7a649a46bdf8768c2cfa67908ffa 100644
--- a/base/trace_event/trace_event_etw_export_win.h
+++ b/base/trace_event/trace_event_etw_export_win.h
@@ -16,6 +16,10 @@
template <typename Type>
struct StaticMemorySingletonTraits;
+namespace {
+class ETWKeywordUpdateThread;
+}
+
namespace base {
namespace trace_event {
@@ -67,6 +71,8 @@ class BASE_EXPORT TraceEventETWExport {
private:
// Ensure only the provider can construct us.
friend struct StaticMemorySingletonTraits<TraceEventETWExport>;
+ // To have access to UpdateKeyword().
+ friend class ETWKeywordUpdateThread;
TraceEventETWExport();
// Updates the list of enabled categories by consulting the ETW keyword.
@@ -76,6 +82,10 @@ class BASE_EXPORT TraceEventETWExport {
// Returns true if the category is enabled.
bool IsCategoryEnabled(const char* category_name) const;
+ // Called back by the update thread to check for potential changes to the
+ // keyword.
+ static void UpdateETWKeyword();
+
// True if ETW is enabled. Allows hiding the exporting behind a flag.
bool etw_export_enabled_;
@@ -85,6 +95,11 @@ class BASE_EXPORT TraceEventETWExport {
// Local copy of the ETW keyword.
uint64 etw_match_any_keyword_;
+ // Background thread that monitors changes to the ETW keyword and updates
+ // the enabled categories when a change occurs.
+ scoped_ptr<ETWKeywordUpdateThread> keyword_update_thread_;
+ PlatformThreadHandle keyword_update_thread_handle_;
+
DISALLOW_COPY_AND_ASSIGN(TraceEventETWExport);
};
« no previous file with comments | « no previous file | base/trace_event/trace_event_etw_export_win.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698