[4367] in Athena Bugs

home help back first fref pref prev next nref lref last post

ps l and ps u process sizes don't match

daemon@ATHENA.MIT.EDU (John Carr)
Fri Mar 2 08:04:35 1990

To: bugs@ATHENA.MIT.EDU
Date: Fri, 02 Mar 90 08:04:18 EST
From: John Carr <jfc@ATHENA.MIT.EDU>

RT 6.4R

The sizes of processes as reported by "ps l" and "ps u" don't match.
This is because ps l doesn't count the text size and RSS in the total.

A fix for ps follows.  Someone should check top to see if it deserves
a similar change.

(see changes.70 #1)

*** /source/bsd-4.3/rt/bin/ps.c	Fri Aug  7 22:51:58 1987
--- ps.c	Wed Feb 28 21:00:33 1990
***************
*** 691,697 ****
  		cantread("ecmx", kmemf);
  		exit(1);
  	}
! 	if (uflg || vflg) {
  		ntext = getw(nl[X_NTEXT].n_value);
  		text = (struct text *)
  			calloc((unsigned) ntext, sizeof (struct text));
--- 691,697 ----
  		cantread("ecmx", kmemf);
  		exit(1);
  	}
! 	if (lflg || uflg || vflg) {
  		ntext = getw(nl[X_NTEXT].n_value);
  		text = (struct text *)
  			calloc((unsigned) ntext, sizeof (struct text));
***************
*** 1174,1180 ****
  	printf("%7x%4d%6u%6u%3d%4d%3d%5x%4d%5d",
  	    ap->a_flag, ap->a_uid,
  	    ap->a_pid, lp->l_ppid, lp->l_cpu&0377, ap->a_pri-PZERO,
! 	    ap->a_nice-NZERO, lp->l_addr, pgtok(ap->a_size), pgtok(ap->a_rss));
  	if (lp->l_wchan == 0)
  #ifdef vax
  		printf(" %*s", wcwidth, "");
--- 1174,1181 ----
  	printf("%7x%4d%6u%6u%3d%4d%3d%5x%4d%5d",
  	    ap->a_flag, ap->a_uid,
  	    ap->a_pid, lp->l_ppid, lp->l_cpu&0377, ap->a_pri-PZERO,
! 	    ap->a_nice-NZERO, lp->l_addr, pgtok(ap->a_size + ap->a_tsiz),
! 	       pgtok(ap->a_rss));
  	if (lp->l_wchan == 0)
  #ifdef vax
  		printf(" %*s", wcwidth, "");

home help back first fref pref prev next nref lref last post