Deleted Added
full compact
vmstat.c (4930) vmstat.c (6988)
1/*-
2 * Copyright (c) 1983, 1989, 1992, 1993
3 * The Regents of the University of California. All rights reserved.
4 *
5 * Redistribution and use in source and binary forms, with or without
6 * modification, are permitted provided that the following conditions
7 * are met:
8 * 1. Redistributions of source code must retain the above copyright

--- 59 unchanged lines hidden (view full) ---

68 long *dk_time;
69 long *dk_wds;
70 long *dk_seek;
71 long *dk_xfer;
72 int dk_busy;
73 struct nchstats nchstats;
74 long nchcount;
75 long *intrcnt;
1/*-
2 * Copyright (c) 1983, 1989, 1992, 1993
3 * The Regents of the University of California. All rights reserved.
4 *
5 * Redistribution and use in source and binary forms, with or without
6 * modification, are permitted provided that the following conditions
7 * are met:
8 * 1. Redistributions of source code must retain the above copyright

--- 59 unchanged lines hidden (view full) ---

68 long *dk_time;
69 long *dk_wds;
70 long *dk_seek;
71 long *dk_xfer;
72 int dk_busy;
73 struct nchstats nchstats;
74 long nchcount;
75 long *intrcnt;
76 int bufspace;
76} s, s1, s2, z;
77
78#define cnt s.Cnt
79#define oldcnt s1.Cnt
80#define total s.Total
81#define nchtotal s.nchstats
82#define oldnchtotal s1.nchstats
83

--- 65 unchanged lines hidden (view full) ---

149#define X_INTRNAMES 9
150 { "_intrnames" },
151#define X_EINTRNAMES 10
152 { "_eintrnames" },
153#define X_INTRCNT 11
154 { "_intrcnt" },
155#define X_EINTRCNT 12
156 { "_eintrcnt" },
77} s, s1, s2, z;
78
79#define cnt s.Cnt
80#define oldcnt s1.Cnt
81#define total s.Total
82#define nchtotal s.nchstats
83#define oldnchtotal s1.nchstats
84

--- 65 unchanged lines hidden (view full) ---

150#define X_INTRNAMES 9
151 { "_intrnames" },
152#define X_EINTRNAMES 10
153 { "_eintrnames" },
154#define X_INTRCNT 11
155 { "_intrcnt" },
156#define X_EINTRCNT 12
157 { "_eintrcnt" },
158#define X_BUFFERSPACE 13
159 { "_bufspace" },
157 { "" },
158};
159
160/*
161 * These constants define where the major pieces are laid out
162 */
163#define STATROW 0 /* uses 1 row and 68 cols */
164#define STATCOL 2

--- 125 unchanged lines hidden (view full) ---

290 mvprintw(INTSROW + 1, INTSCOL + 9, "total");
291
292 mvprintw(VMSTATROW + 0, VMSTATCOL + 10, "cow");
293 mvprintw(VMSTATROW + 1, VMSTATCOL + 10, "objlk");
294 mvprintw(VMSTATROW + 2, VMSTATCOL + 10, "objht");
295 mvprintw(VMSTATROW + 3, VMSTATCOL + 10, "zfod");
296 mvprintw(VMSTATROW + 4, VMSTATCOL + 10, "nzfod");
297 mvprintw(VMSTATROW + 5, VMSTATCOL + 10, "%%zfod");
160 { "" },
161};
162
163/*
164 * These constants define where the major pieces are laid out
165 */
166#define STATROW 0 /* uses 1 row and 68 cols */
167#define STATCOL 2

--- 125 unchanged lines hidden (view full) ---

