version 1.82, 2004/02/15 02:45:47 |
version 1.83, 2004/06/11 05:54:55 |
|
|
#if defined(__i386__) |
#if defined(__i386__) |
#define X_INTRHAND (X_END) /* no sysctl */ |
#define X_INTRHAND (X_END) /* no sysctl */ |
{ "_intrhand" }, |
{ "_intrhand" }, |
#define X_INTRSTRAY (X_END+1) /* no sysctl */ |
#define X_APICINTRHAND (X_END+1) /* no sysctl */ |
|
{ "_apic_intrhand" }, |
|
#define X_INTRSTRAY (X_END+2) /* no sysctl */ |
{ "_intrstray" }, |
{ "_intrstray" }, |
#endif |
#endif |
{ "" }, |
{ "" }, |
|
|
dointr(void) |
dointr(void) |
{ |
{ |
struct intrhand *intrhand[16], *ihp, ih; |
struct intrhand *intrhand[16], *ihp, ih; |
|
struct intrhand *apicintrhand[256]; |
u_long inttotal = 0; |
u_long inttotal = 0; |
time_t uptime; |
time_t uptime; |
u_long intrstray[16]; |
u_long intrstray[16]; |
|
|
ihp = intrhand[i]; |
ihp = intrhand[i]; |
while (ihp) { |
while (ihp) { |
if (kvm_read(kd, (u_long)ihp, &ih, |
if (kvm_read(kd, (u_long)ihp, &ih, |
sizeof(ih)) != sizeof(ih)) |
sizeof(ih)) != sizeof(ih)) |
errx(1, "vmstat: ih: %s", |
errx(1, "vmstat: ih: %s", |
kvm_geterr(kd)); |
kvm_geterr(kd)); |
if (kvm_read(kd, (u_long)ih.ih_what, iname, |
if (kvm_read(kd, (u_long)ih.ih_what, iname, |
16) != 16) |
16) != 16) |
errx(1, "vmstat: ih_what: %s", |
errx(1, "vmstat: ih_what: %s", |
kvm_geterr(kd)); |
kvm_geterr(kd)); |
snprintf(fname, sizeof fname, "irq%d/%s", i, |
snprintf(fname, sizeof fname, "irq%d/%s", i, |
iname); |
iname); |
printf("%-16.16s %10lu %8lu\n", fname, |
printf("%-16.16s %10lu %8lu\n", fname, |
ih.ih_count, ih.ih_count / uptime); |
ih.ih_count, ih.ih_count / uptime); |
|
inttotal += ih.ih_count; |
|
ihp = ih.ih_next; |
|
} |
|
} |
|
} |
|
{ |
|
kread(X_APICINTRHAND, apicintrhand, sizeof(apicintrhand)); |
|
|
|
for (i = 0; i < 256; i++) { |
|
ihp = apicintrhand[i]; |
|
while (ihp) { |
|
if (kvm_read(kd, (u_long)ihp, &ih, |
|
sizeof(ih)) != sizeof(ih)) |
|
errx(1, "vmstat: ih: %s", |
|
kvm_geterr(kd)); |
|
if (kvm_read(kd, (u_long)ih.ih_what, iname, |
|
16) != 16) |
|
errx(1, "vmstat: ih_what: %s", |
|
kvm_geterr(kd)); |
|
snprintf(fname, sizeof fname, "irq%d/%s", i, |
|
iname); |
|
printf("%-16.16s %10lu %8lu\n", fname, |
|
ih.ih_count, ih.ih_count / uptime); |
inttotal += ih.ih_count; |
inttotal += ih.ih_count; |
ihp = ih.ih_next; |
ihp = ih.ih_next; |
} |
} |