diff options
author | tjr <tjr@FreeBSD.org> | 2003-01-31 11:22:31 +0000 |
---|---|---|
committer | tjr <tjr@FreeBSD.org> | 2003-01-31 11:22:31 +0000 |
commit | e3277471d45f0d7d42947089157a73dd47416011 (patch) | |
tree | d197771fcdc7da61c971a2980e0e4ac84bb26669 | |
parent | a428b352906a572b43c9e4c707647f76ddc30f62 (diff) | |
download | FreeBSD-src-e3277471d45f0d7d42947089157a73dd47416011.zip FreeBSD-src-e3277471d45f0d7d42947089157a73dd47416011.tar.gz |
Use a local variable to store the number of ticks that elapsed in
kernel mode instead of (unintentionally) using the global `ticks'.
This error completely broke profiling.
-rw-r--r-- | sys/kern/subr_trap.c | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/sys/kern/subr_trap.c b/sys/kern/subr_trap.c index ecd00c1..92835a0 100644 --- a/sys/kern/subr_trap.c +++ b/sys/kern/subr_trap.c @@ -76,6 +76,7 @@ userret(td, frame, oticks) #ifdef INVARIANTS struct kse *ke; #endif + u_int64_t eticks; CTR3(KTR_SYSC, "userret: thread %p (pid %d, %s)", td, p->p_pid, p->p_comm); @@ -109,8 +110,8 @@ userret(td, frame, oticks) */ if (p->p_sflag & PS_PROFIL) { - ticks = td->td_sticks - oticks; - addupc_task(td, TRAPF_PC(frame), (u_int)ticks * psratio); + eticks = td->td_sticks - oticks; + addupc_task(td, TRAPF_PC(frame), (u_int)eticks * psratio); } /* |