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
This commit is contained in:
Eitan Adler 2018-07-25 14:05:17 +00:00
parent 5add92953e
commit 10550f0b0a
Notes: svn2git 2020-12-20 02:59:44 +00:00
svn path=/head/; revision=336707
2 changed files with 4 additions and 4 deletions

View File

@ -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,

View File

@ -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);
}