Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 8 Aug 2018 06:31:46 +0000 (UTC)
From:      Eitan Adler <eadler@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org
Subject:   svn commit: r337448 - head/usr.bin/top
Message-ID:  <201808080631.w786VkqZ057242@repo.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: eadler
Date: Wed Aug  8 06:31:46 2018
New Revision: 337448
URL: https://svnweb.freebsd.org/changeset/base/337448

Log:
  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.

Modified:
  head/usr.bin/top/machine.c

Modified: head/usr.bin/top/machine.c
==============================================================================
--- head/usr.bin/top/machine.c	Wed Aug  8 04:46:03 2018	(r337447)
+++ head/usr.bin/top/machine.c	Wed Aug  8 06:31:46 2018	(r337448)
@@ -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");
 		}



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201808080631.w786VkqZ057242>