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

Unified Diff: base/trace_event/java_heap_dump_provider_android.cc

Issue 1105143003: [tracing] Simplify the MemoryAllocatorDump API (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@simplif_2
Patch Set: Fix Win build Created 5 years, 8 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 | « no previous file | base/trace_event/malloc_dump_provider.cc » ('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 759bc0461ac9eac31afd3f6873759a0ef6afbda7..2a84b81b8db1ffd13852e1a5c830390e075b5989 100644
--- a/base/trace_event/java_heap_dump_provider_android.cc
+++ b/base/trace_event/java_heap_dump_provider_android.cc
@@ -10,12 +10,6 @@
namespace base {
namespace trace_event {
-namespace {
-
-const char kDumperName[] = "java_heap";
-
-} // namespace
-
// static
JavaHeapDumpProvider* JavaHeapDumpProvider::GetInstance() {
return Singleton<JavaHeapDumpProvider,
@@ -31,16 +25,17 @@ 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(kDumperName, MemoryAllocatorDump::kRootHeap);
+ 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->set_physical_size_in_bytes(total_heap_size);
- dump->set_allocated_objects_count(0);
- dump->set_allocated_objects_size_in_bytes(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);
return true;
}
« no previous file with comments | « no previous file | base/trace_event/malloc_dump_provider.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698