diff options
author | ssid <ssid@chromium.org> | 2015-08-07 16:08:42 -0700 |
---|---|---|
committer | Commit bot <commit-bot@chromium.org> | 2015-08-07 23:09:19 +0000 |
commit | 2888a24fd1d63a4c2afd9102d72be2f36d581ba5 (patch) | |
tree | 1301c0550b150d34efbf8a030d7e291969db44e2 | |
parent | 1fe251963f99955acace799b85593af2a3f16510 (diff) | |
download | chromium_src-2888a24fd1d63a4c2afd9102d72be2f36d581ba5.zip chromium_src-2888a24fd1d63a4c2afd9102d72be2f36d581ba5.tar.gz chromium_src-2888a24fd1d63a4c2afd9102d72be2f36d581ba5.tar.bz2 |
[tracing] Add light dumps in the V8 dump provider
This CL updates the V8 dump provider to dump only totals of the heap when a
light dump is requested.
BUG=499731
Review URL: https://codereview.chromium.org/1266003003
Cr-Commit-Position: refs/heads/master@{#342471}
-rw-r--r-- | gin/v8_isolate_memory_dump_provider.cc | 10 | ||||
-rw-r--r-- | gin/v8_isolate_memory_dump_provider.h | 1 |
2 files changed, 9 insertions, 2 deletions
diff --git a/gin/v8_isolate_memory_dump_provider.cc b/gin/v8_isolate_memory_dump_provider.cc index 2d261eb..ab1b152 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; diff --git a/gin/v8_isolate_memory_dump_provider.h b/gin/v8_isolate_memory_dump_provider.h index dd44ec9..2a2c5db 100644 --- a/gin/v8_isolate_memory_dump_provider.h +++ b/gin/v8_isolate_memory_dump_provider.h @@ -29,6 +29,7 @@ class V8IsolateMemoryDumpProvider private: void DumpHeapStatistics( + const base::trace_event::MemoryDumpArgs& args, base::trace_event::ProcessMemoryDump* process_memory_dump); IsolateHolder* isolate_holder_; // Not owned. |