aboutsummaryrefslogtreecommitdiff
path: root/usr.bin/top
diff options
context:
space:
mode:
authorEitan Adler <eadler@FreeBSD.org>2018-07-25 14:05:17 +0000
committerEitan Adler <eadler@FreeBSD.org>2018-07-25 14:05:17 +0000
commit10550f0b0a0a46d5f8a7be0d01a8be16af5898d4 (patch)
treee4234d95d26e73c41064295bd9c29e96ffc81514 /usr.bin/top
parent5add92953eca506efb92195019815f33d8a4766b (diff)
downloadsrc-10550f0b0a0a46d5f8a7be0d01a8be16af5898d4.tar.gz
src-10550f0b0a0a46d5f8a7be0d01a8be16af5898d4.zip
top(1): increase number of columns for memory
The original intention was 4 columns but with a usable a result. In practice this was not the case. Increase the number of columns to 5 until humanize_number learns alternative ways of presenting the number. Requested by: many Ref D15801
Notes
Notes: svn path=/head/; revision=336707
Diffstat (limited to 'usr.bin/top')
-rw-r--r--usr.bin/top/machine.c6
-rw-r--r--usr.bin/top/utils.c2
2 files changed, 4 insertions, 4 deletions
diff --git a/usr.bin/top/machine.c b/usr.bin/top/machine.c
index 75e4de6b6397..4fd27c757957 100644
--- a/usr.bin/top/machine.c
+++ b/usr.bin/top/machine.c
@@ -388,7 +388,7 @@ format_header(const char *uname_field)
sbuf_printf(header, "%*s", ps.jail ? TOP_JID_LEN : 0,
ps.jail ? " JID" : "");
sbuf_printf(header, " %-*.*s ", namelength, namelength, uname_field);
- sbuf_cat(header, "THR PRI NICE SIZE RES ");
+ sbuf_cat(header, "THR PRI NICE SIZE RES ");
if (ps.swap) {
sbuf_printf(header, "%*s ", TOP_SWAP_LEN - 1, "SWAP");
}
@@ -1064,8 +1064,8 @@ format_next_process(struct handle * xhandle, char *(*get_userid)(int), int flags
sbuf_printf(procbuf, "%3d ", pp->ki_pri.pri_level - PZERO);
sbuf_printf(procbuf, "%4s", format_nice(pp));
- sbuf_printf(procbuf, "%6s ", format_k(PROCSIZE(pp)));
- sbuf_printf(procbuf, "%5s ", format_k(pagetok(pp->ki_rssize)));
+ sbuf_printf(procbuf, "%7s ", format_k(PROCSIZE(pp)));
+ sbuf_printf(procbuf, "%6s ", format_k(pagetok(pp->ki_rssize)));
if (ps.swap) {
sbuf_printf(procbuf, "%*s ",
TOP_SWAP_LEN - 1,
diff --git a/usr.bin/top/utils.c b/usr.bin/top/utils.c
index 6ebc75e9b288..93bbcad09dc4 100644
--- a/usr.bin/top/utils.c
+++ b/usr.bin/top/utils.c
@@ -297,7 +297,7 @@ format_k(int64_t amt)
ret = retarray[index];
index = (index + 1) % NUM_STRINGS;
- humanize_number(ret, 5, amt * 1024, "", HN_AUTOSCALE, HN_NOSPACE);
+ humanize_number(ret, 6, amt * 1024, "", HN_AUTOSCALE, HN_NOSPACE);
return (ret);
}