From: David van Moolenbroek Date: Mon, 2 Nov 2015 17:46:16 +0000 (+0000) Subject: Kernel: per-process sleep time X-Git-Url: http://zhaoyanbai.com/repos/%22http:/www.isc.org/icons/zpipe.c?a=commitdiff_plain;h=6b0f33d0fc0227339bf6308f08fe358bbd70074d;p=minix.git Kernel: per-process sleep time Change-Id: I6e08e7db155ed6d51002f0993dbef29ca6d926d1 --- diff --git a/minix/kernel/proc.c b/minix/kernel/proc.c index 7076023cd..5ca6474ad 100644 --- a/minix/kernel/proc.c +++ b/minix/kernel/proc.c @@ -1774,6 +1774,8 @@ void dequeue(struct proc *rp) rp->p_accounting.enter_queue = 0; } + /* For ps(1), remember when the process was last dequeued. */ + rp->p_dequeued = get_monotonic(); #if DEBUG_SANITYCHECKS assert(runqueues_ok_local()); diff --git a/minix/kernel/proc.h b/minix/kernel/proc.h index 76850cb38..200c3bdfa 100644 --- a/minix/kernel/proc.h +++ b/minix/kernel/proc.h @@ -54,6 +54,8 @@ struct proc { unsigned long preempted; } p_accounting; + clock_t p_dequeued; /* uptime at which process was last dequeued */ + clock_t p_user_time; /* user time in ticks */ clock_t p_sys_time; /* sys time in ticks */