Re: ps(1): add -d (descendancy) option to display parent/child process relationships

2022-09-01 Thread Sebastian Benoit
Job Snijders(j...@openbsd.org) on 2022.09.01 03:37:59 +:
> Dear all,
> 
> Some ps(1) implementations have an '-d' ('descendancy') option. Through
> ASCII art parent/child process relationships are grouped and displayed.
> Here is an example:
> 
> $ ps ad -O ppid,user
>   PID  PPID USER TT  STATTIME COMMAND
> 18180 12529 job  pb  I+p  0:00.01 `-- -sh (sh)
> 26689 56460 job  p3  Ip   0:00.01   `-- -ksh (ksh)
>  5153 26689 job  p3  I+p  0:40.18 `-- mutt
> 62046 25272 job  p4  Sp   0:00.25   `-- -ksh (ksh)
> 61156 62046 job  p4  R+/0 0:00.00 `-- ps -ad -O ppid
> 26816  2565 job  p5  Ip   0:00.01   `-- -ksh (ksh)
> 79431 26816 root p5  Ip   0:00.16 `-- /bin/ksh
> 43915 79431 _rpki-cl p5  S+pU 0:06.97   `-- rpki-client
> 70511 43915 _rpki-cl p5  I+pU 0:01.26 |-- rpki-client: parser 
> (rpki-client)
> 96992 43915 _rpki-cl p5  I+pU 0:00.00 |-- rpki-client: rsync 
> (rpki-client)
> 49160 43915 _rpki-cl p5  S+p  0:01.52 |-- rpki-client: http 
> (rpki-client)
> 99329 43915 _rpki-cl p5  S+p  0:03.20 `-- rpki-client: rrdp 
> (rpki-client)
> 
> The functionality is similar to pstree(1) in the ports collection.
> 
> The below changeset borrows heavily from the following two
> implementations:
> 
> 
> https://github.com/freebsd/freebsd-src/commit/044fce530f89a819827d351de364d208a30e9645.patch
> 
> https://github.com/NetBSD/src/commit/b82f6d00d93d880d3976c4f1e88c33d88a8054ad.patch
> 
> Thoughts?

i like it. found some little things below, with those fixed and some
agreement on the option letter (which i dont care about) it has my ok.

> 
> Kind regards,
> 
> Job
> 
> Index: extern.h
> ===
> RCS file: /cvs/src/bin/ps/extern.h,v
> retrieving revision 1.23
> diff -u -p -r1.23 extern.h
> --- extern.h  5 Jan 2022 04:10:36 -   1.23
> +++ extern.h  1 Sep 2022 03:31:36 -
> @@ -44,44 +44,44 @@ extern VAR var[];
>  extern VARENT *vhead;
>  
>  __BEGIN_DECLS
> -void  command(const struct kinfo_proc *, VARENT *);
> -void  cputime(const struct kinfo_proc *, VARENT *);
> +void  command(const struct pinfo *, VARENT *);
> +void  cputime(const struct pinfo *, VARENT *);
>  int   donlist(void);
> -void  elapsed(const struct kinfo_proc *, VARENT *);
> +void  elapsed(const struct pinfo *, VARENT *);
>  doublegetpcpu(const struct kinfo_proc *);
> -doublegetpmem(const struct kinfo_proc *);
> -void  gname(const struct kinfo_proc *, VARENT *);
> -void  supgid(const struct kinfo_proc *, VARENT *);
> -void  supgrp(const struct kinfo_proc *, VARENT *);
> -void  logname(const struct kinfo_proc *, VARENT *);
> -void  longtname(const struct kinfo_proc *, VARENT *);
> -void  lstarted(const struct kinfo_proc *, VARENT *);
> -void  maxrss(const struct kinfo_proc *, VARENT *);
> +doublegetpmem(const struct pinfo *);
> +void  gname(const struct pinfo *, VARENT *);
> +void  supgid(const struct pinfo *, VARENT *);
> +void  supgrp(const struct pinfo *, VARENT *);
> +void  logname(const struct pinfo *, VARENT *);
> +void  longtname(const struct pinfo *, VARENT *);
> +void  lstarted(const struct pinfo *, VARENT *);
> +void  maxrss(const struct pinfo *, VARENT *);
>  void  nlisterr(struct nlist *);
> -void  p_rssize(const struct kinfo_proc *, VARENT *);
> -void  pagein(const struct kinfo_proc *, VARENT *);
> +void  p_rssize(const struct pinfo *, VARENT *);
> +void  pagein(const struct pinfo *, VARENT *);
>  void  parsefmt(char *);
> -void  pcpu(const struct kinfo_proc *, VARENT *);
> -void  pmem(const struct kinfo_proc *, VARENT *);
> -void  pri(const struct kinfo_proc *, VARENT *);
> +void  pcpu(const struct pinfo *, VARENT *);
> +void  pmem(const struct pinfo *, VARENT *);
> +void  pri(const struct pinfo *, VARENT *);
>  void  printheader(void);
> -void  pvar(const struct kinfo_proc *kp, VARENT *);
> -void  pnice(const struct kinfo_proc *kp, VARENT *);
> -void  rgname(const struct kinfo_proc *, VARENT *);
> -void  rssize(const struct kinfo_proc *, VARENT *);
> -void  runame(const struct kinfo_proc *, VARENT *);
> +void  pvar(const struct pinfo *, VARENT *);
> +void  pnice(const struct pinfo *, VARENT *);
> +void  rgname(const struct pinfo *, VARENT *);
> +void  rssize(const struct pinfo *, VARENT *);
> +void  runame(const struct pinfo *, VARENT *);
>  void  showkey(void);
> -void  started(const struct kinfo_proc *, VARENT *);
> -void  printstate(const struct kinfo_proc *, VARENT *);
> -void  printpledge(const struct kinfo_proc *, VARENT *);
> -void  tdev(const struct kinfo_proc *, VARENT *);
> -void  tname(const struct kinfo_proc *, VARENT *);
> -void  tsize(const struct kinfo_proc *, VARENT *);
> -void  dsize(const struct kinfo_proc *, VARENT *);
> -void  ssize(const struct kinfo_proc *, VARENT *);
> -void  ucomm(const struct kinfo_proc *, VARENT *);
> 

Re: ps(1): add -d (descendancy) option to display parent/child process relationships

2022-09-01 Thread Job Snijders
On Thu, Sep 01, 2022 at 06:14:17PM +0200, Florian Obser wrote:
> >> NetBSD's and FreeBSD's ps(1) use '-d' to display process hierarchy.
> >
> > using -f would follow the path of least resistance.  Is there really a 
> > common
> > user commnity between freebsd netbsd and openbsd?  I doubt it.
> >
> 
> Curious, my Jesus Laptop (macOS 12.5) has
>  -A  Display information about other users' processes, including
>  those without controlling terminals.
> [...]
>  -d  Like -A, but excludes session leaders.
> 
> It does not have this feature at all. Is this a new thing in FreeBSD?

FreeBSD May 2009: 
https://github.com/freebsd/freebsd-src/commit/044fce530f89a819827d351de364d208a30e9645
NetBSD December 2016: 
https://github.com/NetBSD/src/commit/b82f6d00d93d880d3976c4f1e88c33d88a8054ad

GPL ps probably introduced '-f' more than 20 years ago.

Kind regards,

Job



Re: ps(1): add -d (descendancy) option to display parent/child process relationships

2022-09-01 Thread Theo de Raadt
Florian Obser  wrote:

> On 2022-09-01 09:55 -06, "Theo de Raadt"  wrote:
> > Job Snijders  wrote:
> >
> >> On Thu, Sep 01, 2022 at 03:14:40PM +0200, Martin Schröder wrote:
> >> > Am Do., 1. Sept. 2022 um 05:38 Uhr schrieb Job Snijders 
> >> > :
> >> > > Some ps(1) implementations have an '-d' ('descendancy') option. Through
> >> > > ASCII art parent/child process relationships are grouped and displayed.
> >> > >
> >> > > Thoughts?
> >> > 
> >> > gnu ps has
> >> > 
> >> > -d Select all processes except session leaders.
> >> > 
> >> > and
> >> > 
> >> >f  ASCII art process hierarchy (forest).
> >> > 
> >> >--forest
> >> >   ASCII art process tree.
> >> 
> >> GNU ps uses both '-f', '--forest', and '-H' to display process
> >> hierarchy. The '-H' option uses indenting (no ASCII art).
> >> 
> >> NetBSD's and FreeBSD's ps(1) use '-d' to display process hierarchy.
> >
> > using -f would follow the path of least resistance.  Is there really a 
> > common
> > user commnity between freebsd netbsd and openbsd?  I doubt it.
> >
> 
> Curious, my Jesus Laptop (macOS 12.5) has
>  -A  Display information about other users' processes, including
>  those without controlling terminals.
> [...]
>  -d  Like -A, but excludes session leaders.
> 
> It does not have this feature at all. Is this a new thing in FreeBSD?

A lot of macos is really old, and does not follow any upstream.
 



Re: ps(1): add -d (descendancy) option to display parent/child process relationships

2022-09-01 Thread Florian Obser
On 2022-09-01 09:55 -06, "Theo de Raadt"  wrote:
> Job Snijders  wrote:
>
>> On Thu, Sep 01, 2022 at 03:14:40PM +0200, Martin Schröder wrote:
>> > Am Do., 1. Sept. 2022 um 05:38 Uhr schrieb Job Snijders :
>> > > Some ps(1) implementations have an '-d' ('descendancy') option. Through
>> > > ASCII art parent/child process relationships are grouped and displayed.
>> > >
>> > > Thoughts?
>> > 
>> > gnu ps has
>> > 
>> > -d Select all processes except session leaders.
>> > 
>> > and
>> > 
>> >f  ASCII art process hierarchy (forest).
>> > 
>> >--forest
>> >   ASCII art process tree.
>> 
>> GNU ps uses both '-f', '--forest', and '-H' to display process
>> hierarchy. The '-H' option uses indenting (no ASCII art).
>> 
>> NetBSD's and FreeBSD's ps(1) use '-d' to display process hierarchy.
>
> using -f would follow the path of least resistance.  Is there really a common
> user commnity between freebsd netbsd and openbsd?  I doubt it.
>

Curious, my Jesus Laptop (macOS 12.5) has
 -A  Display information about other users' processes, including
 those without controlling terminals.
[...]
 -d  Like -A, but excludes session leaders.

It does not have this feature at all. Is this a new thing in FreeBSD?

-- 
I'm not entirely sure you are real.



Re: ps(1): add -d (descendancy) option to display parent/child process relationships

2022-09-01 Thread Theo de Raadt
Job Snijders  wrote:

> On Thu, Sep 01, 2022 at 03:14:40PM +0200, Martin Schröder wrote:
> > Am Do., 1. Sept. 2022 um 05:38 Uhr schrieb Job Snijders :
> > > Some ps(1) implementations have an '-d' ('descendancy') option. Through
> > > ASCII art parent/child process relationships are grouped and displayed.
> > >
> > > Thoughts?
> > 
> > gnu ps has
> > 
> > -d Select all processes except session leaders.
> > 
> > and
> > 
> >f  ASCII art process hierarchy (forest).
> > 
> >--forest
> >   ASCII art process tree.
> 
> GNU ps uses both '-f', '--forest', and '-H' to display process
> hierarchy. The '-H' option uses indenting (no ASCII art).
> 
> NetBSD's and FreeBSD's ps(1) use '-d' to display process hierarchy.

using -f would follow the path of least resistance.  Is there really a common
user commnity between freebsd netbsd and openbsd?  I doubt it.



Re: ps(1): add -d (descendancy) option to display parent/child process relationships

2022-09-01 Thread Stuart Henderson
On 2022/09/01 15:14, Martin Schröder wrote:
> Am Do., 1. Sept. 2022 um 05:38 Uhr schrieb Job Snijders :
> > Some ps(1) implementations have an '-d' ('descendancy') option. Through
> > ASCII art parent/child process relationships are grouped and displayed.
> >
> > Thoughts?
> 
> gnu ps has
> 
> -d Select all processes except session leaders.
> 
> and
> 
>f  ASCII art process hierarchy (forest).
> 
>--forest
>   ASCII art process tree.
> 
> Best
> Martin
> 

given the big differences for flags in ps between sysv-ish and bsd-ish OS,
it totally makes sense to follow the flag used by other BSDs here.



Re: ps(1): add -d (descendancy) option to display parent/child process relationships

2022-09-01 Thread Job Snijders
On Thu, Sep 01, 2022 at 03:14:40PM +0200, Martin Schröder wrote:
> Am Do., 1. Sept. 2022 um 05:38 Uhr schrieb Job Snijders :
> > Some ps(1) implementations have an '-d' ('descendancy') option. Through
> > ASCII art parent/child process relationships are grouped and displayed.
> >
> > Thoughts?
> 
> gnu ps has
> 
> -d Select all processes except session leaders.
> 
> and
> 
>f  ASCII art process hierarchy (forest).
> 
>--forest
>   ASCII art process tree.

GNU ps uses both '-f', '--forest', and '-H' to display process
hierarchy. The '-H' option uses indenting (no ASCII art).

NetBSD's and FreeBSD's ps(1) use '-d' to display process hierarchy.

Kind regards,

Job



Re: ps(1): add -d (descendancy) option to display parent/child process relationships

2022-09-01 Thread Martin Schröder
Am Do., 1. Sept. 2022 um 05:38 Uhr schrieb Job Snijders :
> Some ps(1) implementations have an '-d' ('descendancy') option. Through
> ASCII art parent/child process relationships are grouped and displayed.
>
> Thoughts?

gnu ps has

-d Select all processes except session leaders.

and

   f  ASCII art process hierarchy (forest).

   --forest
  ASCII art process tree.

Best
Martin



Re: ps(1): add -d (descendancy) option to display parent/child process relationships

2022-09-01 Thread Matthias Schmidt
Hi Job,

* Job Snijders wrote:
> Dear all,
> 
> Some ps(1) implementations have an '-d' ('descendancy') option. Through
> ASCII art parent/child process relationships are grouped and displayed.
> Here is an example:
> 
> $ ps ad -O ppid,user
>   PID  PPID USER TT  STATTIME COMMAND
> 18180 12529 job  pb  I+p  0:00.01 `-- -sh (sh)
> 26689 56460 job  p3  Ip   0:00.01   `-- -ksh (ksh)
>  5153 26689 job  p3  I+p  0:40.18 `-- mutt
> 62046 25272 job  p4  Sp   0:00.25   `-- -ksh (ksh)
> 61156 62046 job  p4  R+/0 0:00.00 `-- ps -ad -O ppid
> 26816  2565 job  p5  Ip   0:00.01   `-- -ksh (ksh)
> 79431 26816 root p5  Ip   0:00.16 `-- /bin/ksh
> 43915 79431 _rpki-cl p5  S+pU 0:06.97   `-- rpki-client
> 70511 43915 _rpki-cl p5  I+pU 0:01.26 |-- rpki-client: parser 
> (rpki-client)
> 96992 43915 _rpki-cl p5  I+pU 0:00.00 |-- rpki-client: rsync 
> (rpki-client)
> 49160 43915 _rpki-cl p5  S+p  0:01.52 |-- rpki-client: http 
> (rpki-client)
> 99329 43915 _rpki-cl p5  S+p  0:03.20 `-- rpki-client: rrdp 
> (rpki-client)
> 
> The functionality is similar to pstree(1) in the ports collection.
> 
> The below changeset borrows heavily from the following two
> implementations:
> 
> 
> https://github.com/freebsd/freebsd-src/commit/044fce530f89a819827d351de364d208a30e9645.patch
> 
> https://github.com/NetBSD/src/commit/b82f6d00d93d880d3976c4f1e88c33d88a8054ad.patch
> 
> Thoughts?

