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

Diff for /src/usr.bin/vmstat/dkstats.c between version 1.29 and 1.30

version 1.29, 2006/03/31 04:06:13 version 1.30, 2006/03/31 18:19:38
Line 75 
Line 75 
 }  }
   
 /*  /*
  * Dereference the namelist pointer `v' and fill in the local copy   * Dereference the namelist pointer `v' and fill in the local copy
  * 'p' which is of size 's'.   * 'p' which is of size 's'.
  */   */
 #define deref_nl(v, p, s) deref_kptr((void *)namelist[(v)].n_value, (p), (s));  #define deref_nl(v, p, s) deref_kptr((void *)namelist[(v)].n_value, (p), (s));
Line 98 
Line 98 
 #endif  #endif
   
 /* Backward compatibility references. */  /* Backward compatibility references. */
 int             dk_ndrive = 0;  int             dk_ndrive = 0;
 int             *dk_select;  int             *dk_select;
 char            **dr_name;  char            **dr_name;
   
Line 156 
Line 156 
 }  }
   
 /*  /*
  * Read the disk statistics for each disk in the disk list.   * Read the disk statistics for each disk in the disk list.
  * Also collect statistics for tty i/o and cpu ticks.   * Also collect statistics for tty i/o and cpu ticks.
  */   */
 void  void
Line 351 
Line 351 
                 }                  }
                 free(q);                  free(q);
   
                 size = sizeof(cur.cp_time);                  size = sizeof(cur.cp_time);
                 mib[0] = CTL_KERN;                  mib[0] = CTL_KERN;
                 mib[1] = KERN_CPTIME;                  mib[1] = KERN_CPTIME;
                 if (sysctl(mib, 2, cur.cp_time, &size, NULL, 0) < 0) {                  if (sysctl(mib, 2, cur.cp_time, &size, NULL, 0) < 0) {
Line 490 
Line 490 
         last.dk_wbytes = calloc((size_t)cur.dk_ndrive, sizeof(u_int64_t));          last.dk_wbytes = calloc((size_t)cur.dk_ndrive, sizeof(u_int64_t));
         cur.dk_select = calloc((size_t)cur.dk_ndrive, sizeof(int));          cur.dk_select = calloc((size_t)cur.dk_ndrive, sizeof(int));
         cur.dk_name = calloc((size_t)cur.dk_ndrive, sizeof(char *));          cur.dk_name = calloc((size_t)cur.dk_ndrive, sizeof(char *));
   
         if (!cur.dk_time || !cur.dk_rxfer || !cur.dk_wxfer || !cur.dk_seek ||          if (!cur.dk_time || !cur.dk_rxfer || !cur.dk_wxfer || !cur.dk_seek ||
             !cur.dk_rbytes || !cur.dk_wbytes || !last.dk_time ||              !cur.dk_rbytes || !cur.dk_wbytes || !last.dk_time ||
             !last.dk_rxfer || !last.dk_wxfer || !last.dk_seek ||              !last.dk_rxfer || !last.dk_wxfer || !last.dk_seek ||
Line 544 
Line 544 
   
 #if !defined(NOKVM)  #if !defined(NOKVM)
 /*  /*
  * Dereference the kernel pointer `kptr' and fill in the local copy   * Dereference the kernel pointer `kptr' and fill in the local copy
  * pointed to by `ptr'.  The storage space must be pre-allocated,   * pointed to by `ptr'.  The storage space must be pre-allocated,
  * and the size of the copy passed in `len'.   * and the size of the copy passed in `len'.
  */   */

Legend:
Removed from v.1.29  
changed lines
  Added in v.1.30