Hello, i use top mostly in idle-mode. # top <return> <i> or # top -I Under releng_6 (stable p4) and the older versions, i think down to releng_5, doesn't show a running process. I have tryed to dig in the source but my experiences are not so good that i can find the possible error. Has anyone same experiences made with top, or has anyone a workaround (please not like while true........) thanks to all regards michael>
Michael Schuh <michael.schuh@gmail.com> wrote:> i use top mostly in idle-mode. > # top <return> <i> > or > # top -I > > Under releng_6 (stable p4) and the older versions, > i think down to releng_5, doesn't show a running process.By default top doesn't show system processes. If you run top -I and no process is shown, it means one of the system processes is running. Probably idle. Try top -I -S. Fabian -- http://www.fabiankeil.de/ -------------- next part -------------- A non-text attachment was scrubbed... Name: signature.asc Type: application/pgp-signature Size: 187 bytes Desc: not available Url : http://lists.freebsd.org/pipermail/freebsd-stable/attachments/20060130/46bd752c/signature.bin
On 2006-01-30 13:49 +0100, Michael Schuh <michael.schuh@gmail.com> wrote:> Hello, > > i use top mostly in idle-mode. > # top <return> <i> > or > # top -I > > Under releng_6 (stable p4) and the older versions, > i think down to releng_5, doesn't show a running process. > > I have tryed to dig in the source but my experiences are not > so good that i can find the possible error.See line 603 (in HEAD) of /usr/src/usr.bin/top/machine.c: if (displaymode == DISP_CPU && !show_idle && (pp->ki_pctcpu == 0 || pp->ki_stat != SRUN)) /* skip idle or non-running processes */ continue; Since I do not like the current behaviour, I considered removing the test for state SRUN. But I guess that the teest can not be completely eliminated. Instead of selecting only SRUN, some states may need to be suppressed (SZOMB, possibly also SIDL, SSTOP). I'll test the following version on my system: if (displaymode == DISP_CPU && !show_idle && (pp->ki_pctcpu == 0 || pp->ki_stat == SZOMB || pp->ki_stat == SSTOP)) /* skip idle or non-running processes */ continue;> Has anyone same experiences made with top, or has > anyone a workaround (please not like while true........)Patch included (not verified to apply to 5.x or 6.x, but editing the test in place should be easy, then). Regards, STefan --- /usr/src/usr.bin/top/machine.c 18 May 2005 13:42:51 -0000 1.74 +++ /usr/src/usr.bin/top/machine.c 30 Jan 2006 14:26:08 -0000 @@ -601,7 +601,7 @@ continue; if (displaymode == DISP_CPU && !show_idle && - (pp->ki_pctcpu == 0 || pp->ki_stat != SRUN)) + (pp->ki_pctcpu == 0 || pp->ki_stat == SZOMB || pp->ki_stat == SSTOP)) /* skip idle or non-running processes */ continue;
Hello, sorry for the time ago, i haven't an FreeBSD-Box on my Work. The CLI-Optin -S doesn't really help me. I will test the patch from Stefan Esser, but i think my Problem are not alone SRUN-Proc's. if i run TOP with the CLI-Options -I -S so i should see Processes with status RUN and SRUN, if i was right. I have also running top described as above, and now i do a make -j 16 cleen cleandir cleandepend under /usr/src, so i unterstand things right i shoud see minimum 3 or more Processes with status RUN ( System was Sempron 2400 @1800MHz). But i shows only one and this very short, but if the system runs i could see an process named pagexxxxx, and if the system was idle i can see an process with status SRUN called idle.... So i get the time i will test the Patch from Stefan. If i getting new values and experiences i come back again. Tahnks to all and best regards michael 2006/1/30, Stefan Esser <se@freebsd.org>:> On 2006-01-30 13:49 +0100, Michael Schuh <michael.schuh@gmail.com> wrote: > > Hello, > > > > i use top mostly in idle-mode. > > # top <return> <i> > > or > > # top -I > > > > Under releng_6 (stable p4) and the older versions, > > i think down to releng_5, doesn't show a running process. > > > > I have tryed to dig in the source but my experiences are not > > so good that i can find the possible error. > > See line 603 (in HEAD) of /usr/src/usr.bin/top/machine.c: > > if (displaymode == DISP_CPU && !show_idle && > (pp->ki_pctcpu == 0 || pp->ki_stat != SRUN)) > /* skip idle or non-running processes */ > continue; > > Since I do not like the current behaviour, I considered removing the > test for state SRUN. But I guess that the teest can not be completely > eliminated. Instead of selecting only SRUN, some states may need to > be suppressed (SZOMB, possibly also SIDL, SSTOP). > > I'll test the following version on my system: > > if (displaymode == DISP_CPU && !show_idle && > (pp->ki_pctcpu == 0 || pp->ki_stat == SZOMB || pp->ki_stat == SSTOP)) > /* skip idle or non-running processes */ > continue; > > > Has anyone same experiences made with top, or has > > anyone a workaround (please not like while true........) > > Patch included (not verified to apply to 5.x or 6.x, but editing the > test in place should be easy, then). > > Regards, STefan > > --- /usr/src/usr.bin/top/machine.c 18 May 2005 13:42:51 -0000 1.74 > +++ /usr/src/usr.bin/top/machine.c 30 Jan 2006 14:26:08 -0000 > @@ -601,7 +601,7 @@ > continue; > > if (displaymode == DISP_CPU && !show_idle && > - (pp->ki_pctcpu == 0 || pp->ki_stat != SRUN)) > + (pp->ki_pctcpu == 0 || pp->ki_stat == SZOMB || pp->ki_stat == SSTOP)) > /* skip idle or non-running processes */ > continue; > >