As someone who is running two OpenBSD based multi-user systems I would
love to see this feature integrated.  From time to time I investigate
processes/scripts from users and seeing the process tree without
additional tools like htop would really be appreciated.

Cheers

Matthias



Re: ps(1): add -d (descendancy) option to display parent/child process relationships

2022-09-01 Thread Martin Pieuchot
On 01/09/22(Thu) 03:37, Job Snijders wrote:
> Dear all,
> 
> Some ps(1) implementations have an '-d' ('descendancy') option. Through
> ASCII art parent/child process relationships are grouped and displayed.
> Here is an example:
> 
> $ ps ad -O ppid,user
>   PID  PPID USER TT  STATTIME COMMAND
> 18180 12529 job  pb  I+p  0:00.01 `-- -sh (sh)
> 26689 56460 job  p3  Ip   0:00.01   `-- -ksh (ksh)
>  5153 26689 job  p3  I+p  0:40.18 `-- mutt
> 62046 25272 job  p4  Sp   0:00.25   `-- -ksh (ksh)
> 61156 62046 job  p4  R+/0 0:00.00 `-- ps -ad -O ppid
> 26816  2565 job  p5  Ip   0:00.01   `-- -ksh (ksh)
> 79431 26816 root p5  Ip   0:00.16 `-- /bin/ksh
> 43915 79431 _rpki-cl p5  S+pU 0:06.97   `-- rpki-client
> 70511 43915 _rpki-cl p5  I+pU 0:01.26 |-- rpki-client: parser 
> (rpki-client)
> 96992 43915 _rpki-cl p5  I+pU 0:00.00 |-- rpki-client: rsync 
> (rpki-client)
> 49160 43915 _rpki-cl p5  S+p  0:01.52 |-- rpki-client: http 
> (rpki-client)
> 99329 43915 _rpki-cl p5  S+p  0:03.20 `-- rpki-client: rrdp 
> (rpki-client)
> 
> The functionality is similar to pstree(1) in the ports collection.
> 
> The below changeset borrows heavily from the following two
> implementations:
> 
> 
> https://github.com/freebsd/freebsd-src/commit/044fce530f89a819827d351de364d208a30e9645.patch
> 
> https://github.com/NetBSD/src/commit/b82f6d00d93d880d3976c4f1e88c33d88a8054ad.patch
> 
> Thoughts?

I'd love to have such feature in base.

> Index: extern.h
> ===
> RCS file: /cvs/src/bin/ps/extern.h,v
> retrieving revision 1.23
> diff -u -p -r1.23 extern.h
> --- extern.h  5 Jan 2022 04:10:36 -   1.23
> +++ extern.h  1 Sep 2022 03:31:36 -
> @@ -44,44 +44,44 @@ extern VAR var[];
>  extern VARENT *vhead;
>  
>  __BEGIN_DECLS
> -void  command(const struct kinfo_proc *, VARENT *);
> -void  cputime(const struct kinfo_proc *, VARENT *);
> +void  command(const struct pinfo *, VARENT *);
> +void  cputime(const struct pinfo *, VARENT *);
>  int   donlist(void);
> -void  elapsed(const struct kinfo_proc *, VARENT *);
> +void  elapsed(const struct pinfo *, VARENT *);
>  doublegetpcpu(const struct kinfo_proc *);
> -doublegetpmem(const struct kinfo_proc *);
> -void  gname(const struct kinfo_proc *, VARENT *);
> -void  supgid(const struct kinfo_proc *, VARENT *);
> -void  supgrp(const struct kinfo_proc *, VARENT *);
> -void  logname(const struct kinfo_proc *, VARENT *);
> -void  longtname(const struct kinfo_proc *, VARENT *);
> -void  lstarted(const struct kinfo_proc *, VARENT *);
> -void  maxrss(const struct kinfo_proc *, VARENT *);
> +doublegetpmem(const struct pinfo *);
> +void  gname(const struct pinfo *, VARENT *);
> +void  supgid(const struct pinfo *, VARENT *);
> +void  supgrp(const struct pinfo *, VARENT *);
> +void  logname(const struct pinfo *, VARENT *);
> +void  longtname(const struct pinfo *, VARENT *);
> +void  lstarted(const struct pinfo *, VARENT *);
> +void  maxrss(const struct pinfo *, VARENT *);
>  void  nlisterr(struct nlist *);
> -void  p_rssize(const struct kinfo_proc *, VARENT *);
> -void  pagein(const struct kinfo_proc *, VARENT *);
> +void  p_rssize(const struct pinfo *, VARENT *);
> +void  pagein(const struct pinfo *, VARENT *);
>  void  parsefmt(char *);
> -void  pcpu(const struct kinfo_proc *, VARENT *);
> -void  pmem(const struct kinfo_proc *, VARENT *);
> -void  pri(const struct kinfo_proc *, VARENT *);
> +void  pcpu(const struct pinfo *, VARENT *);
> +void  pmem(const struct pinfo *, VARENT *);
> +void  pri(const struct pinfo *, VARENT *);
>  void  printheader(void);
> -void  pvar(const struct kinfo_proc *kp, VARENT *);
> -void  pnice(const struct kinfo_proc *kp, VARENT *);
> -void  rgname(const struct kinfo_proc *, VARENT *);
> -void  rssize(const struct kinfo_proc *, VARENT *);
> -void  runame(const struct kinfo_proc *, VARENT *);
> +void  pvar(const struct pinfo *, VARENT *);
> +void  pnice(const struct pinfo *, VARENT *);
> +void  rgname(const struct pinfo *, VARENT *);
> +void  rssize(const struct pinfo *, VARENT *);
> +void  runame(const struct pinfo *, VARENT *);
>  void  showkey(void);
> -void  started(const struct kinfo_proc *, VARENT *);
> -void  printstate(const struct kinfo_proc *, VARENT *);
> -void  printpledge(const struct kinfo_proc *, VARENT *);
> -void  tdev(const struct kinfo_proc *, VARENT *);
> -void  tname(const struct kinfo_proc *, VARENT *);
> -void  tsize(const struct kinfo_proc *, VARENT *);
> -void  dsize(const struct kinfo_proc *, VARENT *);
> -void  ssize(const struct kinfo_proc *, VARENT *);
> -void  ucomm(const struct kinfo_proc *, VARENT *);
> -void  curwd(const struct kinfo_proc *, VARENT *);
> -void  euname(const struct kinfo_proc *, VARENT *);
> -void  vsize(const struct kinfo_proc *, VARENT 

ps(1): add -d (descendancy) option to display parent/child process relationships

2022-08-31 Thread Job Snijders
Dear all,

Some ps(1) implementations have an '-d' ('descendancy') option. Through
ASCII art parent/child process relationships are grouped and displayed.
Here is an example:

$ ps ad -O ppid,user
  PID  PPID USER TT  STATTIME COMMAND
18180 12529 job  pb  I+p  0:00.01 `-- -sh (sh)
26689 56460 job  p3  Ip   0:00.01   `-- -ksh (ksh)
 5153 26689 job  p3  I+p  0:40.18 `-- mutt
