[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.37 and 1.38

version 1.37, 2015/01/16 06:40:14 version 1.38, 2015/12/24 03:25:08
Line 221 
Line 221 
                                                 last.dk_seek[i] = 0;                                                  last.dk_seek[i] = 0;
                                                 last.dk_rbytes[i] = 0;                                                  last.dk_rbytes[i] = 0;
                                                 last.dk_wbytes[i] = 0;                                                  last.dk_wbytes[i] = 0;
                                                 bzero(&last.dk_time[i],                                                  memset(&last.dk_time[i], 0,
                                                     sizeof(struct timeval));                                                      sizeof(struct timeval));
                                                 continue;                                                  continue;
                                         }                                          }
Line 319 
Line 319 
                                                 last.dk_seek[i] = 0;                                                  last.dk_seek[i] = 0;
                                                 last.dk_rbytes[i] = 0;                                                  last.dk_rbytes[i] = 0;
                                                 last.dk_wbytes[i] = 0;                                                  last.dk_wbytes[i] = 0;
                                                 bzero(&last.dk_time[i],                                                  memset(&last.dk_time[i], 0,
                                                     sizeof(struct timeval));                                                      sizeof(struct timeval));
                                                 continue;                                                  continue;
                                         }                                          }
Line 361 
Line 361 
 #ifdef  DEBUG  #ifdef  DEBUG
                         warn("could not read hw.diskstats");                          warn("could not read hw.diskstats");
 #endif  /* DEBUG */  #endif  /* DEBUG */
                         bzero(q, cur.dk_ndrive * sizeof(struct diskstats));                          memset(q, 0, cur.dk_ndrive * sizeof(struct diskstats));
                 }                  }
   
                 for (i = 0; i < cur.dk_ndrive; i++)     {                  for (i = 0; i < cur.dk_ndrive; i++)     {
Line 379 
Line 379 
                 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) {
                         warn("could not read kern.cp_time");                          warn("could not read kern.cp_time");
                         bzero(cur.cp_time, sizeof(cur.cp_time));                          memset(cur.cp_time, 0, sizeof(cur.cp_time));
                 }                  }
                 size = sizeof(cur.tk_nin);                  size = sizeof(cur.tk_nin);
                 mib[0] = CTL_KERN;                  mib[0] = CTL_KERN;
Line 573 
Line 573 
         char buf[128];          char buf[128];
   
         if (kvm_read(kd, (u_long)kptr, ptr, len) != len) {          if (kvm_read(kd, (u_long)kptr, ptr, len) != len) {
                 bzero(buf, sizeof(buf));                  memset(buf, 0, sizeof(buf));
                 snprintf(buf, (sizeof(buf) - 1),                  snprintf(buf, (sizeof(buf) - 1),
                      "can't dereference kptr 0x%lx", (u_long)kptr);                       "can't dereference kptr 0x%lx", (u_long)kptr);
                 KVM_ERROR(buf);                  KVM_ERROR(buf);

Legend:
Removed from v.1.37  
changed lines
  Added in v.1.38