From owner-svn-src-all@FreeBSD.ORG Thu Jul 10 08:34:42 2014 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id CA26D6EE; Thu, 10 Jul 2014 08:34:42 +0000 (UTC) Received: from mail108.syd.optusnet.com.au (mail108.syd.optusnet.com.au [211.29.132.59]) by mx1.freebsd.org (Postfix) with ESMTP id 5DEFC20C9; Thu, 10 Jul 2014 08:34:41 +0000 (UTC) Received: from c122-106-147-133.carlnfd1.nsw.optusnet.com.au (c122-106-147-133.carlnfd1.nsw.optusnet.com.au [122.106.147.133]) by mail108.syd.optusnet.com.au (Postfix) with ESMTPS id 2DD391A1978; Thu, 10 Jul 2014 18:03:27 +1000 (EST) Date: Thu, 10 Jul 2014 18:03:11 +1000 (EST) From: Bruce Evans X-X-Sender: bde@besplex.bde.org To: Dmitry Morozovsky Subject: Re: svn commit: r268461 - in head: . gnu/lib/libreadline gnu/lib/libreadline/history gnu/lib/libreadline/readline gnu/lib/libreadline/readline/doc gnu/usr.bin/gdb gnu/usr.bin/gdb/gdb gnu/usr.bin/gdb/gd... In-Reply-To: Message-ID: <20140710172328.L1433@besplex.bde.org> References: <201407091552.s69FqUon070685@svn.freebsd.org> <53BD68E4.1070706@freebsd.org> <20140709172305.GD56040@ivaldir.etoilebsd.net> <20140709182745.GD93733@kib.kiev.ua> <20140710153824.S985@besplex.bde.org> MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII; format=flowed X-Optus-CM-Score: 0 X-Optus-CM-Analysis: v=2.1 cv=dZS5gxne c=1 sm=1 tr=0 a=7NqvjVvQucbO2RlWB8PEog==:117 a=PO7r1zJSAAAA:8 a=pz_-lglE43cA:10 a=kj9zAlcOel0A:10 a=JzwRw_2MAAAA:8 a=ky4K2-E1EQvn3VVJKmYA:9 a=toV_fGKvGXw1JCfs:21 a=FItRvkMpVXjVMfVk:21 a=CjuIK1q_8ugA:10 Cc: Baptiste Daroussin , "src-committers@freebsd.org" , "svn-src-all@freebsd.org" , Adrian Chadd , "svn-src-head@freebsd.org" , Pedro Giffuni , Bruce Evans , Konstantin Belousov X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 10 Jul 2014 08:34:43 -0000 On Thu, 10 Jul 2014, Dmitry Morozovsky wrote: > On Thu, 10 Jul 2014, Bruce Evans wrote: > > [snip] > >> FreeBSD-~5.2 i386, statically linked: >> PID USERNAME THR PRI NICE SIZE RES STATE TIME WCPU COMMAND >> 681 root 1 76 0 1676K 1132K select 0:00 0.00% sshd >> 659 root 1 44 r0 848K 536K select 0:00 0.00% ntpd >> 688 root 1 76 0 2084K 1796K select 0:00 0.00% sendmail >> >> FreeBSD-11 i386, dynamically linked: >> PID USERNAME THR PRI NICE SIZE RES STATE C TIME WCPU >> COMMAN >> 25072 bde 1 20 0 17836K 6556K select 1 0:00 0.00% sshd >> 693 root 1 20 0 12356K 4168K select 4 0:02 0.00% ntpd >> 744 root 1 20 0 12868K 4752K select 0 0:01 0.00% >> sendma >> >> The output also shows misformatting of the USERNAME column in newer versions >> of FreeBSD (lots of unused whitespace to kill the command name >> non-whitespace). > > IIUC, this is historical tolp behaviour: username field width depends on the > longest username on the system Perhaps, but that is typical low-quality formatting. The longest name in the actual output was "unbound" (length 7), and that is also the longest name when the output is not truncated to the top few user processes (according to top -SHa 1000 output). top actually has mounds of code and options (that don't work) to control the USERNAME length: - option TOP_USERNAME_LEN. This just gives the default minimum name length and is not configured in FreeBSD - variable namelength with an initial default of 8 if TOP_USERNAME_LEN is not configured. 8 is only the minumum - namelength is replaced by the length of the longest name in the system found by getpwent() if than is longer. - then namelength is clamped to limit the damage from the previous step: In the SMP case, namelength is limited to SMPNAMELEN = 13, and in the UP case it is limited to UPNAMELEN = 15. The extra 2 for the UP case is because UP doesn't have a CPU field, so 2 more columns can be wasted without damaging the COMMAND field any more than for the SMP case. The above misformatting is to about the maximal length SMPNAMELEN = 13. FreeBSD cluster machine /etc/passwd files have about 2% of names longer than 8, mostly for special purposes. Bruce