diff --git a/sys/kern/sched_ule.c b/sys/kern/sched_ule.c index 3ad61d6a52dc..88b1a4722f92 100644 --- a/sys/kern/sched_ule.c +++ b/sys/kern/sched_ule.c @@ -710,8 +710,10 @@ fixpt_t sched_pctcpu(struct kse *ke) { fixpt_t pctcpu; + int realstathz; pctcpu = 0; + realstathz = stathz ? stathz : hz; if (ke->ke_ticks) { int rtick; @@ -722,7 +724,7 @@ sched_pctcpu(struct kse *ke) /* How many rtick per second ? */ rtick = ke->ke_ticks / (SCHED_CPU_TIME * 10000); - pctcpu = (FSCALE * ((FSCALE * rtick)/stathz)) >> FSHIFT; + pctcpu = (FSCALE * ((FSCALE * rtick)/realstathz)) >> FSHIFT; } ke->ke_proc->p_swtime = ke->ke_ltick - ke->ke_ftick;