From owner-svn-src-all@FreeBSD.ORG Mon Dec 12 19:07:58 2011 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 79D37106564A; Mon, 12 Dec 2011 19:07:58 +0000 (UTC) (envelope-from jhb@freebsd.org) Received: from cyrus.watson.org (cyrus.watson.org [65.122.17.42]) by mx1.freebsd.org (Postfix) with ESMTP id 392A08FC12; Mon, 12 Dec 2011 19:07:58 +0000 (UTC) Received: from bigwig.baldwin.cx (bigwig.baldwin.cx [96.47.65.170]) by cyrus.watson.org (Postfix) with ESMTPSA id C692C46B3B; Mon, 12 Dec 2011 14:07:57 -0500 (EST) Received: from jhbbsd.localnet (unknown [209.249.190.124]) by bigwig.baldwin.cx (Postfix) with ESMTPSA id 5911EB93A; Mon, 12 Dec 2011 14:07:57 -0500 (EST) From: John Baldwin To: Mikolaj Golub Date: Mon, 12 Dec 2011 14:07:56 -0500 User-Agent: KMail/1.13.5 (FreeBSD/8.2-CBSD-20110714-p8; KDE/4.5.5; amd64; ; ) References: <201111242054.pAOKs6vj012296@svn.freebsd.org> <4EE12CE0.5070803@FreeBSD.org> <86y5ukvnll.fsf@kopusha.home.net> In-Reply-To: <86y5ukvnll.fsf@kopusha.home.net> MIME-Version: 1.0 Content-Type: Text/Plain; charset="iso-8859-15" Content-Transfer-Encoding: 7bit Message-Id: <201112121407.56869.jhb@freebsd.org> X-Greylist: Sender succeeded SMTP AUTH, not delayed by milter-greylist-4.2.7 (bigwig.baldwin.cx); Mon, 12 Dec 2011 14:07:57 -0500 (EST) Cc: svn-src-head@freebsd.org, Robert Watson , svn-src-all@freebsd.org, src-committers@freebsd.org, Kostik Belousov Subject: Re: svn commit: r227956 - head/usr.bin/procstat X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 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: Mon, 12 Dec 2011 19:07:58 -0000 On Saturday, December 10, 2011 3:26:46 am Mikolaj Golub wrote: > > On Thu, 08 Dec 2011 16:32:16 -0500 John Baldwin wrote: > > >> JB> Hmm, I would stick as close to limits output as possible. I would > >> JB> consider duplicating the unit field in each of soft and hard, so you > >> JB> end up with something like this: > >> > >> JB> PID COMM RLIMIT SOFT HARD > >> JB> 48798 zsh cputime 100000 secs infinity secs > >> JB> 48798 zsh filesize infinity kb infinity kb > >> JB> 48798 zsh datasize 524288 kb 524288 kb > >> > >> JB> etc. > >> > >> Ok. > >> > >> JB> (Things like 'openfiles' is simply more intuitive than 'nofile' (no > >> JB> file?, huh? oh, num open files.. (except not all users will make the > >> JB> last step there). > >> > >> Then why do we have so non-intuitive rlimit_ident names? > >> > >> It looks like they are used only in procfs_rlimit.c. Do procfs(5) users always > >> make that last step with 'nofile'? :-) > > JB> Well, I suspect it's best not to change the names in procfs in case > JB> there are existing binaries that parse the output of that file > JB> (unfortunately). > > >> Is it possible to change rlimit_ident names? Just to ones that are used by > >> limit(1) or (if they look too long) to something like below: > > JB> Hmm, I have no idea what other things might use rlimit_ident. Probably > JB> not many. (Also, for fun, note that the 'ulimit' and 'limit' built-in > JB> commands in sh and csh also have their own sets of names, fun!) I would > JB> maybe add a rlimit_names[] (just leave rlimit_ident alone), and give > JB> that the names from limits(1), and change both procstat and sh's > JB> ulimit' command to use those. > > Adding yet another rlimit names to the header file does not look so attractive > for me as it was just using/reusing what we had :-). So I decided to hardcode > the names in procstat_rlimit.c (see the attached patch). > > Output example: > > PID COMM RLIMIT SOFT HARD > 11949 zsh cputime 10000 sec infinity > 11949 zsh filesize infinity infinity > 11949 zsh datasize 524288 kB 524288 kB > 11949 zsh stacksize 65536 kB 65536 kB > 11949 zsh coredumpsize 190734 MB 190734 MB > 11949 zsh memoryuse infinity infinity > 11949 zsh memorylocked infinity infinity > 11949 zsh maxprocesses 5547 5547 > 11949 zsh openfiles 11095 11095 > 11949 zsh sbsize infinity infinity > 11949 zsh vmemoryuse infinity infinity > 11949 zsh pseudo-terminals infinity infinity > 11949 zsh swapuse infinity infinity This looks great to me, thanks! -- John Baldwin