Add imported to geminfo
[platform/core/system/memps.git] / memps.c
diff --git a/memps.c b/memps.c
index 2504cd8..787b899 100644 (file)
--- a/memps.c
+++ b/memps.c
@@ -117,6 +117,7 @@ struct geminfo {
        unsigned rss_size;
        unsigned pss_size;
        unsigned hcount;
+       unsigned int imported;
 };
 
 static int sum;
@@ -224,7 +225,7 @@ static unsigned get_peak_rss(unsigned int pid)
 
        return 0;
 }
-#define NUM_GEM_FIELD 6
+#define NUM_GEM_FIELD 7
 
 static geminfo *read_geminfo(FILE *fp)
 {
@@ -232,11 +233,12 @@ static geminfo *read_geminfo(FILE *fp)
        char line[BUF_MAX];
        unsigned int pid, tgid, handle, refcount, hcount;
        unsigned gem_size;
+       unsigned int imported;
 
        if (fgets(line, BUF_MAX, fp) != NULL) {
-               if (sscanf(line, "%d %d %d %d %d 0x%x",
+               if (sscanf(line, "%d %d %d %d %d 0x%x 0x%*x %*d %*d %d",
                        &pid, &tgid, &handle, &refcount,
-                       &hcount, &gem_size) != NUM_GEM_FIELD)
+                       &hcount, &gem_size, &imported) != NUM_GEM_FIELD)
                        return NULL;
 
                if (hcount == 0)
@@ -248,6 +250,7 @@ static geminfo *read_geminfo(FILE *fp)
                tgeminfo->hcount = hcount;
                tgeminfo->rss_size = KB(gem_size);
                tgeminfo->pss_size = KB(gem_size/tgeminfo->hcount);
+               tgeminfo->imported = imported;
        } else
                return NULL;