293 mvprintw(INTSROW + 1, INTSCOL + 9, "total");
294
295 mvprintw(VMSTATROW + 0, VMSTATCOL + 10, "cow");
296 mvprintw(VMSTATROW + 1, VMSTATCOL + 10, "objlk");
297 mvprintw(VMSTATROW + 2, VMSTATCOL + 10, "objht");
298 mvprintw(VMSTATROW + 3, VMSTATCOL + 10, "zfod");
299 mvprintw(VMSTATROW + 4, VMSTATCOL + 10, "nzfod");
300 mvprintw(VMSTATROW + 5, VMSTATCOL + 10, "%%zfod");
298 mvprintw(VMSTATROW + 6, VMSTATCOL + 10, "kern");
301 mvprintw(VMSTATROW + 6, VMSTATCOL + 10, "cache");
299 mvprintw(VMSTATROW + 7, VMSTATCOL + 10, "wire");
300 mvprintw(VMSTATROW + 8, VMSTATCOL + 10, "act");
301 mvprintw(VMSTATROW + 9, VMSTATCOL + 10, "inact");
302 mvprintw(VMSTATROW + 10, VMSTATCOL + 10, "free");
303 mvprintw(VMSTATROW + 11, VMSTATCOL + 10, "daefr");
304 mvprintw(VMSTATROW + 12, VMSTATCOL + 10, "prcfr");
305 mvprintw(VMSTATROW + 13, VMSTATCOL + 10, "react");
306 mvprintw(VMSTATROW + 14, VMSTATCOL + 10, "pdwake");
307 mvprintw(VMSTATROW + 15, VMSTATCOL + 10, "pdpgs");
308 if (LINES - 1 > VMSTATROW + 16)
309 mvprintw(VMSTATROW + 16, VMSTATCOL + 10, "intrn");
302 mvprintw(VMSTATROW + 7, VMSTATCOL + 10, "wire");
303 mvprintw(VMSTATROW + 8, VMSTATCOL + 10, "act");
304 mvprintw(VMSTATROW + 9, VMSTATCOL + 10, "inact");
305 mvprintw(VMSTATROW + 10, VMSTATCOL + 10, "free");
306 mvprintw(VMSTATROW + 11, VMSTATCOL + 10, "daefr");
307 mvprintw(VMSTATROW + 12, VMSTATCOL + 10, "prcfr");
308 mvprintw(VMSTATROW + 13, VMSTATCOL + 10, "react");
309 mvprintw(VMSTATROW + 14, VMSTATCOL + 10, "pdwake");
310 mvprintw(VMSTATROW + 15, VMSTATCOL + 10, "pdpgs");
311 if (LINES - 1 > VMSTATROW + 16)
312 mvprintw(VMSTATROW + 16, VMSTATCOL + 10, "intrn");
313 if (LINES - 1 > VMSTATROW + 17)
314 mvprintw(VMSTATROW + 17, VMSTATCOL + 10, "buf");
310
311 mvprintw(GENSTATROW, GENSTATCOL, " Csw Trp Sys Int Sof Flt");
312
313 mvprintw(GRAPHROW, GRAPHCOL,
314 " . %%Sys . %%Intr . %%User . %%Nice . %%Idle");
315 mvprintw(PROCSROW, PROCSCOL, "Proc:r p d s w");
316 mvprintw(GRAPHROW + 1, GRAPHCOL,
317 "| | | | | | | | | | |");

--- 129 unchanged lines hidden (view full) ---

447 PUTRATE(Cnt.v_hits, VMSTATROW + 2, VMSTATCOL + 3, 6);
448 PUTRATE(Cnt.v_zfod, VMSTATROW + 3, VMSTATCOL + 4, 5);
449 PUTRATE(Cnt.v_nzfod, VMSTATROW + 4, VMSTATCOL + 3, 6);
450 {
451 unsigned long tot = cnt.v_zfod + cnt.v_nzfod;
452 putfloat(tot == 0 ? 0.0 : (100.0 * cnt.v_zfod / tot),
453 VMSTATROW + 5, VMSTATCOL + 2, 7, 2, 1);
454 }
315
316 mvprintw(GENSTATROW, GENSTATCOL, " Csw Trp Sys Int Sof Flt");
317
318 mvprintw(GRAPHROW, GRAPHCOL,
319 " . %%Sys . %%Intr . %%User . %%Nice . %%Idle");
320 mvprintw(PROCSROW, PROCSCOL, "Proc:r p d s w");
321 mvprintw(GRAPHROW + 1, GRAPHCOL,
322 "| | | | | | | | | | |");

