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

Unified Diff: base/trace_event/memory_dump_manager.cc

Issue 2757123002: Cleaner fall-back stack capture for --enable-heap-profiling=native. (Closed)
Patch Set: Fix OS_NACL 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
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 45d448425e9afbf7112e9575aefa6f2a5b2a32bc..af66828f1692841d82e421a69f1cd71f7a115d57 100644
--- a/base/trace_event/memory_dump_manager.cc
+++ b/base/trace_event/memory_dump_manager.cc
@@ -33,6 +33,7 @@
#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"
@@ -187,14 +188,11 @@ void MemoryDumpManager::EnableHeapProfilingIfNeeded() {
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) {
Primiano Tucci (use gerrit) 2017/03/22 10:38:35 should we have an #if defined(COMPONENT_BUILD) her
DmitrySkiba 2017/03/23 19:10:24 Component builds *should* be working on Linux and
Wez 2017/03/27 03:59:37 That would equally apply to the pseudo-stack case,
Wez 2017/03/27 03:59:37 Definitely not on Windows, since the shim impl is
Primiano Tucci (use gerrit) 2017/03/27 09:42:47 Ah, I was thinking more to the "can this unwinder
- // We need frame pointers for native tracing to work, and they are
- // enabled in profiling and debug builds.
+ // If we don't have frame pointers then native tracing falls-back to
+ // using base::debug::StackTrace, which may be slow.
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

Powered by Google App Engine
This is Rietveld 408576698