summaryrefslogtreecommitdiffstats
path: root/sys
diff options
context:
space:
mode:
authorjeff <jeff@FreeBSD.org>2002-11-21 09:30:55 +0000
committerjeff <jeff@FreeBSD.org>2002-11-21 09:30:55 +0000
commitd5eb61ea8d5cf09af5c88effaa1786a4a9fad320 (patch)
treefde42729368c00945f803b78aa2601387000aefe /sys
parentde79ec94a5618dc0948e9e4033e44e677d1ae16a (diff)
downloadFreeBSD-src-d5eb61ea8d5cf09af5c88effaa1786a4a9fad320.zip
FreeBSD-src-d5eb61ea8d5cf09af5c88effaa1786a4a9fad320.tar.gz
- 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
Diffstat (limited to 'sys')
-rw-r--r--sys/kern/kern_proc.c2
-rw-r--r--sys/kern/sched_4bsd.c6
-rw-r--r--sys/sys/sched.h5
3 files changed, 12 insertions, 1 deletions
diff --git a/sys/kern/kern_proc.c b/sys/kern/kern_proc.c
index cf9de34..e3737d7 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 04ed3f3..7c4aa80 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 56d65d7..068911f 100644
--- a/sys/sys/sched.h
+++ b/sys/sys/sched.h
@@ -63,6 +63,11 @@ 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.
*/
OpenPOWER on IntegriCloud