diff --git a/sys/kern/kern_proc.c b/sys/kern/kern_proc.c index cf9de34bf065..e3737d73e7f3 100644 --- a/sys/kern/kern_proc.c +++ b/sys/kern/kern_proc.c @@ -756,7 +756,7 @@ fill_kinfo_proc(p, kp) /* Things in the kse */ kp->ki_rqindex = ke->ke_rqindex; kp->ki_oncpu = ke->ke_oncpu; - kp->ki_pctcpu = ke->ke_pctcpu; + kp->ki_pctcpu = sched_pctcpu(ke); } else { kp->ki_oncpu = -1; kp->ki_lastcpu = -1; diff --git a/sys/kern/sched_4bsd.c b/sys/kern/sched_4bsd.c index 04ed3f3e6717..7c4aa808ce5a 100644 --- a/sys/kern/sched_4bsd.c +++ b/sys/kern/sched_4bsd.c @@ -648,3 +648,9 @@ sched_sizeof_thread(void) { return (sizeof(struct thread)); } + +fixpt_t +sched_pctcpu(struct kse *ke) +{ + return (ke->ke_pctcpu); +} diff --git a/sys/sys/sched.h b/sys/sys/sched.h index 56d65d7f71e3..068911fa8b93 100644 --- a/sys/sys/sched.h +++ b/sys/sys/sched.h @@ -62,6 +62,11 @@ void sched_add(struct kse *ke); void sched_rem(struct kse *ke); struct kse *sched_choose(void); +/* + * and they use up cpu time. + */ +fixpt_t sched_pctcpu(struct kse *ke); + /* * These procedures tell the process data structure allocation code how * many bytes to actually allocate.