Fix issue #17948288: Improve accuracy of memory use reporting

We now use Mapped to not double-count cached pages that are
mapped in to app processes.  Also read in some more values that
count towards kernel RAM use, and count buffers as free rather
than used RAM.

It also looks like the zram accounting is broken -- it was never
collecting the total zram reserved space.  I need to figure out
how I was finding that before.

Change-Id: I883f6fc93966774b5c7d2801d1801666dd11ed41
diff --git a/core/jni/android_os_Debug.cpp b/core/jni/android_os_Debug.cpp
index 7b3528b..9ec9993 100644
--- a/core/jni/android_os_Debug.cpp
+++ b/core/jni/android_os_Debug.cpp
@@ -552,6 +552,10 @@
     MEMINFO_SWAP_TOTAL,
     MEMINFO_SWAP_FREE,
     MEMINFO_ZRAM_TOTAL,
+    MEMINFO_MAPPED,
+    MEMINFO_VMALLOC_USED,
+    MEMINFO_PAGE_TABLES,
+    MEMINFO_KERNEL_STACK,
     MEMINFO_COUNT
 };
 
@@ -590,6 +594,11 @@
             "Slab:",
             "SwapTotal:",
             "SwapFree:",
+            "ZRam:",
+            "Mapped:",
+            "VmallocUsed:",
+            "PageTables:",
+            "KernelStack:",
             NULL
     };
     static const int tagsLen[] = {
@@ -601,12 +610,17 @@
             5,
             10,
             9,
+            5,
+            7,
+            12,
+            11,
+            12,
             0
     };
-    long mem[] = { 0, 0, 0, 0, 0, 0, 0, 0, 0 };
+    long mem[] = { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 };
 
     char* p = buffer;
-    while (*p && numFound < 8) {
+    while (*p && numFound < 13) {
         int i = 0;
         while (tags[i]) {
             if (strncmp(p, tags[i], tagsLen[i]) == 0) {