--- 129 unchanged lines hidden (view full) ---

452 PUTRATE(Cnt.v_hits, VMSTATROW + 2, VMSTATCOL + 3, 6);
453 PUTRATE(Cnt.v_zfod, VMSTATROW + 3, VMSTATCOL + 4, 5);
454 PUTRATE(Cnt.v_nzfod, VMSTATROW + 4, VMSTATCOL + 3, 6);
455 {
456 unsigned long tot = cnt.v_zfod + cnt.v_nzfod;
457 putfloat(tot == 0 ? 0.0 : (100.0 * cnt.v_zfod / tot),
458 VMSTATROW + 5, VMSTATCOL + 2, 7, 2, 1);
459 }
455 putint(pgtokb(cnt.v_kernel_pages), VMSTATROW + 6, VMSTATCOL, 9);
460 putint(pgtokb(cnt.v_cache_count), VMSTATROW + 6, VMSTATCOL, 9);
456 putint(pgtokb(cnt.v_wire_count), VMSTATROW + 7, VMSTATCOL, 9);
457 putint(pgtokb(cnt.v_active_count), VMSTATROW + 8, VMSTATCOL, 9);
458 putint(pgtokb(cnt.v_inactive_count), VMSTATROW + 9, VMSTATCOL, 9);
459 putint(pgtokb(cnt.v_free_count), VMSTATROW + 10, VMSTATCOL, 9);
460 PUTRATE(Cnt.v_dfree, VMSTATROW + 11, VMSTATCOL, 9);
461 PUTRATE(Cnt.v_pfree, VMSTATROW + 12, VMSTATCOL, 9);
462 PUTRATE(Cnt.v_reactivated, VMSTATROW + 13, VMSTATCOL, 9);
463 PUTRATE(Cnt.v_pdwakeups, VMSTATROW + 14, VMSTATCOL, 9);
464 PUTRATE(Cnt.v_pdpages, VMSTATROW + 15, VMSTATCOL, 9);
465 if (LINES - 1 > VMSTATROW + 16)
466 PUTRATE(Cnt.v_intrans, VMSTATROW + 16, VMSTATCOL, 9);
461 putint(pgtokb(cnt.v_wire_count), VMSTATROW + 7, VMSTATCOL, 9);
462 putint(pgtokb(cnt.v_active_count), VMSTATROW + 8, VMSTATCOL, 9);
463 putint(pgtokb(cnt.v_inactive_count), VMSTATROW + 9, VMSTATCOL, 9);
464 putint(pgtokb(cnt.v_free_count), VMSTATROW + 10, VMSTATCOL, 9);
465 PUTRATE(Cnt.v_dfree, VMSTATROW + 11, VMSTATCOL, 9);
466 PUTRATE(Cnt.v_pfree, VMSTATROW + 12, VMSTATCOL, 9);
467 PUTRATE(Cnt.v_reactivated, VMSTATROW + 13, VMSTATCOL, 9);
468 PUTRATE(Cnt.v_pdwakeups, VMSTATROW + 14, VMSTATCOL, 9);
469 PUTRATE(Cnt.v_pdpages, VMSTATROW + 15, VMSTATCOL, 9);
470 if (LINES - 1 > VMSTATROW + 16)
471 PUTRATE(Cnt.v_intrans, VMSTATROW + 16, VMSTATCOL, 9);
472 if (LINES - 1 > VMSTATROW + 17)
473 putint(s.bufspace/1024, VMSTATROW + 17, VMSTATCOL, 9);
467 PUTRATE(Cnt.v_vnodein, PAGEROW + 2, PAGECOL + 5, 5);
468 PUTRATE(Cnt.v_vnodeout, PAGEROW + 2, PAGECOL + 10, 5);
469 PUTRATE(Cnt.v_swapin, PAGEROW + 2, PAGECOL + 17, 5);
470 PUTRATE(Cnt.v_swapout, PAGEROW + 2, PAGECOL + 22, 5);
471 PUTRATE(Cnt.v_vnodepgsin, PAGEROW + 3, PAGECOL + 5, 5);
472 PUTRATE(Cnt.v_vnodepgsout, PAGEROW + 3, PAGECOL + 10, 5);
473 PUTRATE(Cnt.v_swappgsin, PAGEROW + 3, PAGECOL + 17, 5);
474 PUTRATE(Cnt.v_swappgsout, PAGEROW + 3, PAGECOL + 22, 5);

