[BACK]Return to vmstat.c CVS log [TXT][DIR] Up to [cvs.NetBSD.org] / src / usr.bin / vmstat

Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files.

Diff for /src/usr.bin/vmstat/vmstat.c between version 1.248 and 1.249

version 1.248, 2021/11/27 22:16:42 version 1.249, 2022/02/01 09:18:07
Line 569  getnlist(int todo)
Line 569  getnlist(int todo)
 char **  char **
 choosedrives(char **argv)  choosedrives(char **argv)
 {  {
         size_t i;          size_t i, j, k;
   
         /*          /*
          * Choose drives to be displayed.  Priority goes to (in order) drives           * Choose drives to be displayed.  Priority goes to (in order) drives
Line 591  choosedrives(char **argv)
Line 591  choosedrives(char **argv)
                         break;                          break;
                 }                  }
         }          }
   
           /*
            * Pick the most active drives.  Must read the stats once before
            * sorting so that there is current IO data, before selecting
            * just the first two drives.
            */
           drvreadstats();
         for (i = 0; i < ndrive && ndrives < 2; i++) {          for (i = 0; i < ndrive && ndrives < 2; i++) {
                 if (drv_select[i])                  uint64_t high_bytes = 0, bytes;
                         continue;  
                 drv_select[i] = 1;                  k = ndrive;
                 ++ndrives;                  for (j = 0; j < ndrive; j++) {
                           if (drv_select[j])
                                   continue;
                           bytes = cur.rbytes[j] + cur.wbytes[j];
                           if (bytes > high_bytes) {
                                   high_bytes = bytes;
                                   k = j;
                           }
                   }
                   if (k != ndrive) {
                           drv_select[k] = 1;
                           ++ndrives;
                   }
         }          }
   
         return (argv);          return (argv);

Legend:
Removed from v.1.248  
changed lines
  Added in v.1.249

CVSweb <webmaster@jp.NetBSD.org>