62046 25272 job  p4  Sp   0:00.25   `-- -ksh (ksh)
61156 62046 job  p4  R+/0 0:00.00 `-- ps -ad -O ppid
26816  2565 job  p5  Ip   0:00.01   `-- -ksh (ksh)
79431 26816 root p5  Ip   0:00.16 `-- /bin/ksh
43915 79431 _rpki-cl p5  S+pU 0:06.97   `-- rpki-client
70511 43915 _rpki-cl p5  I+pU 0:01.26 |-- rpki-client: parser 
(rpki-client)
96992 43915 _rpki-cl p5  I+pU 0:00.00 |-- rpki-client: rsync 
(rpki-client)
49160 43915 _rpki-cl p5  S+p  0:01.52 |-- rpki-client: http 
(rpki-client)
99329 43915 _rpki-cl p5  S+p  0:03.20 `-- rpki-client: rrdp 
(rpki-client)

The functionality is similar to pstree(1) in the ports collection.

The below changeset borrows heavily from the following two
implementations:


https://github.com/freebsd/freebsd-src/commit/044fce530f89a819827d351de364d208a30e9645.patch

https://github.com/NetBSD/src/commit/b82f6d00d93d880d3976c4f1e88c33d88a8054ad.patch

Thoughts?

Kind regards,

