]> Zhao Yanbai Git Server - minix.git/commitdiff
Tick calculation tweak
authorBen Gras <ben@minix3.org>
Thu, 16 Mar 2006 01:44:06 +0000 (01:44 +0000)
committerBen Gras <ben@minix3.org>
Thu, 16 Mar 2006 01:44:06 +0000 (01:44 +0000)
commands/simple/top.c

index ca4443374c6fc985df2d5dbc326aefbdf1af7282..c1bfe3ea3dfcd1c8ae0f55af0945b41226687191 100644 (file)
@@ -114,8 +114,13 @@ void print_procs(int maxlines,
                if(proc2[p].p_rts_flags & SLOT_FREE)
                        continue;
                tick_procs[nprocs].p = proc2 + p;
-               tick_procs[nprocs].ticks =
-                       proc2[p].p_user_time-proc1[p].p_user_time;
+               if(proc1[p].p_endpoint == proc2[p].p_endpoint) {
+                       tick_procs[nprocs].ticks =
+                               proc2[p].p_user_time-proc1[p].p_user_time;
+               } else {
+                       tick_procs[nprocs].ticks =
+                               proc2[p].p_user_time;
+               }
                if(p-NR_TASKS == IDLE) {
                        idleticks = tick_procs[nprocs].ticks;
                        continue;