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

Unified Diff: base/trace_event/heap_profiler_allocation_context_tracker_unittest.cc

Issue 1900223003: [tracing] Ignore tracing allocations in heap profiler (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: remove cc file and inline. Created 4 years, 8 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 a39700e4fff4171d6701883d83d6a8ef98a85cdd..ed037049001ef7463c6211c931a0795c74457d79 100644
--- a/base/trace_event/heap_profiler_allocation_context_tracker_unittest.cc
+++ b/base/trace_event/heap_profiler_allocation_context_tracker_unittest.cc
@@ -8,6 +8,7 @@
#include "base/memory/ref_counted.h"
#include "base/pending_task.h"
+#include "base/trace_event/heap_profiler.h"
#include "base/trace_event/heap_profiler_allocation_context.h"
#include "base/trace_event/heap_profiler_allocation_context_tracker.h"
#include "base/trace_event/trace_event.h"
@@ -278,5 +279,18 @@ TEST_F(AllocationContextTrackerTest, TrackTaskContext) {
ASSERT_FALSE(ctx.type_name);
}
+TEST_F(AllocationContextTrackerTest, IgnoreAllocationTest) {
+ TRACE_EVENT0("Testing", kCupcake);
+ TRACE_EVENT0("Testing", kDonut);
+ HEAP_PROFILER_SCOPED_IGNORE;
+ AllocationContext ctx =
+ AllocationContextTracker::GetInstanceForCurrentThread()
+ ->GetContextSnapshot();
+ const StringPiece kTracingOverhead("tracing_overhead");
+ ASSERT_EQ(kTracingOverhead,
+ static_cast<const char*>(ctx.backtrace.frames[0].value));
+ ASSERT_EQ(1u, ctx.backtrace.frame_count);
+}
+
} // namespace trace_event
} // namespace base
« 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