top(1): hide THR column in separate-thread mode.

It does not make sense to show a "thread count" column when displaying
threads separately. In fact we don't, but do show the header for this
column. Fix this.
This commit is contained in:
Eitan Adler 2018-08-08 06:31:46 +00:00
parent 3dc1c7d6bc
commit 550ddd16ed

View File

@ -388,7 +388,10 @@ 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 ");
if (!ps.thread) {
sbuf_cat(header, "THR ");
}
sbuf_cat(header, "PRI NICE SIZE RES ");
if (ps.swap) {
sbuf_printf(header, "%*s ", TOP_SWAP_LEN - 1, "SWAP");
}