[BACK]Return to vmstat.c CVS log [TXT][DIR] Up to [local] / src / usr.bin / systat

Diff for /src/usr.bin/systat/vmstat.c between version 1.85 and 1.86

version 1.85, 2018/05/19 13:24:10 version 1.86, 2018/06/22 14:22:06
Line 57 
Line 57 
 #include "dkstats.h"  #include "dkstats.h"
   
 #define MAXIMUM(a, b)   (((a) > (b)) ? (a) : (b))  #define MAXIMUM(a, b)   (((a) > (b)) ? (a) : (b))
   #define MINIMUM(a, b)   (((a) < (b)) ? (a) : (b))
   
 static struct Info {  static struct Info {
         long    time[CPUSTATES];          long    time[CPUSTATES];
Line 99 
Line 100 
 static  int nintr;  static  int nintr;
 static  long *intrloc;  static  long *intrloc;
 static  char **intrname;  static  char **intrname;
 static  int nextintsrow;  static  int ipktsrow;
   
 WINDOW *  WINDOW *
 openkre(void)  openkre(void)
Line 199 
Line 200 
                         return (-1);                          return (-1);
         }          }
   
         nextintsrow = INTSROW + 2;  
         allocinfo(&s);          allocinfo(&s);
         allocinfo(&s1);          allocinfo(&s1);
         allocinfo(&s2);          allocinfo(&s2);
Line 239 
Line 239 
         mvprintw(INTSROW, INTSCOL + 3, " Interrupts");          mvprintw(INTSROW, INTSCOL + 3, " Interrupts");
         mvprintw(INTSROW + 1, INTSCOL + 9, "total");          mvprintw(INTSROW + 1, INTSCOL + 9, "total");
   
         mvprintw(LINES - 3, INTSCOL + 9, "IPKTS");          j = INTSROW + 2;
         mvprintw(LINES - 2, INTSCOL + 9, "OPKTS");          for (i = 0; i < nintr; i++) {
                   intrloc[i] = 0;
                   if (s.intrcnt[i] == 0 || ipktsrow == LINES)
                           continue;
                   intrloc[i] = j++;
                   mvprintw(intrloc[i], INTSCOL + 9, "%-8.8s", intrname[i]);
           }
           ipktsrow = MAXIMUM(j, MINIMUM(LINES - 3, VMSTATROW + 17));
           if (LINES - 1 > ipktsrow)
                   mvprintw(ipktsrow, INTSCOL + 9, "IPKTS");
           if (LINES - 1 > ipktsrow + 1)
                   mvprintw(ipktsrow + 1, INTSCOL + 9, "OPKTS");
   
         mvprintw(VMSTATROW + 0, VMSTATCOL + 10, "forks");          mvprintw(VMSTATROW + 0, VMSTATCOL + 10, "forks");
         mvprintw(VMSTATROW + 1, VMSTATCOL + 10, "fkppw");          mvprintw(VMSTATROW + 1, VMSTATCOL + 10, "fkppw");
Line 261 
Line 272 
         if (LINES - 1 > VMSTATROW + 16)          if (LINES - 1 > VMSTATROW + 16)
                 mvprintw(VMSTATROW + 16, VMSTATCOL + 10, "pdscn");                  mvprintw(VMSTATROW + 16, VMSTATCOL + 10, "pdscn");
         if (LINES - 1 > VMSTATROW + 17)          if (LINES - 1 > VMSTATROW + 17)
                 mvprintw(VMSTATROW + 17, VMSTATCOL + 10, "pzidle");                  mvprintw(VMSTATROW + 17, VMSTATCOL + 10, "pzidl");
         if (LINES - 1 > VMSTATROW + 18)          if (LINES - 1 > VMSTATROW + 18)
                 mvprintw(VMSTATROW + 18, VMSTATCOL + 10, "kmapent");                  mvprintw(VMSTATROW + 18, VMSTATCOL + 10, "kmape");
   
         mvprintw(GENSTATROW, GENSTATCOL, "   Csw   Trp   Sys   Int   Sof  Flt");          mvprintw(GENSTATROW, GENSTATCOL, "   Csw   Trp   Sys   Int   Sof  Flt");
   
Line 340 
Line 351 
         etime /= hertz;          etime /= hertz;
         inttotal = 0;          inttotal = 0;
         for (i = 0; i < nintr; i++) {          for (i = 0; i < nintr; i++) {
                 if (s.intrcnt[i] == 0)  
                         continue;  
                 if (intrloc[i] == 0) {  
                         if (nextintsrow == LINES)  
                                 continue;  
                         intrloc[i] = nextintsrow++;  
                         mvprintw(intrloc[i], INTSCOL + 9, "%-8.8s",  
                             intrname[i]);  
                 }  
                 t = intcnt = s.intrcnt[i];                  t = intcnt = s.intrcnt[i];
                 s.intrcnt[i] -= s1.intrcnt[i];                  s.intrcnt[i] -= s1.intrcnt[i];
                 intcnt = (u_int64_t)((float)s.intrcnt[i]/etime + 0.5);                  intcnt = (u_int64_t)((float)s.intrcnt[i]/etime + 0.5);
                 inttotal += intcnt;                  inttotal += intcnt;
                 putuint64(intcnt, intrloc[i], INTSCOL, 8);                  if (intrloc[i] != 0)
                           putuint64(intcnt, intrloc[i], INTSCOL, 8);
         }          }
         putuint64(inttotal, INTSROW + 1, INTSCOL, 8);          putuint64(inttotal, INTSROW + 1, INTSCOL, 8);
         Z(ncs_goodhits); Z(ncs_badhits); Z(ncs_miss);          Z(ncs_goodhits); Z(ncs_badhits); Z(ncs_miss);
Line 361 
Line 364 
         s.nchcount = nchtotal.ncs_goodhits + nchtotal.ncs_badhits +          s.nchcount = nchtotal.ncs_goodhits + nchtotal.ncs_badhits +
             nchtotal.ncs_miss + nchtotal.ncs_long;              nchtotal.ncs_miss + nchtotal.ncs_long;
   
         putint(sum.ifc_ip, LINES - 3, INTSCOL, 8);          if (LINES - 1 > ipktsrow)
         putint(sum.ifc_op, LINES - 2, INTSCOL, 8);                  putint(sum.ifc_ip, ipktsrow, INTSCOL, 8);
           if (LINES - 1 > ipktsrow + 1)
                   putint(sum.ifc_op, ipktsrow + 1, INTSCOL, 8);
   
         psiz = 0;          psiz = 0;
         f2 = 0.0;          f2 = 0.0;

Legend:
Removed from v.1.85  
changed lines
  Added in v.1.86