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

Unified Diff: base/trace_event/memory_dump_manager.cc

Issue 2790443002: Revert of Cleaner fall-back stack capture for --enable-heap-profiling=native. (Closed)
Patch Set: Created 3 years, 9 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 | « base/trace_event/heap_profiler_allocation_context_tracker.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 78911307527312965560ea5f0e5066be46f35b56..6aaa3599720d150bc957cee18d965f5d93ecf7e5 100644
--- a/base/trace_event/memory_dump_manager.cc
+++ b/base/trace_event/memory_dump_manager.cc
@@ -35,7 +35,6 @@
#include "base/trace_event/trace_event.h"
#include "base/trace_event/trace_event_argument.h"
#include "build/build_config.h"
-#include "build/buildflag.h"
#if defined(OS_ANDROID)
#include "base/trace_event/java_heap_dump_provider_android.h"
@@ -190,11 +189,14 @@
if (profiling_mode == "") {
AllocationContextTracker::SetCaptureMode(
AllocationContextTracker::CaptureMode::PSEUDO_STACK);
+#if HAVE_TRACE_STACK_FRAME_POINTERS && \
+ (BUILDFLAG(ENABLE_PROFILING) || !defined(NDEBUG))
} else if (profiling_mode == switches::kEnableHeapProfilingModeNative) {
- // If we don't have frame pointers then native tracing falls-back to
- // using base::debug::StackTrace, which may be slow.
+ // We need frame pointers for native tracing to work, and they are
+ // enabled in profiling and debug builds.
AllocationContextTracker::SetCaptureMode(
AllocationContextTracker::CaptureMode::NATIVE_STACK);
+#endif
#if BUILDFLAG(ENABLE_MEMORY_TASK_PROFILER)
} else if (profiling_mode == switches::kEnableHeapProfilingTaskProfiler) {
// Enable heap tracking, which in turn enables capture of heap usage
« no previous file with comments | « base/trace_event/heap_profiler_allocation_context_tracker.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698