[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.47 and 1.48

version 1.47, 2004/05/22 18:06:12 version 1.48, 2004/06/11 05:55:43
Line 147 
Line 147 
 #if defined(__i386__)  #if defined(__i386__)
 #define X_INTRHAND      4               /* no sysctl */  #define X_INTRHAND      4               /* no sysctl */
         { "_intrhand" },          { "_intrhand" },
   #define X_APICINTRHAND  5               /* no sysctl */
           { "_apic_intrhand" },
 #endif  #endif
         { "" },          { "" },
 };  };
Line 186 
Line 188 
         if (namelist[0].n_type == 0) {          if (namelist[0].n_type == 0) {
                 if ((ret = kvm_nlist(kd, namelist)) == -1)                  if ((ret = kvm_nlist(kd, namelist)) == -1)
                         errx(1, "%s", kvm_geterr(kd));                          errx(1, "%s", kvm_geterr(kd));
   #if defined(__i386__)
                   else if (ret > 1 && namelist[X_APICINTRHAND].n_value == 0)
                           nlisterr(namelist);
   #endif
                 else if (ret)                  else if (ret)
                         nlisterr(namelist);                          nlisterr(namelist);
                 if (namelist[0].n_type == 0) {                  if (namelist[0].n_type == 0) {
Line 199 
Line 205 
         if (nintr == 0) {          if (nintr == 0) {
 #if defined(__i386__)  #if defined(__i386__)
                 struct intrhand *intrhand[16], *ihp, ih;                  struct intrhand *intrhand[16], *ihp, ih;
                   struct intrhand *apicintrhand[256];
                 char iname[16];                  char iname[16];
                 int namelen, n;                  int namelen, n;
   
Line 213 
Line 220 
                                 ihp = ih.ih_next;                                  ihp = ih.ih_next;
                         }                          }
                 }                  }
                   if (namelist[X_APICINTRHAND].n_value) {
                           NREAD(X_APICINTRHAND, apicintrhand, sizeof(apicintrhand));
                           for (namelen = 0, i = 0; i < 256; i++) {
                                   ihp = apicintrhand[i];
                                   while (ihp) {
                                           nintr++;
                                           KREAD(ihp, &ih, sizeof(ih));
                                           KREAD(ih.ih_what, iname, 16);
                                           namelen += strlen(iname) + 1;
                                           printf("apic handler %x %s\n", i, iname);
                                           ihp = ih.ih_next;
                                   }
                           }
                   }
                 intrloc = calloc(nintr, sizeof (long));                  intrloc = calloc(nintr, sizeof (long));
                 intrname = calloc(nintr, sizeof (char *));                  intrname = calloc(nintr, sizeof (char *));
                 cp = intrnamebuf = malloc(namelen);                  cp = intrnamebuf = malloc(namelen);
Line 227 
Line 248 
                                 ihp = ih.ih_next;                                  ihp = ih.ih_next;
                         }                          }
                 }                  }
                   if (namelist[X_APICINTRHAND].n_value) {
                           for (i = 0, n = 0; i < 256; i++) {
                                   ihp = apicintrhand[i];
                                   while (ihp) {
                                           KREAD(ihp, &ih, sizeof(ih));
                                           KREAD(ih.ih_what, iname, 16);
                                           intrname[n++] = cp;
                                           strlcpy(cp, iname, intrnamebuf + namelen - cp);
                                           cp += strlen(iname) + 1;
                                           ihp = ih.ih_next;
                                   }
                           }
                   }
 #else  #else
                 nintr = (namelist[X_EINTRCNT].n_value -                  nintr = (namelist[X_EINTRCNT].n_value -
                     namelist[X_INTRCNT].n_value) / sizeof (int);                      namelist[X_INTRCNT].n_value) / sizeof (int);
Line 638 
Line 672 
         size_t size;          size_t size;
 #if defined(__i386__)  #if defined(__i386__)
         struct intrhand *intrhand[16], *ihp, ih;          struct intrhand *intrhand[16], *ihp, ih;
           struct intrhand *apicintrhand[256];
         int i, n;          int i, n;
 #endif  #endif
   
Line 650 
Line 685 
                         KREAD(ihp, &ih, sizeof(ih));                          KREAD(ihp, &ih, sizeof(ih));
                         s->intrcnt[n++] = ih.ih_count;                          s->intrcnt[n++] = ih.ih_count;
                         ihp = ih.ih_next;                          ihp = ih.ih_next;
                   }
           }
           if (namelist[X_APICINTRHAND].n_value) {
                   NREAD(X_APICINTRHAND, apicintrhand, sizeof(apicintrhand));
                   for (i = 0, n = 0; i < 256; i++) {
                           ihp = apicintrhand[i];
                           while (ihp) {
                                   KREAD(ihp, &ih, sizeof(ih));
                                   s->intrcnt[n++] = ih.ih_count;
                                   ihp = ih.ih_next;
                           }
                 }                  }
         }          }
 #else  #else

Legend:
Removed from v.1.47  
changed lines
  Added in v.1.48