Simplify the initialization logic for cpu_throttle.stp Rather than ensuring there is an instance for each of the cpus on the machine just make sure there is an instance for cpu0 to avoid having an empty array. As processors are throttled the other instances will be added.
diff --git a/stap-exporter/scripts/cpu_throttle.stp b/stap-exporter/scripts/cpu_throttle.stp index 98c5f42..e27fb00 100644 --- a/stap-exporter/scripts/cpu_throttle.stp +++ b/stap-exporter/scripts/cpu_throttle.stp
@@ -15,10 +15,8 @@ global throttled_time, throttled_state probe begin { - // initialize the accumlated time throttled for each processor - // FIXME need to know number of processors on system - for (i=0; i<8; ++i) - throttled_time[i] = 0 + // Make sure there is an instance in the throttled_time + throttled_time[0] = 0 } probe kprobe.function("therm_throt_process") {