summaryrefslogtreecommitdiffstats
path: root/include
diff options
context:
space:
mode:
authorSuren Baghdasaryan <surenb@google.com>2019-11-25 19:02:23 -0800
committerSuren Baghdasaryan <surenb@google.com>2019-12-18 13:12:28 -0800
commitd8f484b2b963ae20f12c1755cdc23a8aa9612624 (patch)
tree74a6d593bbbd29ee9c955a11977a243b1273749b /include
parent44623145e6cffcf770dfca05258fe479654ac7b2 (diff)
downloadplatform_system_memory_libmeminfo-d8f484b2b963ae20f12c1755cdc23a8aa9612624.tar.gz
platform_system_memory_libmeminfo-d8f484b2b963ae20f12c1755cdc23a8aa9612624.tar.bz2
platform_system_memory_libmeminfo-d8f484b2b963ae20f12c1755cdc23a8aa9612624.zip
libmeminfo: add KReclaimable to the fields read from meminfo
Provide means of reading KReclaimable stats from /proc/meminfo. Bug: 138148041 Test: dumpsys meminfo Test: libmeminfo_test Change-Id: I393318fcf6a805e0ac9ab7f93c57e76123acfc0b Signed-off-by: Suren Baghdasaryan <surenb@google.com>
Diffstat (limited to 'include')
-rw-r--r--include/meminfo/sysmeminfo.h4
1 files changed, 3 insertions, 1 deletions
diff --git a/include/meminfo/sysmeminfo.h b/include/meminfo/sysmeminfo.h
index 4a5a18b..dc2a0fb 100644
--- a/include/meminfo/sysmeminfo.h
+++ b/include/meminfo/sysmeminfo.h
@@ -45,13 +45,14 @@ class SysMemInfo final {
static constexpr const char kMemVmallocUsed[] = "VmallocUsed:";
static constexpr const char kMemPageTables[] = "PageTables:";
static constexpr const char kMemKernelStack[] = "KernelStack:";
+ static constexpr const char kMemKReclaimable[] = "KReclaimable:";
static constexpr std::initializer_list<std::string_view> kDefaultSysMemInfoTags = {
SysMemInfo::kMemTotal, SysMemInfo::kMemFree, SysMemInfo::kMemBuffers,
SysMemInfo::kMemCached, SysMemInfo::kMemShmem, SysMemInfo::kMemSlab,
SysMemInfo::kMemSReclaim, SysMemInfo::kMemSUnreclaim, SysMemInfo::kMemSwapTotal,
SysMemInfo::kMemSwapFree, SysMemInfo::kMemMapped, SysMemInfo::kMemVmallocUsed,
- SysMemInfo::kMemPageTables, SysMemInfo::kMemKernelStack,
+ SysMemInfo::kMemPageTables, SysMemInfo::kMemKernelStack, SysMemInfo::kMemKReclaimable,
};
SysMemInfo() = default;
@@ -83,6 +84,7 @@ class SysMemInfo final {
uint64_t mem_vmalloc_used_kb() { return mem_in_kb_[kMemVmallocUsed]; }
uint64_t mem_page_tables_kb() { return mem_in_kb_[kMemPageTables]; }
uint64_t mem_kernel_stack_kb() { return mem_in_kb_[kMemKernelStack]; }
+ uint64_t mem_kreclaimable_kb() { return mem_in_kb_[kMemKReclaimable]; }
uint64_t mem_zram_kb(const char* zram_dev = nullptr);
private: