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

Unified Diff: base/trace_event/malloc_dump_provider.h

Issue 2350423003: [Tentaive patch for discussion] Add Purge+Suspend metrics as UMA.
Patch Set: Created 4 years, 3 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') | content/renderer/render_thread_impl.cc » ('J')
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: base/trace_event/malloc_dump_provider.h
diff --git a/base/trace_event/malloc_dump_provider.h b/base/trace_event/malloc_dump_provider.h
index 384033c9b82abc55125405e9a29ede7aa9597c08..e8b9e5f99199b9abbbb2a4b70ab7553b240896bb 100644
--- a/base/trace_event/malloc_dump_provider.h
+++ b/base/trace_event/malloc_dump_provider.h
@@ -25,6 +25,21 @@ namespace trace_event {
class AllocationRegister;
+struct MallocStatistics {
+ size_t allocated_objects_size;
+ size_t allocated_objects_count;
+ size_t metadata_fragmentation_caches;
+ size_t total_virtual_size;
+ size_t resident_size;
+
+ MallocStatistics()
+ : allocated_objects_size(0),
+ allocated_objects_count(0),
+ metadata_fragmentation_caches(0),
+ total_virtual_size(0),
+ resident_size(0) {}
+};
+
// Dump provider which collects process-wide memory stats.
class BASE_EXPORT MallocDumpProvider : public MemoryDumpProvider {
public:
@@ -34,6 +49,8 @@ class BASE_EXPORT MallocDumpProvider : public MemoryDumpProvider {
static MallocDumpProvider* GetInstance();
+ static MallocStatistics GetStatistics();
+
// MemoryDumpProvider implementation.
bool OnMemoryDump(const MemoryDumpArgs& args,
ProcessMemoryDump* pmd) override;
« no previous file with comments | « no previous file | base/trace_event/malloc_dump_provider.cc » ('j') | content/renderer/render_thread_impl.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698