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

Unified Diff: base/trace_event/trace_config.cc

Issue 2259493003: [tracing] Add trace events filtering predicate for heap profiler (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@heap_prof_filter
Patch Set: Primiano's comments. Created 4 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
Index: base/trace_event/trace_config.cc
diff --git a/base/trace_event/trace_config.cc b/base/trace_event/trace_config.cc
index 988f73a0343e4b35b6048521bb6ead3702a0a3b6..ee2ebdf03f4a85c75690ce73ed34fc095c76ab6c 100644
--- a/base/trace_event/trace_config.cc
+++ b/base/trace_event/trace_config.cc
@@ -629,6 +629,22 @@ void TraceConfig::SetDefaultMemoryDumpConfig() {
memory_dump_config_.triggers.push_back(kDefaultHeavyMemoryDumpTrigger);
memory_dump_config_.triggers.push_back(kDefaultLightMemoryDumpTrigger);
memory_dump_config_.allowed_dump_modes = GetDefaultAllowedMemoryDumpModes();
+
+ if (AllocationContextTracker::capture_mode() ==
+ AllocationContextTracker::CaptureMode::PSEUDO_STACK) {
+ for (const auto& filter : event_filters_) {
+ if (filter.predicate_name() ==
+ TraceLog::TraceEventFilter::kHeapProfilerPredicate)
+ return;
+ }
+ // Adds a filter predicate to filter all categories for the heap profiler.
+ // Note that the heap profiler predicate does not filter-out any events.
+ EventFilterConfig heap_profiler_config(
+ TraceLog::TraceEventFilter::kHeapProfilerPredicate);
+ heap_profiler_config.AddIncludedCategory("*");
+ heap_profiler_config.AddIncludedCategory(MemoryDumpManager::kTraceCategory);
+ event_filters_.push_back(heap_profiler_config);
+ }
}
void TraceConfig::SetEventFilters(
« no previous file with comments | « base/trace_event/heap_profiler_allocation_context_tracker_unittest.cc ('k') | base/trace_event/trace_event.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698