Subject: Re: netbsd-4 (and -current) - ps acting funny ?
To: None <current-users@netbsd.org>
From: Pavel Cahyna <pavel@netbsd.org>
List: current-users
Date: 07/29/2007 10:07:27
On Sat, Jul 28, 2007 at 06:27:28PM +0100, David Laight wrote:
> On Sat, Jul 28, 2007 at 03:56:40PM +0000, Michael van Elst wrote:
> > kardel@NetBSD.org (Frank Kardel) writes:
> > 
> > >Sensible time output seem state dependent. Runnanble or Stopped
> > >processes show time value that match my expectations more.
> > 
> > The p_stat of a sleeping process is seen as SDYING (3) because
> > the kvm interface overwrites the value with l_stat == LSSLEEP (3).
> > 
> > A 'dying' process has no valid cputime, thus ps prints 0.
> 
> This is all fubar... 
> 
> When lwps were added (in the nathanw_sa branch) the 'process state'
> needed by ps, had to come from the first/only/random lwp (since
> processes no longer have running/sleeping states). So fill_kproc2()
> got changed to do 'ki->p_stat = l->l_stat', since the values for
> process and lwp status matched this didn't matter.
> 
> This all appeared to work until a new 'p->p_stat' flag SDYING got
> added reusing one of the old values (instead of reusing the value
> that used to be SDEAD).

Isn't it better to change the definition of SDYING, then?

Pavel