Commit b049ac84 authored by Ulan Degenbaev's avatar Ulan Degenbaev Committed by Commit Bot

Add a flag for EmbedderGraph in heap snapshot.

The flag is enabled by default and provides a quick way to switch
between the old RetainerInfo and the new EmbedderGraph snapshoting
in local testing.

Bug: chromium:749490
Change-Id: I36406597a289090879cfa5051037c8cf35988e59
Reviewed-on: https://chromium-review.googlesource.com/897532Reviewed-by: 's avatarMichael Lippautz <mlippautz@chromium.org>
Commit-Queue: Ulan Degenbaev <ulan@chromium.org>
Cr-Commit-Position: refs/heads/master@{#51045}
parent 770a40bd
...@@ -910,7 +910,8 @@ DEFINE_INT(histogram_interval, 600000, ...@@ -910,7 +910,8 @@ DEFINE_INT(histogram_interval, 600000,
// heap-snapshot-generator.cc // heap-snapshot-generator.cc
DEFINE_BOOL(heap_profiler_trace_objects, false, DEFINE_BOOL(heap_profiler_trace_objects, false,
"Dump heap object allocations/movements/size_updates") "Dump heap object allocations/movements/size_updates")
DEFINE_BOOL(heap_profiler_use_embedder_graph, true,
"Use the new EmbedderGraph API to get embedder nodes")
// sampling-heap-profiler.cc // sampling-heap-profiler.cc
DEFINE_BOOL(sampling_heap_profiler_suppress_randomness, false, DEFINE_BOOL(sampling_heap_profiler_suppress_randomness, false,
......
...@@ -2223,7 +2223,8 @@ bool NativeObjectsExplorer::IterateAndExtractReferences( ...@@ -2223,7 +2223,8 @@ bool NativeObjectsExplorer::IterateAndExtractReferences(
SnapshotFiller* filler) { SnapshotFiller* filler) {
filler_ = filler; filler_ = filler;
if (snapshot_->profiler()->HasBuildEmbedderGraphCallback()) { if (FLAG_heap_profiler_use_embedder_graph &&
snapshot_->profiler()->HasBuildEmbedderGraphCallback()) {
v8::HandleScope scope(reinterpret_cast<v8::Isolate*>(isolate_)); v8::HandleScope scope(reinterpret_cast<v8::Isolate*>(isolate_));
DisallowHeapAllocation no_allocation; DisallowHeapAllocation no_allocation;
EmbedderGraphImpl graph; EmbedderGraphImpl graph;
......
...@@ -2878,6 +2878,7 @@ void CheckEmbedderGraphSnapshot(v8::Isolate* isolate, ...@@ -2878,6 +2878,7 @@ void CheckEmbedderGraphSnapshot(v8::Isolate* isolate,
} }
TEST(EmbedderGraph) { TEST(EmbedderGraph) {
i::FLAG_heap_profiler_use_embedder_graph = true;
LocalContext env; LocalContext env;
v8::HandleScope scope(env->GetIsolate()); v8::HandleScope scope(env->GetIsolate());
i::Isolate* isolate = reinterpret_cast<i::Isolate*>(env->GetIsolate()); i::Isolate* isolate = reinterpret_cast<i::Isolate*>(env->GetIsolate());
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment