Modified kernel version check to support 4.x kernel smaps 62/78662/2 accepted/tizen/3.0/ivi/20161011.055318 accepted/tizen/3.0/mobile/20161015.033623 accepted/tizen/3.0/tv/20161016.005142 accepted/tizen/3.0/wearable/20161015.083525 accepted/tizen/common/20160706.142801 accepted/tizen/ivi/20160706.132921 accepted/tizen/mobile/20160706.132440 accepted/tizen/tv/20160706.132443 accepted/tizen/wearable/20160706.132539 submit/tizen/20160706.112136 submit/tizen_3.0_common/20161104.104000 submit/tizen_3.0_ivi/20161010.000005 submit/tizen_3.0_mobile/20161015.000004 submit/tizen_3.0_tv/20161015.000004 submit/tizen_3.0_wearable/20161015.000004
authorsungguk <sungguk.na@samsung.com>
Wed, 6 Jul 2016 10:33:01 +0000 (19:33 +0900)
committerHyeongsik Min <hyeongsik.min@samsung.com>
Wed, 6 Jul 2016 10:59:11 +0000 (19:59 +0900)
Change-Id: I0878424145df4920ef09d4f4b659808ddc26c874
Signed-off-by: sungguk <sungguk.na@samsung.com>
memps.c [changed mode: 0644->0755]
packaging/memps.spec

diff --git a/memps.c b/memps.c
old mode 100644 (file)
new mode 100755 (executable)
index c6903da..2cd4d79
--- a/memps.c
+++ b/memps.c
@@ -1230,26 +1230,39 @@ void check_kernel_version(void)
        ret = uname(&buf);
 
        if (!ret) {
-               if (buf.release[0] == '3') {
-                       char *pch;
-                       char str[3];
-                       int sub_version;
-                       pch = strstr(buf.release, ".");
-                       strncpy(str, pch+1, 2);
-                       sub_version = atoi(str);
-
+               char *pch;
+               char str[3];
+               int sub_version;
+               pch = strstr(buf.release, ".");
+               strncpy(str, pch+1, 2);
+               sub_version = atoi(str);
+
+               if (buf.release[0] >= '4') {
+                       if (sub_version >= 4)
+                               ignore_smaps_field = 11;
+                               /* Referenced, Anonymous, AnonHugePages, Shared_Hugetlb,
+                                * Private_Hugetlb, Swap, SwapPss, KernelPageSize,
+                                * MMUPageSize, Locked, VmFlags */
+                       else if (sub_version == 3)
+                               ignore_smaps_field = 9;
+                               /* Referenced, Anonymous, AnonHugePages, Swap, SwapPss,
+                                * KernelPageSize, MMUPageSize, Locked, VmFlags */
+                       else
+                               ignore_smaps_field = 8;
+                               /* Referenced, Anonymous, AnonHugePages, Swap,
+                                * KernelPageSize, MMUPageSize, Locked, VmFlags */
+               } else if (buf.release[0] == '3') {
                        if (sub_version >= 10)
-                               ignore_smaps_field = 8; /* Referenced, Anonymous, AnonHugePages,
-                                                  Swap, KernelPageSize, MMUPageSize,
-                                                  Locked, VmFlags */
-
+                               ignore_smaps_field = 8;
+                               /* Referenced, Anonymous, AnonHugePages, Swap,
+                                * KernelPageSize, MMUPageSize, Locked, VmFlags */
                        else
-                               ignore_smaps_field = 7; /* Referenced, Anonymous, AnonHugePages,
-                                                  Swap, KernelPageSize, MMUPageSize,
-                                                  Locked */
+                               ignore_smaps_field = 7;
+                               /* Referenced, Anonymous, AnonHugePages, Swap,
+                                * KernelPageSize, MMUPageSize, Locked */
                } else {
-                       ignore_smaps_field = 4; /* Referenced, Swap, KernelPageSize,
-                                                  MMUPageSize */
+                       ignore_smaps_field = 4;
+                               /* Referenced, Swap, KernelPageSize, MMUPageSize */
                }
        }
 }
index d7142a8..d98f018 100644 (file)
@@ -1,6 +1,6 @@
 Name:       memps
 Summary:    Tool to summarize memory usage of processes, tmpfs and graphics memory usage
-Version:    0.1.8
+Version:    0.1.9
 Release:    0
 Group:      System/Utilities
 License:    Apache-2.0