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

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: 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..6c57d08dd5e3d6f704c747f091ba127b6d055542 100644
--- a/base/trace_event/trace_config.cc
+++ b/base/trace_event/trace_config.cc
@@ -629,6 +629,21 @@ 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() == "heap_profiler_predicate")
+ return;
+ }
+ // Adds a filter predicate to filter all categories for the heap profiler.
+ // Note that the heap profiler predicate only filters out the events
+ // disabled for recording.
+ EventFilterConfig heap_profiler_config("heap_profiler_predicate");
+ heap_profiler_config.AddIncludedCategory("*");
+ heap_profiler_config.AddIncludedCategory(MemoryDumpManager::kTraceCategory);
+ event_filters_.push_back(heap_profiler_config);
+ }
}
void TraceConfig::SetEventFilters(

Powered by Google App Engine
This is Rietveld 408576698