--- 127 unchanged lines hidden (view full) ---

602 struct Info *s;
603 enum state st;
604{
605 int mib[2], size;
606 extern int errno;
607
608 NREAD(X_CPTIME, s->time, sizeof s->time);
609 NREAD(X_CNT, &s->Cnt, sizeof s->Cnt);
474 PUTRATE(Cnt.v_vnodein, PAGEROW + 2, PAGECOL + 5, 5);
475 PUTRATE(Cnt.v_vnodeout, PAGEROW + 2, PAGECOL + 10, 5);
476 PUTRATE(Cnt.v_swapin, PAGEROW + 2, PAGECOL + 17, 5);
477 PUTRATE(Cnt.v_swapout, PAGEROW + 2, PAGECOL + 22, 5);
478 PUTRATE(Cnt.v_vnodepgsin, PAGEROW + 3, PAGECOL + 5, 5);
479 PUTRATE(Cnt.v_vnodepgsout, PAGEROW + 3, PAGECOL + 10, 5);
480 PUTRATE(Cnt.v_swappgsin, PAGEROW + 3, PAGECOL + 17, 5);
481 PUTRATE(Cnt.v_swappgsout, PAGEROW + 3, PAGECOL + 22, 5);

--- 127 unchanged lines hidden (view full) ---

609 struct Info *s;
610 enum state st;
611{
612 int mib[2], size;
613 extern int errno;
614
615 NREAD(X_CPTIME, s->time, sizeof s->time);
616 NREAD(X_CNT, &s->Cnt, sizeof s->Cnt);
617 NREAD(X_BUFFERSPACE, &s->bufspace, LONG);
610 NREAD(X_DK_BUSY, &s->dk_busy, LONG);
611 NREAD(X_DK_TIME, s->dk_time, dk_ndrive * LONG);
612 NREAD(X_DK_XFER, s->dk_xfer, dk_ndrive * LONG);
613 NREAD(X_DK_WDS, s->dk_wds, dk_ndrive * LONG);
614 NREAD(X_DK_SEEK, s->dk_seek, dk_ndrive * LONG);
615 NREAD(X_NCHSTATS, &s->nchstats, sizeof s->nchstats);
616 NREAD(X_INTRCNT, s->intrcnt, nintr * LONG);
617 size = sizeof(s->Total);

--- 66 unchanged lines hidden ---
618 NREAD(X_DK_BUSY, &s->dk_busy, LONG);
619 NREAD(X_DK_TIME, s->dk_time, dk_ndrive * LONG);
620 NREAD(X_DK_XFER, s->dk_xfer, dk_ndrive * LONG);
621 NREAD(X_DK_WDS, s->dk_wds, dk_ndrive * LONG);
622 NREAD(X_DK_SEEK, s->dk_seek, dk_ndrive * LONG);
623 NREAD(X_NCHSTATS, &s->nchstats, sizeof s->nchstats);
624 NREAD(X_INTRCNT, s->intrcnt, nintr * LONG);
625 size = sizeof(s->Total);

--- 66 unchanged lines hidden ---