summaryrefslogtreecommitdiffstats
path: root/sys/kern/subr_prof.c
diff options
context:
space:
mode:
authorjulian <julian@FreeBSD.org>2001-09-12 08:38:13 +0000
committerjulian <julian@FreeBSD.org>2001-09-12 08:38:13 +0000
commit5596676e6c6c1e81e899cd0531f9b1c28a292669 (patch)
treeb1a19fcdf05759281fab0d89efb13f0fdf42102e /sys/kern/subr_prof.c
parent83e00d4274950d2b531c24692cd123538ffbddb9 (diff)
downloadFreeBSD-src-5596676e6c6c1e81e899cd0531f9b1c28a292669.zip
FreeBSD-src-5596676e6c6c1e81e899cd0531f9b1c28a292669.tar.gz
KSE Milestone 2
Note ALL MODULES MUST BE RECOMPILED make the kernel aware that there are smaller units of scheduling than the process. (but only allow one thread per process at this time). This is functionally equivalent to teh previousl -current except that there is a thread associated with each process. Sorry john! (your next MFC will be a doosie!) Reviewed by: peter@freebsd.org, dillon@freebsd.org X-MFC after: ha ha ha ha
Diffstat (limited to 'sys/kern/subr_prof.c')
-rw-r--r--sys/kern/subr_prof.c23
1 files changed, 12 insertions, 11 deletions
diff --git a/sys/kern/subr_prof.c b/sys/kern/subr_prof.c
index e177065..ae1d5c3 100644
--- a/sys/kern/subr_prof.c
+++ b/sys/kern/subr_prof.c
@@ -356,8 +356,8 @@ struct profil_args {
*/
/* ARGSUSED */
int
-profil(p, uap)
- struct proc *p;
+profil(td, uap)
+ struct thread *td;
register struct profil_args *uap;
{
register struct uprof *upp;
@@ -371,10 +371,10 @@ profil(p, uap)
goto done2;
}
if (uap->scale == 0) {
- stopprofclock(p);
+ stopprofclock(td->td_proc);
goto done2;
}
- upp = &p->p_stats->p_prof;
+ upp = &td->td_proc->p_stats->p_prof;
/* Block profile interrupts while changing state. */
s = splstatclock();
@@ -382,7 +382,7 @@ profil(p, uap)
upp->pr_scale = uap->scale;
upp->pr_base = uap->samples;
upp->pr_size = uap->size;
- startprofclock(p);
+ startprofclock(td->td_proc);
splx(s);
done2:
@@ -413,8 +413,8 @@ done2:
* inaccurate.
*/
void
-addupc_intr(p, pc, ticks)
- register struct proc *p;
+addupc_intr(ke, pc, ticks)
+ register struct kse *ke;
register uintptr_t pc;
u_int ticks;
{
@@ -425,7 +425,7 @@ addupc_intr(p, pc, ticks)
if (ticks == 0)
return;
- prof = &p->p_stats->p_prof;
+ prof = &ke->ke_proc->p_stats->p_prof;
if (pc < prof->pr_off ||
(i = PC_TO_INDEX(pc, prof)) >= prof->pr_size)
return; /* out of range; ignore */
@@ -435,7 +435,7 @@ addupc_intr(p, pc, ticks)
mtx_lock_spin(&sched_lock);
prof->pr_addr = pc;
prof->pr_ticks = ticks;
- p->p_sflag |= PS_OWEUPC | PS_ASTPENDING;
+ ke->ke_flags |= KEF_OWEUPC | KEF_ASTPENDING ;
mtx_unlock_spin(&sched_lock);
}
}
@@ -445,11 +445,12 @@ addupc_intr(p, pc, ticks)
* update fails, we simply turn off profiling.
*/
void
-addupc_task(p, pc, ticks)
- register struct proc *p;
+addupc_task(ke, pc, ticks)
+ register struct kse *ke;
register uintptr_t pc;
u_int ticks;
{
+ struct proc *p = ke->ke_proc;
register struct uprof *prof;
register caddr_t addr;
register u_int i;
OpenPOWER on IntegriCloud