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

Unified Diff: base/trace_event/java_heap_dump_provider_android.cc

Issue 1180693002: Update from https://crrev.com/333737 (Closed) Base URL: https://github.com/domokit/mojo.git@master
Patch Set: rebased Created 5 years, 6 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/BUILD.gn ('k') | base/trace_event/malloc_dump_provider.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: base/trace_event/java_heap_dump_provider_android.cc
diff --git a/base/trace_event/java_heap_dump_provider_android.cc b/base/trace_event/java_heap_dump_provider_android.cc
index 2a84b81b8db1ffd13852e1a5c830390e075b5989..4f5986d92ceb8ddf8f026c6d09336ba2a539a4f9 100644
--- a/base/trace_event/java_heap_dump_provider_android.cc
+++ b/base/trace_event/java_heap_dump_provider_android.cc
@@ -25,17 +25,20 @@ JavaHeapDumpProvider::~JavaHeapDumpProvider() {
// Called at trace dump point time. Creates a snapshot with the memory counters
// for the current process.
bool JavaHeapDumpProvider::OnMemoryDump(ProcessMemoryDump* pmd) {
- MemoryAllocatorDump* dump = pmd->CreateAllocatorDump("java_heap");
-
// These numbers come from java.lang.Runtime stats.
long total_heap_size = 0;
long free_heap_size = 0;
android::JavaRuntime::GetMemoryUsage(&total_heap_size, &free_heap_size);
- dump->AddScalar(MemoryAllocatorDump::kNameOuterSize,
- MemoryAllocatorDump::kUnitsBytes, total_heap_size);
- dump->AddScalar(MemoryAllocatorDump::kNameInnerSize,
- MemoryAllocatorDump::kUnitsBytes,
- total_heap_size - free_heap_size);
+
+ MemoryAllocatorDump* outer_dump = pmd->CreateAllocatorDump("java_heap");
+ outer_dump->AddScalar(MemoryAllocatorDump::kNameSize,
+ MemoryAllocatorDump::kUnitsBytes, total_heap_size);
+
+ MemoryAllocatorDump* inner_dump =
+ pmd->CreateAllocatorDump("java_heap/allocated_objects");
+ inner_dump->AddScalar(MemoryAllocatorDump::kNameSize,
+ MemoryAllocatorDump::kUnitsBytes,
+ total_heap_size - free_heap_size);
return true;
}
« no previous file with comments | « base/trace_event/BUILD.gn ('k') | base/trace_event/malloc_dump_provider.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698