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

Unified Diff: base/trace_event/memory_dump_manager.cc

Issue 1839503002: [tracing] Add native allocation tracing mode. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Add type to StackFrame; format thread name 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/memory_dump_manager.cc
diff --git a/base/trace_event/memory_dump_manager.cc b/base/trace_event/memory_dump_manager.cc
index 35b27d9a03a0a0212b0f807e83068881f3d4395b..9bfb3bc333c14244bad205036da7dbe1e04158c1 100644
--- a/base/trace_event/memory_dump_manager.cc
+++ b/base/trace_event/memory_dump_manager.cc
@@ -169,7 +169,13 @@ void MemoryDumpManager::EnableHeapProfilingIfNeeded() {
switches::kEnableHeapProfiling))
return;
- AllocationContextTracker::SetCaptureEnabled(true);
+ std::string profiling_mode = CommandLine::ForCurrentProcess()
+ ->GetSwitchValueASCII(switches::kEnableHeapProfiling);
+ AllocationContextTracker::SetCaptureMode(
+ profiling_mode == switches::kEnableHeapProfilingModeNative ?
+ AllocationContextTracker::CAPTURE_NATIVE_STACK :
+ AllocationContextTracker::CAPTURE_PSEUDO_STACK);
+
for (auto mdp : dump_providers_)
mdp->dump_provider->OnHeapProfilingEnabled(true);
heap_profiling_enabled_ = true;

Powered by Google App Engine
This is Rietveld 408576698