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

Unified Diff: base/trace_event/trace_config.h

Issue 1923533004: Tracing pre-filtering (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Added test Created 4 years, 7 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_config.cc » ('j') | base/trace_event/trace_config.cc » ('J')
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: base/trace_event/trace_config.h
diff --git a/base/trace_event/trace_config.h b/base/trace_event/trace_config.h
index 5b119eae98c0d71a97016ab44d0e06d915d67c84..e91acbe70ac3a089fcb7478b1ac633e94d1b9d60 100644
--- a/base/trace_event/trace_config.h
+++ b/base/trace_event/trace_config.h
@@ -73,6 +73,37 @@ class BASE_EXPORT TraceConfig {
HeapProfiler heap_profiler_options;
};
+ class EventFilterConfig {
+ public:
+ EventFilterConfig(const std::string& predicate_name);
+ ~EventFilterConfig();
+
+ EventFilterConfig(const EventFilterConfig& tc);
+ EventFilterConfig& operator=(const EventFilterConfig& rhs);
+
+ void AddIncludedCategory(const std::string& category);
+ void AddExcludedCategory(const std::string& category);
+ void SetArgs(std::unique_ptr<base::DictionaryValue> args);
Primiano Tucci (use gerrit) 2016/05/27 17:47:06 nit: you are in base, no need for base::
+
+ bool IsCategoryGroupEnabled(const char* category_group_name) const;
+
+ const std::string& predicate_name() const { return predicate_name_; }
+ base::DictionaryValue* filter_args() const { return args_.get(); }
Primiano Tucci (use gerrit) 2016/05/27 17:47:06 maybe you want this to be a const DictValue*? ditt
+ const StringList& included_categories() const {
+ return included_categories_;
+ }
+ const StringList& excluded_categories() const {
+ return excluded_categories_;
+ }
+
+ private:
+ std::string predicate_name_;
+ StringList included_categories_;
+ StringList excluded_categories_;
+ std::unique_ptr<base::DictionaryValue> args_;
+ };
+ typedef std::vector<EventFilterConfig> EventFilters;
+
TraceConfig();
// Create TraceConfig object from category filter and trace options strings.
@@ -189,7 +220,7 @@ class BASE_EXPORT TraceConfig {
// Returns true if at least one category in the list is enabled by this
// trace config.
- bool IsCategoryGroupEnabled(const char* category_group) const;
+ bool IsCategoryGroupEnabled(const char* category_group_name) const;
// Merges config with the current TraceConfig
void Merge(const TraceConfig& config);
@@ -200,6 +231,8 @@ class BASE_EXPORT TraceConfig {
return memory_dump_config_;
}
+ const EventFilters& event_filters() const { return event_filters_; }
+
private:
FRIEND_TEST_ALL_PREFIXES(TraceConfigTest, TraceConfigFromValidLegacyFormat);
FRIEND_TEST_ALL_PREFIXES(TraceConfigTest,
@@ -238,6 +271,8 @@ class BASE_EXPORT TraceConfig {
void SetMemoryDumpConfig(const base::DictionaryValue& memory_dump_config);
void SetDefaultMemoryDumpConfig();
+ void SetEventFilters(const base::ListValue& event_filters);
+
// Convert TraceConfig to the dict representation of the TraceConfig.
void ToDict(base::DictionaryValue& dict) const;
@@ -268,6 +303,7 @@ class BASE_EXPORT TraceConfig {
StringList disabled_categories_;
StringList excluded_categories_;
StringList synthetic_delays_;
+ EventFilters event_filters_;
};
} // namespace trace_event
« no previous file with comments | « no previous file | base/trace_event/trace_config.cc » ('j') | base/trace_event/trace_config.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698