Skip site navigation (1)Skip section navigation (2)
Date:      Mon, 12 Dec 2011 14:07:56 -0500
From:      John Baldwin <jhb@freebsd.org>
To:        Mikolaj Golub <trociny@freebsd.org>
Cc:        svn-src-head@freebsd.org, Robert Watson <rwatson@freebsd.org>, svn-src-all@freebsd.org, src-committers@freebsd.org, Kostik Belousov <kib@freebsd.org>
Subject:   Re: svn commit: r227956 - head/usr.bin/procstat
Message-ID:  <201112121407.56869.jhb@freebsd.org>
In-Reply-To: <86y5ukvnll.fsf@kopusha.home.net>
References:  <201111242054.pAOKs6vj012296@svn.freebsd.org> <4EE12CE0.5070803@FreeBSD.org> <86y5ukvnll.fsf@kopusha.home.net>

next in thread | previous in thread | raw e-mail | index | archive | help
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



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