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

Unified Diff: gin/v8_isolate_memory_dump_provider.cc

Issue 1266003003: [tracing] Add light dumps in the V8 dump provider (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@light_dumps
Patch Set: Rebase. Created 5 years, 4 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 | « gin/v8_isolate_memory_dump_provider.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: gin/v8_isolate_memory_dump_provider.cc
diff --git a/gin/v8_isolate_memory_dump_provider.cc b/gin/v8_isolate_memory_dump_provider.cc
index 2d261eb9ecc1d26f5cf8d6a88f9dfc238e71a572..ab1b152eaa67ed9a7e184f31668b85b998137a38 100644
--- a/gin/v8_isolate_memory_dump_provider.cc
+++ b/gin/v8_isolate_memory_dump_provider.cc
@@ -35,14 +35,15 @@ bool V8IsolateMemoryDumpProvider::OnMemoryDump(
if (isolate_holder_->access_mode() == IsolateHolder::kUseLocker) {
v8::Locker locked(isolate_holder_->isolate());
- DumpHeapStatistics(process_memory_dump);
+ DumpHeapStatistics(args, process_memory_dump);
} else {
- DumpHeapStatistics(process_memory_dump);
+ DumpHeapStatistics(args, process_memory_dump);
}
return true;
}
void V8IsolateMemoryDumpProvider::DumpHeapStatistics(
+ const base::trace_event::MemoryDumpArgs& args,
base::trace_event::ProcessMemoryDump* process_memory_dump) {
std::string dump_base_name =
base::StringPrintf("v8/isolate_%p", isolate_holder_->isolate());
@@ -93,6 +94,11 @@ void V8IsolateMemoryDumpProvider::DumpHeapStatistics(
base::trace_event::MemoryAllocatorDump::kUnitsBytes,
heap_statistics.used_heap_size() - known_spaces_used_size);
+ // If light dump is requested, then object statistics are not dumped
+ if (args.level_of_detail ==
+ base::trace_event::MemoryDumpArgs::LevelOfDetail::LOW)
+ return;
+
// Dump statistics of the heap's live objects from last GC.
std::string object_name_prefix = dump_base_name + "/heap_objects";
bool did_dump_object_stats = false;
« no previous file with comments | « gin/v8_isolate_memory_dump_provider.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698