- if ((status = processor_info (cpu_list[cpu],
- PROCESSOR_CPU_LOAD_INFO, &cpu_host,
- (processor_info_t) &cpu_info, &cpu_info_len)) != KERN_SUCCESS)
- {
- ERROR ("cpu plugin: processor_info failed with status %i", (int) status);
- continue;
- }
-
- if (cpu_info_len < CPU_STATE_MAX)
- {
- ERROR ("cpu plugin: processor_info returned only %i elements..", cpu_info_len);
- continue;
- }
-
- cpu_stage (cpu, CPU_STATE_USER, (derive_t) cpu_info.cpu_ticks[CPU_STATE_USER], now);
- cpu_stage (cpu, CPU_STATE_NICE, (derive_t) cpu_info.cpu_ticks[CPU_STATE_NICE], now);
- cpu_stage (cpu, CPU_STATE_SYSTEM, (derive_t) cpu_info.cpu_ticks[CPU_STATE_SYSTEM], now);
- cpu_stage (cpu, CPU_STATE_IDLE, (derive_t) cpu_info.cpu_ticks[CPU_STATE_IDLE], now);
-#endif /* PROCESSOR_CPU_LOAD_INFO */
-
-#if PROCESSOR_TEMPERATURE
- /*
- * Not all Apple computers do have this ability. To minimize
- * the messages sent to the syslog we do an exponential
- * stepback if `processor_info' fails. We still try ~once a day
- * though..
- */
- if (cpu_temp_retry_counter > 0)
- {
- cpu_temp_retry_counter--;
- continue;
- }
-
- cpu_temp_len = PROCESSOR_INFO_MAX;
-
- status = processor_info (cpu_list[cpu],
- PROCESSOR_TEMPERATURE,
- &cpu_host,
- cpu_temp, &cpu_temp_len);