handle cpus in 'faulted' state

This commit is contained in:
Doug MacEachern 2007-06-28 00:00:17 +00:00
parent 3e064dfeb7
commit 3dea5eb761
1 changed files with 6 additions and 4 deletions

View File

@ -105,15 +105,17 @@ int sigar_get_kstats(sigar_t *sigar)
for (i=0, id=0; i<ncpu; id++) {
kstat_t *cpu_info, *cpu_stat;
if (!(cpu_stat = kstat_lookup(kc, "cpu_stat", id, NULL))) {
if (!(cpu_info = kstat_lookup(kc, "cpu_info", id, NULL))) {
continue;
}
if (!(cpu_stat = kstat_lookup(kc, "cpu_stat", id, NULL))) {
/* XXX warn, faulted cpu? */
}
sigar->ks.cpu_info[i] = cpu_info;
sigar->ks.cpu[i] = cpu_stat;
sigar->ks.cpuid[i] = id;
if ((cpu_info = kstat_lookup(kc, "cpu_info", id, NULL))) {
sigar->ks.cpu_info[i] = cpu_info;
}
if (is_debug) {
sigar_log_printf(sigar, SIGAR_LOG_DEBUG,