diff options
author | phk <phk@FreeBSD.org> | 2006-02-08 08:09:17 +0000 |
---|---|---|
committer | phk <phk@FreeBSD.org> | 2006-02-08 08:09:17 +0000 |
commit | 74f8e63a104485f17205e2a3e446e00f968c324c (patch) | |
tree | dcc7f358367ea74ccf47cede57e272875e9b589d /sys/alpha | |
parent | 4d8070a25b5c7585b416e8a3db16fc15f2e3cd13 (diff) | |
download | FreeBSD-src-74f8e63a104485f17205e2a3e446e00f968c324c.zip FreeBSD-src-74f8e63a104485f17205e2a3e446e00f968c324c.tar.gz |
Simplify system time accounting for profiling.
Rename struct thread's td_sticks to td_pticks, we will need the
other name for more appropriately named use shortly. Reduce it
from uint64_t to u_int.
Clear td_pticks whenever we enter the kernel instead of recording
its value as reference for userret(). Use the absolute value of
td->pticks in userret() and eliminate third argument.
Diffstat (limited to 'sys/alpha')
-rw-r--r-- | sys/alpha/alpha/trap.c | 11 |
1 files changed, 4 insertions, 7 deletions
diff --git a/sys/alpha/alpha/trap.c b/sys/alpha/alpha/trap.c index 7d8f8bf..a3a47cd 100644 --- a/sys/alpha/alpha/trap.c +++ b/sys/alpha/alpha/trap.c @@ -259,7 +259,6 @@ trap(a0, a1, a2, entry, framep) register struct proc *p; register int i; u_int64_t ucode; - u_int sticks; int user; #ifdef SMP register_t s; @@ -302,12 +301,11 @@ trap(a0, a1, a2, entry, framep) CTR5(KTR_TRAP, "%s trap: pid %d, (%lx, %lx, %lx)", user ? "user" : "kernel", p->p_pid, a0, a1, a2); if (user) { - sticks = td->td_sticks; + td->td_pticks = 0; td->td_frame = framep; if (td->td_ucred != p->p_ucred) cred_update_thread(td); } else { - sticks = 0; /* XXX bogus -Wuninitialized warning */ KASSERT(cold || td->td_ucred != NULL, ("kernel trap doesn't have ucred")); } @@ -595,7 +593,7 @@ trap(a0, a1, a2, entry, framep) out: if (user) { framep->tf_regs[FRAME_SP] = alpha_pal_rdusp(); - userret(td, framep, sticks); + userret(td, framep); mtx_assert(&Giant, MA_NOTOWNED); } return; @@ -632,7 +630,6 @@ syscall(code, framep) struct proc *p; int error = 0; u_int64_t opc; - u_int sticks; u_int64_t args[10]; /* XXX */ u_int hidden = 0, nargs; #ifdef SMP @@ -664,7 +661,7 @@ syscall(code, framep) PCPU_LAZY_INC(cnt.v_syscall); td->td_frame = framep; opc = framep->tf_regs[FRAME_PC] - 4; - sticks = td->td_sticks; + td->td_pticks = 0; if (td->td_ucred != p->p_ucred) cred_update_thread(td); if (p->p_flag & P_SA) @@ -773,7 +770,7 @@ syscall(code, framep) if ((callp->sy_narg & SYF_MPSAFE) == 0) mtx_unlock(&Giant); - userret(td, framep, sticks); + userret(td, framep); #ifdef KTRACE if (KTRPOINT(td, KTR_SYSRET)) |