Changeset View
Changeset View
Standalone View
Standalone View
usr.sbin/powerd/powerd.c
Show First 20 Lines • Show All 162 Lines • ▼ Show 20 Lines | for (cpu = 0; cpu < ncpus; cpu++) { | ||||
total += cp_times[cpu * CPUSTATES + i] - | total += cp_times[cpu * CPUSTATES + i] - | ||||
cp_times_old[cpu * CPUSTATES + i]; | cp_times_old[cpu * CPUSTATES + i]; | ||||
} | } | ||||
if (total == 0) | if (total == 0) | ||||
continue; | continue; | ||||
*load += 100 - (cp_times[cpu * CPUSTATES + CP_IDLE] - | *load += 100 - (cp_times[cpu * CPUSTATES + CP_IDLE] - | ||||
cp_times_old[cpu * CPUSTATES + CP_IDLE]) * 100 / total; | cp_times_old[cpu * CPUSTATES + CP_IDLE]) * 100 / total; | ||||
} | } | ||||
*load /= ncpus; | |||||
} | } | ||||
memcpy(cp_times_old, cp_times, cp_times_len); | memcpy(cp_times_old, cp_times, cp_times_len); | ||||
return (0); | return (0); | ||||
} | } | ||||
static int | static int | ||||
▲ Show 20 Lines • Show All 616 Lines • Show Last 20 Lines |