[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.82 and 1.83

version 1.82, 2001/06/13 08:18:30 version 1.83, 2001/08/26 02:50:37
Line 773  dointr(int verbose)
Line 773  dointr(int verbose)
         }          }
         kread(X_INTRCNT, intrcnt, (size_t)nintr);          kread(X_INTRCNT, intrcnt, (size_t)nintr);
         kread(X_INTRNAMES, intrname, (size_t)inamlen);          kread(X_INTRNAMES, intrname, (size_t)inamlen);
         (void)printf("%-24s %16s %8s\n", "interrupt", "total", "rate");          (void)printf("%-34s %16s %8s\n", "interrupt", "total", "rate");
         inttotal = 0;          inttotal = 0;
         nintr /= sizeof(long);          nintr /= sizeof(long);
         while (--nintr >= 0) {          while (--nintr >= 0) {
                 if (*intrcnt || verbose)                  if (*intrcnt || verbose)
                         (void)printf("%-24s %16lld %8lld\n", intrname,                          (void)printf("%-34s %16lld %8lld\n", intrname,
                             (long long)*intrcnt,                              (long long)*intrcnt,
                             (long long)(*intrcnt / uptime));                              (long long)(*intrcnt / uptime));
                 intrname += strlen(intrname) + 1;                  intrname += strlen(intrname) + 1;
Line 811  event_chain_trashed:
Line 811  event_chain_trashed:
                         goto event_chain_trashed;                          goto event_chain_trashed;
   
                 (void)printf("%s %s%*s %16lld %8lld\n", evgroup, evname,                  (void)printf("%s %s%*s %16lld %8lld\n", evgroup, evname,
                     24 - (evcnt.ev_grouplen + 1 + evcnt.ev_namelen), "",                      34 - (evcnt.ev_grouplen + 1 + evcnt.ev_namelen), "",
                     (long long)evcnt.ev_count,                      (long long)evcnt.ev_count,
                     (long long)(evcnt.ev_count / uptime));                      (long long)(evcnt.ev_count / uptime));
   
                 inttotal += evcnt.ev_count++;                  inttotal += evcnt.ev_count++;
         }          }
         (void)printf("%-24s %16lld %8lld\n", "Total", inttotal,          (void)printf("%-34s %16lld %8lld\n", "Total", inttotal,
             (long long)(inttotal / uptime));              (long long)(inttotal / uptime));
 }  }
 #endif  #endif
Line 825  event_chain_trashed:
Line 825  event_chain_trashed:
 void  void
 doevcnt(int verbose)  doevcnt(int verbose)
 {  {
           static const char * evtypes [] = { "misc", "intr", "trap" };
         long long uptime;          long long uptime;
         struct evcntlist allevents;          struct evcntlist allevents;
         struct evcnt evcnt, *evptr;          struct evcnt evcnt, *evptr;
Line 833  doevcnt(int verbose)
Line 834  doevcnt(int verbose)
         /* XXX should print type! */          /* XXX should print type! */
   
         uptime = getuptime();          uptime = getuptime();
         (void)printf("%-24s %16s %8s %s\n", "event", "total", "rate", "type");          (void)printf("%-34s %16s %8s %s\n", "event", "total", "rate", "type");
         kread(X_ALLEVENTS, &allevents, sizeof allevents);          kread(X_ALLEVENTS, &allevents, sizeof allevents);
         evptr = allevents.tqh_first;          evptr = allevents.tqh_first;
         while (evptr) {          while (evptr) {
Line 858  event_chain_trashed:
Line 859  event_chain_trashed:
                         goto event_chain_trashed;                          goto event_chain_trashed;
   
                 (void)printf("%s %s%*s %16lld %8lld %s\n", evgroup, evname,                  (void)printf("%s %s%*s %16lld %8lld %s\n", evgroup, evname,
                     24 - (evcnt.ev_grouplen + 1 + evcnt.ev_namelen), "",                      34 - (evcnt.ev_grouplen + 1 + evcnt.ev_namelen), "",
                     (long long)evcnt.ev_count,                      (long long)evcnt.ev_count,
                     (long long)(evcnt.ev_count / uptime),                      (long long)(evcnt.ev_count / uptime),
                     /* XXX do the following with an array lookup XXX */                      (evcnt.ev_type < sizeof(evtypes)/sizeof(evtypes)
                     (evcnt.ev_type == EVCNT_TYPE_MISC) ? "misc" :                          ? evtypes[evcnt.ev_type] : "?"));
                         ((evcnt.ev_type == EVCNT_TYPE_INTR) ? "intr" : "?"));  
         }          }
 }  }
   

Legend:
Removed from v.1.82  
changed lines
  Added in v.1.83

CVSweb <webmaster@jp.NetBSD.org>