From: Jesper Wallin Subject: ps: fix the width of LIM, RSS, STAT and VSZ To: tech@openbsd.org Date: Sat, 27 Jan 2024 23:34:44 +0100 I noticed that the columns in ps(1) with -u was unaligned if the value of VSZ or RSS is too big. I understand that increasing the width only delays the problem, but increasing it a tiny bit at least covers normal usage of packages like PostgreSQL, Chromium, Firefox, etc. Though, it won't solve it for processes like vmd(8), with several gigs of VSZ. I also noticed that STAT was too small and I suspect this came with the pinsyscalls(2) update, adding 'l' to all processes. The same goes for the LIM column when using -v, which seemed to be very low (5), now increased to almost the double (9). Regards, Jesper Wallin Index: keyword.c =================================================================== RCS file: /cvs/src/bin/ps/keyword.c,v retrieving revision 1.52 diff -u -p -r1.52 keyword.c --- keyword.c 25 Feb 2022 18:05:49 -0000 1.52 +++ keyword.c 27 Jan 2024 21:11:57 -0000 @@ -113,7 +113,7 @@ VAR var[] = { {"ktrace", "KTRACE", NULL, 0, pvar, 8, 0, POFF(p_traceflag), INT32, "x"}, /* XXX */ {"ktracep", "KTRACEP", NULL, 0, pvar, PTRWIDTH, 0, POFF(p_tracep), UINT64, "llx"}, - {"lim", "LIM", NULL, 0, maxrss, 5}, + {"lim", "LIM", NULL, 0, maxrss, 9}, {"login", "LOGIN", NULL, LJUST, logname, LOGIN_NAME_MAX}, {"logname", "", "login"}, {"lstart", "STARTED", NULL, LJUST|USER, lstarted, 28}, @@ -152,7 +152,7 @@ VAR var[] = { /* XXX */ {"rgroup", "RGROUP", NULL, LJUST, rgname, USERLEN}, {"rlink", "RLINK", NULL, 0, pvar, 8, 0, POFF(p_back), UINT64, "llx"}, - {"rss", "RSS", NULL, 0, p_rssize, 5}, + {"rss", "RSS", NULL, 0, p_rssize, 6}, {"rssize", "", "rsz"}, {"rsz", "RSZ", NULL, 0, rssize, 4}, {"rtable", "RTABLE", NULL, 0, pvar, 0, 0, POFF(p_rtableid), INT32, "d"}, @@ -168,7 +168,7 @@ VAR var[] = { {"ssiz", "SSIZ", NULL, 0, ssize, 4}, {"start", "STARTED", NULL, LJUST|USER, started, 8}, {"stat", "", "state"}, - {"state", "STAT", NULL, LJUST|NLIST, printstate, 6}, + {"state", "STAT", NULL, LJUST|NLIST, printstate, 7}, {"supgid", "SUPGID", NULL, LJUST, supgid, 64}, {"supgrp", "SUPGRP", NULL, LJUST, supgrp, 64}, GID("svgid", "SVGID", pvar, POFF(p_svgid)), @@ -187,7 +187,7 @@ VAR var[] = { {"user", "USER", NULL, LJUST, euname, USERLEN}, {"usrpri", "", "upr"}, {"vsize", "", "vsz"}, - {"vsz", "VSZ", NULL, 0, vsize, 5}, + {"vsz", "VSZ", NULL, 0, vsize, 6}, {"wchan", "WCHAN", NULL, LJUST, wchan, WCHANLEN}, {"xstat", "XSTAT", NULL, 0, pvar, 4, 0, POFF(p_xstat), UINT16, "x"}, {""},