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

Unified Diff: base/trace_event/heap_profiler_allocation_context_tracker_unittest.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
« no previous file with comments | « no previous file | base/trace_event/trace_config.cc » ('j') | base/trace_event/trace_event.h » ('J')
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 3064a6a711792e68c41976ce541c591dd586d588..74b5dc1e88d97393d7fef0bba99b1472c71e01de 100644
--- a/base/trace_event/heap_profiler_allocation_context_tracker_unittest.cc
+++ b/base/trace_event/heap_profiler_allocation_context_tracker_unittest.cc
@@ -63,7 +63,14 @@ void AssertBacktraceContainsOnlyThreadName() {
class AllocationContextTrackerTest : public testing::Test {
public:
void SetUp() override {
- TraceConfig config("");
+ TraceConfig config(
+ "{ \"event_filters\":[{"
+ "\"included_categories\":["
+ "\"Testing\","
+ "\"disabled-by-default-Testing\""
+ "],"
+ "\"filter_predicate\":\"heap_profiler_predicate\""
+ "}] }");
TraceLog::GetInstance()->SetEnabled(config, TraceLog::RECORDING_MODE);
AllocationContextTracker::SetCaptureMode(
AllocationContextTracker::CaptureMode::PSEUDO_STACK);
@@ -106,6 +113,12 @@ TEST_F(AllocationContextTrackerTest, PseudoStackScopedTrace) {
AssertBacktraceEquals(frame_ce);
}
+ {
+ TRACE_EVENT0(TRACE_DISABLED_BY_DEFAULT("Testing"), kCupcake);
+ StackFrame frame_ce[] = {t, c, c};
+ AssertBacktraceEquals(frame_ce);
+ }
+
AssertBacktraceEquals(frame_c);
}
« no previous file with comments | « no previous file | base/trace_event/trace_config.cc » ('j') | base/trace_event/trace_event.h » ('J')

Powered by Google App Engine
This is Rietveld 408576698