Job

Index: extern.h
===
RCS file: /cvs/src/bin/ps/extern.h,v
retrieving revision 1.23
diff -u -p -r1.23 extern.h
--- extern.h5 Jan 2022 04:10:36 -   1.23
+++ extern.h1 Sep 2022 03:31:36 -
@@ -44,44 +44,44 @@ extern VAR var[];
 extern VARENT *vhead;
 
 __BEGIN_DECLS
-voidcommand(const struct kinfo_proc *, VARENT *);
-voidcputime(const struct kinfo_proc *, VARENT *);
+voidcommand(const struct pinfo *, VARENT *);
+voidcputime(const struct pinfo *, VARENT *);
 int donlist(void);
-voidelapsed(const struct kinfo_proc *, VARENT *);
+voidelapsed(const struct pinfo *, VARENT *);
 double  getpcpu(const struct kinfo_proc *);
-double  getpmem(const struct kinfo_proc *);
-voidgname(const struct kinfo_proc *, VARENT *);
-voidsupgid(const struct kinfo_proc *, VARENT *);
-voidsupgrp(const struct kinfo_proc *, VARENT *);
-voidlogname(const struct kinfo_proc *, VARENT *);
-voidlongtname(const struct kinfo_proc *, VARENT *);
-voidlstarted(const struct kinfo_proc *, VARENT *);
-voidmaxrss(const struct kinfo_proc *, VARENT *);
+double  getpmem(const struct pinfo *);
+voidgname(const struct pinfo *, VARENT *);
+voidsupgid(const struct pinfo *, VARENT *);
+voidsupgrp(const struct pinfo *, VARENT *);
+voidlogname(const struct pinfo *, VARENT *);
+voidlongtname(const struct pinfo *, VARENT *);
+voidlstarted(const struct pinfo *, VARENT *);
+voidmaxrss(const struct pinfo *, VARENT *);
 voidnlisterr(struct nlist *);
