summaryrefslogtreecommitdiffstats
path: root/sys/kern/subr_prof.c
diff options
context:
space:
mode:
authorjhb <jhb@FreeBSD.org>2004-07-16 21:04:55 +0000
committerjhb <jhb@FreeBSD.org>2004-07-16 21:04:55 +0000
commit0cb3276d57e68364c5cd8f83dd504672a5e5f5b0 (patch)
tree40f1025728659f06a876858c57f12a51848d214c /sys/kern/subr_prof.c
parent1115416b3b78799329cdb0c7addff7c1ad2fc348 (diff)
downloadFreeBSD-src-0cb3276d57e68364c5cd8f83dd504672a5e5f5b0.zip
FreeBSD-src-0cb3276d57e68364c5cd8f83dd504672a5e5f5b0.tar.gz
- Move TDF_OWEPREEMPT, TDF_OWEUPC, and TDF_USTATCLOCK over to td_pflags
since they are only accessed by curthread and thus do not need any locking. - Move pr_addr and pr_ticks out of struct uprof (which is per-process) and directly into struct thread as td_profil_addr and td_profil_ticks as these variables are really per-thread. (They are used to defer an addupc_intr() that was too "hard" until ast()).
Diffstat (limited to 'sys/kern/subr_prof.c')
-rw-r--r--sys/kern/subr_prof.c7
1 files changed, 4 insertions, 3 deletions
diff --git a/sys/kern/subr_prof.c b/sys/kern/subr_prof.c
index 442ca6d..ba36093 100644
--- a/sys/kern/subr_prof.c
+++ b/sys/kern/subr_prof.c
@@ -481,10 +481,11 @@ addupc_intr(struct thread *td, uintptr_t pc, u_int ticks)
addr = prof->pr_base + i;
mtx_unlock_spin(&sched_lock);
if ((v = fuswintr(addr)) == -1 || suswintr(addr, v + ticks) == -1) {
- prof->pr_addr = pc;
- prof->pr_ticks = ticks;
+ td->td_profil_addr = pc;
+ td->td_profil_ticks = ticks;
+ td->td_pflags |= TDP_OWEUPC;
mtx_lock_spin(&sched_lock);
- td->td_flags |= TDF_OWEUPC | TDF_ASTPENDING;
+ td->td_flags |= TDF_ASTPENDING;
mtx_unlock_spin(&sched_lock);
}
}
OpenPOWER on IntegriCloud