aboutsummaryrefslogtreecommitdiff
path: root/sys/amd64
diff options
context:
space:
mode:
authorPoul-Henning Kamp <phk@FreeBSD.org>2006-02-08 08:09:17 +0000
committerPoul-Henning Kamp <phk@FreeBSD.org>2006-02-08 08:09:17 +0000
commiteb2da9a51f817e3511ca53ff5ada25bb5e2df790 (patch)
treedcc7f358367ea74ccf47cede57e272875e9b589d /sys/amd64
parentf2b1bd14dc74a9b061aaec65ce71d9f27a77f31c (diff)
downloadsrc-eb2da9a51f817e3511ca53ff5ada25bb5e2df790.tar.gz
src-eb2da9a51f817e3511ca53ff5ada25bb5e2df790.zip
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.
Notes
Notes: svn path=/head/; revision=155455
Diffstat (limited to 'sys/amd64')
-rw-r--r--sys/amd64/amd64/trap.c10
-rw-r--r--sys/amd64/ia32/ia32_syscall.c5
2 files changed, 6 insertions, 9 deletions
diff --git a/sys/amd64/amd64/trap.c b/sys/amd64/amd64/trap.c
index d0d111bc1986..7beea8828332 100644
--- a/sys/amd64/amd64/trap.c
+++ b/sys/amd64/amd64/trap.c
@@ -162,7 +162,6 @@ trap(frame)
{
struct thread *td = curthread;
struct proc *p = td->td_proc;
- u_int sticks = 0;
int i = 0, ucode = 0, type, code;
register_t addr = 0;
ksiginfo_t ksi;
@@ -254,7 +253,7 @@ trap(frame)
if (ISPL(frame.tf_cs) == SEL_UPL) {
/* user trap */
- sticks = td->td_sticks;
+ td->td_pticks = 0;
td->td_frame = &frame;
addr = frame.tf_rip;
if (td->td_ucred != p->p_ucred)
@@ -524,7 +523,7 @@ trap(frame)
#endif
user:
- userret(td, &frame, sticks);
+ userret(td, &frame);
mtx_assert(&Giant, MA_NOTOWNED);
userout:
out:
@@ -731,7 +730,6 @@ syscall(frame)
struct thread *td = curthread;
struct proc *p = td->td_proc;
register_t orig_tf_rflags;
- u_int sticks;
int error;
int narg;
register_t args[8];
@@ -757,7 +755,7 @@ syscall(frame)
reg = 0;
regcnt = 6;
- sticks = td->td_sticks;
+ td->td_pticks = 0;
td->td_frame = &frame;
if (td->td_ucred != p->p_ucred)
cred_update_thread(td);
@@ -885,7 +883,7 @@ syscall(frame)
/*
* Handle reschedule and other end-of-syscall issues
*/
- userret(td, &frame, sticks);
+ userret(td, &frame);
CTR4(KTR_SYSC, "syscall exit thread %p pid %d proc %s code %d", td,
td->td_proc->p_pid, td->td_proc->p_comm, code);
diff --git a/sys/amd64/ia32/ia32_syscall.c b/sys/amd64/ia32/ia32_syscall.c
index d8c16eb0ee3a..8e67939c771d 100644
--- a/sys/amd64/ia32/ia32_syscall.c
+++ b/sys/amd64/ia32/ia32_syscall.c
@@ -96,7 +96,6 @@ ia32_syscall(struct trapframe frame)
struct thread *td = curthread;
struct proc *p = td->td_proc;
register_t orig_tf_rflags;
- u_int sticks;
int error;
int narg;
u_int32_t args[8];
@@ -110,7 +109,7 @@ ia32_syscall(struct trapframe frame)
*/
PCPU_LAZY_INC(cnt.v_syscall);
- sticks = td->td_sticks;
+ td->td_pticks = 0;
td->td_frame = &frame;
if (td->td_ucred != p->p_ucred)
cred_update_thread(td);
@@ -241,7 +240,7 @@ ia32_syscall(struct trapframe frame)
/*
* Handle reschedule and other end-of-syscall issues
*/
- userret(td, &frame, sticks);
+ userret(td, &frame);
#ifdef KTRACE
if (KTRPOINT(td, KTR_SYSRET))