From 550ddd16edafab3c528960de991b4e370939d647 Mon Sep 17 00:00:00 2001 From: Eitan Adler Date: Wed, 8 Aug 2018 06:31:46 +0000 Subject: [PATCH] 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. --- usr.bin/top/machine.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/usr.bin/top/machine.c b/usr.bin/top/machine.c index 4fd27c757957..87ec5bf68977 100644 --- a/usr.bin/top/machine.c +++ b/usr.bin/top/machine.c @@ -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"); }