Subject: Re: HEADS UP: merging the newlock2 branch
To: Kouichirou Hiratsuka <hira@po6.nsk.ne.jp>
From: Andrew Doran <ad@netbsd.org>
List: current-users
Date: 02/10/2007 18:25:10
On Sun, Feb 11, 2007 at 01:29:43AM +0900, Kouichirou Hiratsuka wrote:

> top(1) doesn't show system processes in [].
> 
> % top -b 100 | grep swapper
>     0 root     -18    0     0K   11M schedule   0:00  0.00%  0.00% swapper
> 
> Is this change correct?

The below change is correct, yup. I altered a few more things and will clean
up the list of process flags exported to userspace when I get a moment.

Unfortunatley, the following tools need the latest updates to work display
or work correctly: top, pkill, ps.

Thanks,
Andrew 
 
> best regards.
> -- 
>  Kouichirou Hiratsuka
>    hira@po6.nsk.ne.jp
> 
> Index: m_netbsd15.c
> ===================================================================
> RCS file: /cvsroot/src/usr.bin/top/machine/m_netbsd15.c,v
> retrieving revision 1.26
> diff -u -r1.26 m_netbsd15.c
> --- m_netbsd15.c	9 Feb 2007 22:08:49 -0000	1.26
> +++ m_netbsd15.c	10 Feb 2007 15:39:31 -0000
> @@ -496,10 +496,10 @@
>  		/*
>  		 * Place pointers to each valid proc structure in pref[].
>  		 * Process slots that are actually in use have a non-zero
> -		 * status field.  Processes with P_SYSTEM set are system
> +		 * status field.  Processes with KP_SYSTEM set are system
>  		 * processes---these get ignored unless show_sysprocs is set.
>  		 */
> -		if (pp->p_stat != 0 && (show_system || ((pp->p_flag & P_SYSTEM) == 0))) {
> +		if (pp->p_stat != 0 && (show_system || ((pp->p_flag & KP_SYSTEM) == 0))) {
>  			total_procs++;
>  			process_states[(unsigned char) pp->p_stat]++;
>  			if (pp->p_stat != LSZOMB &&
> @@ -554,7 +554,7 @@
>  	/* get the process's user struct and set cputime */
>  	if ((pp->p_flag & L_INMEM) == 0)
>  		pretty = "<>";
> -	else if ((pp->p_flag & P_SYSTEM) != 0)
> +	else if ((pp->p_flag & KP_SYSTEM) != 0)
>  		pretty = "[]";
>  
>  	if (pretty[0] != '\0') {