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

Unified Diff: base/trace_event/memory_dump_manager.cc

Issue 1467453003: [Tracing] Make heap profiler type info a string (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years, 1 month 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/memory_dump_manager.cc
diff --git a/base/trace_event/memory_dump_manager.cc b/base/trace_event/memory_dump_manager.cc
index 354d78220a3e7fa27fdde54746e1c59b6e6fd98d..3873159075254a654f394ad1dcdc06eb5a608269 100644
--- a/base/trace_event/memory_dump_manager.cc
+++ b/base/trace_event/memory_dump_manager.cc
@@ -14,6 +14,7 @@
#include "base/threading/thread.h"
#include "base/trace_event/heap_profiler_allocation_context_tracker.h"
#include "base/trace_event/heap_profiler_stack_frame_deduplicator.h"
+#include "base/trace_event/heap_profiler_type_name_deduplicator.h"
#include "base/trace_event/malloc_dump_provider.h"
#include "base/trace_event/memory_dump_provider.h"
#include "base/trace_event/memory_dump_session_state.h"
@@ -518,19 +519,26 @@ void MemoryDumpManager::OnTraceLogEnabled() {
DCHECK(delegate_); // At this point we must have a delegate.
scoped_refptr<StackFrameDeduplicator> stack_frame_deduplicator = nullptr;
+ scoped_refptr<TypeNameDeduplicator> type_name_deduplicator = nullptr;
if (heap_profiling_enabled_) {
- // If heap profiling is enabled, the stack frame deduplicator will be in
- // use. Add a metadata event to write its frames.
+ // If heap profiling is enabled, the stack frame deduplicator and type name
+ // deduplicator will be in use. Add a metadata events to write the frames
+ // and type IDs.
stack_frame_deduplicator = new StackFrameDeduplicator;
+ type_name_deduplicator = new TypeNameDeduplicator;
TRACE_EVENT_API_ADD_METADATA_EVENT(
"stackFrames", "stackFrames",
scoped_refptr<ConvertableToTraceFormat>(stack_frame_deduplicator));
+ TRACE_EVENT_API_ADD_METADATA_EVENT(
+ "typeNames", "typeNames",
+ scoped_refptr<ConvertableToTraceFormat>(type_name_deduplicator));
}
DCHECK(!dump_thread_);
dump_thread_ = dump_thread.Pass();
- session_state_ = new MemoryDumpSessionState(stack_frame_deduplicator);
+ session_state_ = new MemoryDumpSessionState(stack_frame_deduplicator,
+ type_name_deduplicator);
for (auto it = dump_providers_.begin(); it != dump_providers_.end(); ++it) {
it->disabled = false;

Powered by Google App Engine
This is Rietveld 408576698