summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: 62f9486)
raw | patch | inline | side by side (parent: 62f9486)
author | Manuel CISSÉ <manuel_cisse@yahoo.fr> | |
Thu, 20 Feb 2014 15:06:56 +0000 (16:06 +0100) | ||
committer | Florian Forster <octo@collectd.org> | |
Tue, 16 Sep 2014 09:27:28 +0000 (11:27 +0200) |
Pull-Request: #560
src/memory.c | patch | blob | history |
diff --git a/src/memory.c b/src/memory.c
index c503821ba0ce095b2241dc10689a3d60c7c11c7d..8166accd1e9abfcb6f122fa29c359ae080480af7 100644 (file)
--- a/src/memory.c
+++ b/src/memory.c
gauge_t mem_buffered = 0;
gauge_t mem_cached = 0;
gauge_t mem_free = 0;
+ gauge_t mem_slab_reclaimable = 0;
+ gauge_t mem_slab_unreclaimable = 0;
if ((fh = fopen ("/proc/meminfo", "r")) == NULL)
{
val = &mem_buffered;
else if (strncasecmp (buffer, "Cached:", 7) == 0)
val = &mem_cached;
+ else if (strncasecmp (buffer, "SReclaimable:", 13) == 0)
+ val = &mem_slab_reclaimable;
+ else if (strncasecmp (buffer, "SUnreclaim:", 11) == 0)
+ val = &mem_slab_unreclaimable;
else
continue;
if (mem_total < (mem_free + mem_buffered + mem_cached))
return (-1);
- mem_used = mem_total - (mem_free + mem_buffered + mem_cached);
- MEMORY_SUBMIT ("used", mem_used,
- "buffered", mem_buffered,
- "cached", mem_cached,
- "free", mem_free);
+ mem_used = mem_total - (mem_free + mem_buffered + mem_cached + mem_slab_unreclaimable + mem_slab_reclaimable);
+ MEMORY_SUBMIT ("used", mem_used,
+ "buffered", mem_buffered,
+ "cached", mem_cached,
+ "free", mem_free,
+ "slab_unrecl", mem_slab_unreclaimable,
+ "slab_recl", mem_slab_reclaimable);
/* #endif KERNEL_LINUX */
#elif HAVE_LIBKSTAT