lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Message-Id: <20220724152534.9239-1-hanshenghong2019@email.szu.edu.cn>
Date:   Sun, 24 Jul 2022 23:25:33 +0800
From:   Shenghong Han <hanshenghong2019@...il.szu.edu.cn>
To:     akpm@...ux-foundation.org
Cc:     linux-kernel@...r.kernel.org, yuhongf@....edu.cn,
        caoyixuan2019@...il.szu.edu.cn,
        Shenghong Han <hanshenghong2019@...il.szu.edu.cn>,
        Jiajian Ye <yejiajian2018@...il.szu.edu.cn>
Subject: [PATCH 1/2] fix three trivival places

Some dirty work:
1.Rename some Variables.
2.Some if-statement was missed at Commit ebbeae36387c,so make up them.

Signed-off-by: Shenghong Han <hanshenghong2019@...il.szu.edu.cn>
Signed-off-by: Jiajian Ye <yejiajian2018@...il.szu.edu.cn>
---
 tools/vm/page_owner_sort.c | 14 +++++++++++---
 1 file changed, 11 insertions(+), 3 deletions(-)

diff --git a/tools/vm/page_owner_sort.c b/tools/vm/page_owner_sort.c
index ec2e67c85..fb103aaf4 100644
--- a/tools/vm/page_owner_sort.c
+++ b/tools/vm/page_owner_sort.c
@@ -63,7 +63,7 @@ enum ALLOCATOR_BIT {
 };
 enum ARG_TYPE {
 	ARG_TXT, ARG_COMM, ARG_STACKTRACE, ARG_ALLOC_TS, ARG_FREE_TS,
-	ARG_CULL_TIME, ARG_PAGE_NUM, ARG_PID, ARG_TGID, ARG_UNKNOWN, ARG_FREE,
+	ARG_TIMES, ARG_TOTAL_MEM, ARG_PID, ARG_TGID, ARG_UNKNOWN, ARG_FREE,
 	ARG_ALLOCATOR
 };
 enum SORT_ORDER {
@@ -402,7 +402,11 @@ static char *get_comm(char *buf)
 
 static int get_arg_type(const char *arg)
 {
-	if (!strcmp(arg, "pid") || !strcmp(arg, "p"))
+	if (!strcmp(arg, "times") || !strcmp(arg, "t"))
+		return ARG_TIMES;
+	else if (!strcmp(arg, "memory") || !strcmp(arg, "m"))
+		return ARG_TOTAL_MEM;
+	else if (!strcmp(arg, "pid") || !strcmp(arg, "p"))
 		return ARG_PID;
 	else if (!strcmp(arg, "tgid") || !strcmp(arg, "tg"))
 		return ARG_TGID;
@@ -599,7 +603,11 @@ static bool parse_sort_args(const char *arg_str)
 
 		int arg_type = get_arg_type(args[i]+offset);
 
-		if (arg_type == ARG_PID)
+		if (arg_type == ARG_TIMES)
+			sc.cmps[i] = compare_num;
+		else if (arg_type == ARG_TOTAL_MEM)
+			sc.cmps[i] = compare_page_num;
+		else if (arg_type == ARG_PID)
 			sc.cmps[i] = compare_pid;
 		else if (arg_type == ARG_TGID)
 			sc.cmps[i] = compare_tgid;
-- 
2.30.1



Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