"lastTime" wasn't updated correctly when the thread was unscheduled.
"scheduler" would therefore print incorrect latencies. git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@28254 a95241bf-73f2-0310-859d-f6bbb57e9c96
This commit is contained in:
@@ -193,8 +193,6 @@ cmd_scheduler(int argc, char** argv)
|
|||||||
|
|
||||||
if (state == STILL_RUNNING) {
|
if (state == STILL_RUNNING) {
|
||||||
// thread preempted
|
// thread preempted
|
||||||
state = PREEMPTED;
|
|
||||||
|
|
||||||
runs++;
|
runs++;
|
||||||
preemptions++;
|
preemptions++;
|
||||||
totalRunTime += diffTime;
|
totalRunTime += diffTime;
|
||||||
@@ -202,6 +200,9 @@ cmd_scheduler(int argc, char** argv)
|
|||||||
minRunTime = diffTime;
|
minRunTime = diffTime;
|
||||||
if (diffTime > maxRunTime)
|
if (diffTime > maxRunTime)
|
||||||
maxRunTime = diffTime;
|
maxRunTime = diffTime;
|
||||||
|
|
||||||
|
state = PREEMPTED;
|
||||||
|
lastTime = entry->Time();
|
||||||
} else if (state == RUNNING) {
|
} else if (state == RUNNING) {
|
||||||
// thread starts waiting (it hadn't been added to the run
|
// thread starts waiting (it hadn't been added to the run
|
||||||
// queue before being unscheduled)
|
// queue before being unscheduled)
|
||||||
@@ -214,6 +215,7 @@ cmd_scheduler(int argc, char** argv)
|
|||||||
maxRunTime = diffTime;
|
maxRunTime = diffTime;
|
||||||
|
|
||||||
state = WAITING;
|
state = WAITING;
|
||||||
|
lastTime = entry->Time();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
} else if (EnqueueThread* entry
|
} else if (EnqueueThread* entry
|
||||||
|
|||||||
Reference in New Issue
Block a user