Kernel: per-process sleep time

Change-Id: I6e08e7db155ed6d51002f0993dbef29ca6d926d1
This commit is contained in:
David van Moolenbroek 2015-11-02 17:46:16 +00:00 committed by Lionel Sambuc
parent 1f3ef2b206
commit 6b0f33d0fc
2 changed files with 4 additions and 0 deletions

View File

@ -1774,6 +1774,8 @@ void dequeue(struct proc *rp)
rp->p_accounting.enter_queue = 0; rp->p_accounting.enter_queue = 0;
} }
/* For ps(1), remember when the process was last dequeued. */
rp->p_dequeued = get_monotonic();
#if DEBUG_SANITYCHECKS #if DEBUG_SANITYCHECKS
assert(runqueues_ok_local()); assert(runqueues_ok_local());

View File

@ -54,6 +54,8 @@ struct proc {
unsigned long preempted; unsigned long preempted;
} p_accounting; } 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_user_time; /* user time in ticks */
clock_t p_sys_time; /* sys time in ticks */ clock_t p_sys_time; /* sys time in ticks */