]> Zhao Yanbai Git Server - minix.git/commitdiff
Kernel: per-process sleep time 41/3241/2
authorDavid van Moolenbroek <david@minix3.org>
Mon, 2 Nov 2015 17:46:16 +0000 (17:46 +0000)
committerLionel Sambuc <lionel.sambuc@gmail.com>
Wed, 13 Jan 2016 19:32:40 +0000 (20:32 +0100)
Change-Id: I6e08e7db155ed6d51002f0993dbef29ca6d926d1

minix/kernel/proc.c
minix/kernel/proc.h

index 7076023cd656dc1dd35210b4b7ebee8670cd4d3f..5ca6474ad25c36a31e47c3e1e3e5442498c80388 100644 (file)
@@ -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());
index 76850cb386047d157d185d5091ca6627aebbbaf2..200c3bdfa9b03a129eda29aeadf659f74c3ec74b 100644 (file)
@@ -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 */