diff options
author | jhb <jhb@FreeBSD.org> | 2003-04-22 20:54:04 +0000 |
---|---|---|
committer | jhb <jhb@FreeBSD.org> | 2003-04-22 20:54:04 +0000 |
commit | 128ae3c8d893885f814d7838d0d6b55e38ebd5a9 (patch) | |
tree | cf9f5e574a03e5a0a6e073bd5c35240d1b0b33b5 /sys/kern/subr_trap.c | |
parent | 41837c0a1432e00773a9f7e1c844133dc3f62fc2 (diff) | |
download | FreeBSD-src-128ae3c8d893885f814d7838d0d6b55e38ebd5a9.zip FreeBSD-src-128ae3c8d893885f814d7838d0d6b55e38ebd5a9.tar.gz |
- Move PS_PROFIL and its new cousin PS_STOPPROF back over to p_flag and
rename them appropriately. Protect both flags with both the proc lock
and the sched_lock.
- Protect p_profthreads with the proc lock.
- Remove Giant from profil(2).
Diffstat (limited to 'sys/kern/subr_trap.c')
-rw-r--r-- | sys/kern/subr_trap.c | 9 |
1 files changed, 3 insertions, 6 deletions
diff --git a/sys/kern/subr_trap.c b/sys/kern/subr_trap.c index 74d8fd6..11e25e4 100644 --- a/sys/kern/subr_trap.c +++ b/sys/kern/subr_trap.c @@ -115,11 +115,8 @@ userret(td, frame, oticks) /* * Charge system time if profiling. - * - * XXX should move PS_PROFIL to a place that can obviously be - * accessed safely without sched_lock. */ - if (p->p_sflag & PS_PROFIL) { + if (p->p_flag & P_PROFIL) { quad_t ticks; mtx_lock_spin(&sched_lock); @@ -182,7 +179,7 @@ ast(struct trapframe *framep) TDF_NEEDRESCHED | TDF_OWEUPC); cnt.v_soft++; prticks = 0; - if (flags & TDF_OWEUPC && sflag & PS_PROFIL) { + if (flags & TDF_OWEUPC && p->p_flag & P_PROFIL) { prticks = p->p_stats->p_prof.pr_ticks; p->p_stats->p_prof.pr_ticks = 0; } @@ -197,7 +194,7 @@ ast(struct trapframe *framep) if (td->td_ucred != p->p_ucred) cred_update_thread(td); - if (flags & TDF_OWEUPC && sflag & PS_PROFIL) + if (flags & TDF_OWEUPC && p->p_flag & P_PROFIL) addupc_task(td, p->p_stats->p_prof.pr_addr, prticks); if (sflag & PS_ALRMPEND) { PROC_LOCK(p); |