top: proc summary mismatch

Simon 'corecode' Schubert corecode at fs.ei.tum.de
Fri Mar 23 04:52:33 PDT 2007


Dmitry Lohansky wrote:
But is more better mark process as sleeping only if _all_ of this lwps
are in sleeping state.
I'm not sure.  Maybe we should display all lwps for the time being.  This for sure is an area of discussion.

 int process_states[6];
 char *procstatenames[] = {
-    "", " starting, ", " running, ", " sleeping, ", " stopped, ",
-    " zombie, ",
+    "", " starting, ", " running, ", " stopped, ", " zombie, ",
+    " sleeping, ",
     NULL
 };
well caught!

        {
            total_procs++;
+           if (LP(pp, stat) == LSSLEEP)
+               PP(pp, stat) = SZOMB + 1;
            process_states[(unsigned char) PP(pp, stat)]++;
I don't really like this.  Maybe something like

int state;

state = PP(pp, stat);
if (LP(pp, stat) == LSSLEEP)
   state = SZOMB + 1;
process_states[state]++;
what do you think?

cheers
 simon
--
Serve - BSD     +++  RENT this banner advert  +++    ASCII Ribbon   /"\
Work - Mac      +++  space for low €€€ NOW!1  +++      Campaign     \ /
Party Enjoy Relax   |   http://dragonflybsd.org      Against  HTML   \
Dude 2c 2 the max   !   http://golden-apple.biz       Mail + News   / \
Attachment:
signature.asc
-------------- next part --------------
A non-text attachment was scrubbed...
Name: pgp00008.pgp
Type: application/octet-stream
Size: 252 bytes
Desc: "Description: OpenPGP digital signature"
URL: <http://lists.dragonflybsd.org/pipermail/bugs/attachments/20070323/e9c7be8b/attachment-0016.obj>


More information about the Bugs mailing list