-voidp_rssize(const struct kinfo_proc *, VARENT *);
-voidpagein(const struct kinfo_proc *, VARENT *);
+voidp_rssize(const struct pinfo *, VARENT *);
+voidpagein(const struct pinfo *, VARENT *);
 voidparsefmt(char *);
-voidpcpu(const struct kinfo_proc *, VARENT *);
-voidpmem(const struct kinfo_proc *, VARENT *);
-voidpri(const struct kinfo_proc *, VARENT *);
+voidpcpu(const struct pinfo *, VARENT *);
+voidpmem(const struct pinfo *, VARENT *);
+voidpri(const struct pinfo *, VARENT *);
 voidprintheader(void);
-voidpvar(const struct kinfo_proc *kp, VARENT *);
-voidpnice(const struct kinfo_proc *kp, VARENT *);
-voidrgname(const struct kinfo_proc *, VARENT *);
-voidrssize(const struct kinfo_proc *, VARENT *);
-voidruname(const struct kinfo_proc *, VARENT *);
+voidpvar(const struct pinfo *, VARENT *);
+voidpnice(const struct pinfo *, VARENT *);
+voidrgname(const struct pinfo *, VARENT *);
+voidrssize(const struct pinfo *, VARENT *);
+voidruname(const struct pinfo *, VARENT *);
 voidshowkey(void);
-voidstarted(const struct kinfo_proc *, VARENT *);
-voidprintstate(const struct kinfo_proc *, VARENT *);
-voidprintpledge(const struct kinfo_proc *, VARENT *);
-voidtdev(const struct kinfo_proc *, VARENT *);
-voidtname(const struct kinfo_proc *, VARENT *);
-voidtsize(const struct kinfo_proc *, VARENT *);
-voiddsize(const struct kinfo_proc *, VARENT *);
-voidssize(const struct kinfo_proc *, VARENT *);
-voiducomm(const struct kinfo_proc *, VARENT *);
-voidcurwd(const struct kinfo_proc *, VARENT *);
-voideuname(const struct kinfo_proc *, VARENT *);
-voidvsize(const struct kinfo_proc *, VARENT *);
-voidwchan(const struct kinfo_proc *, VARENT *);
+voidstarted(const struct pinfo *, VARENT *);
+voidprintstate(const struct pinfo *, VARENT *);
+void