Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP Path: utzoo!utcs!mnetor!seismo!gatech!drillsys!rice!phil From: phil@rice.UUCP Newsgroups: net.sources.bugs Subject: Re: Size bug in top(1) Message-ID: <190@dione.rice.EDU> Date: Fri, 11-Jul-86 17:52:18 EDT Article-I.D.: dione.190 Posted: Fri Jul 11 17:52:18 1986 Date-Received: Sun, 13-Jul-86 07:05:56 EDT References: <895@bu-cs.UUCP> Organization: Rice University, Houston Lines: 48 Summary: the author speaks In article <895@bu-cs.UUCP>, bzs@bu-cs.UUCP (Barry Shein) writes: > >In top(1), where it prints out the size of the job and the resident > >size of the job, it assumes that clicks are 512 bytes. It does a Thank you for pointing the bug out. It will be fixed in the new version. > >right shift by 1 to convert to K and then prints out the numbers. The > >correct thing to do is to use the macro ctob() which is defined in > >param.h. Actually, this won't work on a pyramid, where ctob isn't defined. > -------------begin fix---------- > /* > * BZS@BU-CS.BU.EDU 7/4/86 > * - fix suggested in net.sources.bugs, mostly for SUN > (pp->p_tsize + pp->p_dsize + pp->p_ssize) >> 1, > pp->p_rssize >> 1, > */ > #if PGSHIFT > 10 > (pp->p_tsize + pp->p_dsize + pp->p_ssize) << (PGSHIFT-10), > pp->p_rssize << (PGSHIFT-10), > #else > (pp->p_tsize + pp->p_dsize + pp->p_ssize) >> (10-PGSHIFT), > pp->p_rssize >> (10-PGSHIFT), > #endif > ------------end fix--------------- That's basically the gist of it. I have something a little better that I use in the new version. I am currently in the process of finishing up version 2.0 of Top. In it, I hope to incorporate all the changes and fixes that people have sent to me. There are also many other important differences. For example, I have completely abandoned "curses". It turns out that not using curses results in the program starting up in about half the time. I have also added a small interactive mode, making it possible to do redraws on demand, and to change the number of displayed processes and the seconds delay while the program is running. Watch for it...... -- William LeFebvre Department of Computer Science Rice University