- Add the new sched_pctcpu() function to the sched_* api.

- Provide a routine in sched_4bsd to add this functionality.
 - Use sched_pctcpu() in kern_proc, which is the one place outside of
   sched_4bsd where the old pctcpu value was accessed directly.

Approved by:	re
This commit is contained in:
Jeff Roberson 2002-11-21 09:30:55 +00:00
parent 855a310fcb
commit 79acfc497b
Notes: svn2git 2020-12-20 02:59:44 +00:00
svn path=/head/; revision=107137
3 changed files with 12 additions and 1 deletions

View File

@ -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;

View File

@ -648,3 +648,9 @@ sched_sizeof_thread(void)
{
return (sizeof(struct thread));
}
fixpt_t
sched_pctcpu(struct kse *ke)
{
return (ke->ke_pctcpu);
}

View File

@ -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.