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

Unified Diff: base/trace_event/heap_profiler_allocation_context_tracker_unittest.cc

Issue 2323483005: [tracing] Add filtering mode in TraceLog (Closed)
Patch Set: Add a comment, and renames. Created 4 years, 2 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/heap_profiler_allocation_context_tracker_unittest.cc
diff --git a/base/trace_event/heap_profiler_allocation_context_tracker_unittest.cc b/base/trace_event/heap_profiler_allocation_context_tracker_unittest.cc
index de19ea25b863b269b6659d74da2b9f1c96cfd1a5..056aa2c001d78a62db10b9bd9db7dcd3490305f0 100644
--- a/base/trace_event/heap_profiler_allocation_context_tracker_unittest.cc
+++ b/base/trace_event/heap_profiler_allocation_context_tracker_unittest.cc
@@ -27,6 +27,18 @@ const char kEclair[] = "Eclair";
const char kFroyo[] = "Froyo";
const char kGingerbread[] = "Gingerbread";
+const char kFilteringTraceConfig[] =
+ "{"
+ " \"event_filters\": ["
+ " {"
+ " \"excluded_categories\": [],"
+ " \"filter_args\": {},"
+ " \"filter_predicate\": \"heap_profiler_predicate\","
+ " \"included_categories\": [\"*\"]"
+ " }"
+ " ]"
+ "}";
+
// Asserts that the fixed-size array |expected_backtrace| matches the backtrace
// in |AllocationContextTracker::GetContextSnapshot|.
template <size_t N>
@@ -68,15 +80,15 @@ class AllocationContextTrackerTest : public testing::Test {
AllocationContextTracker::CaptureMode::PSEUDO_STACK);
// Enabling memory-infra category sets default memory dump config which
// includes filters for capturing pseudo stack.
- TraceConfig config(MemoryDumpManager::kTraceCategory, "");
- TraceLog::GetInstance()->SetEnabled(config, TraceLog::RECORDING_MODE);
+ TraceConfig config(kFilteringTraceConfig);
+ TraceLog::GetInstance()->SetEnabled(config, TraceLog::FILTERING_MODE);
AllocationContextTracker::SetCurrentThreadName(kThreadName);
}
void TearDown() override {
AllocationContextTracker::SetCaptureMode(
AllocationContextTracker::CaptureMode::DISABLED);
- TraceLog::GetInstance()->SetDisabled();
+ TraceLog::GetInstance()->SetDisabled(TraceLog::FILTERING_MODE);
}
};
« no previous file with comments | « base/trace_event/heap_profiler_allocation_context_tracker.cc ('k') | base/trace_event/memory_dump_manager.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698