Scheduling analysis: Also record the number of times a thread waits on a
locking primitive. git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@27312 a95241bf-73f2-0310-859d-f6bbb57e9c96
This commit is contained in:
@@ -49,6 +49,7 @@ struct scheduling_analysis_thread_wait_object {
|
||||
thread_id thread;
|
||||
scheduling_analysis_wait_object* wait_object;
|
||||
bigtime_t wait_time;
|
||||
int64 waits;
|
||||
scheduling_analysis_thread_wait_object* next_in_list;
|
||||
};
|
||||
|
||||
|
||||
@@ -897,6 +897,7 @@ struct ThreadWaitObject : HashObject, scheduling_analysis_thread_wait_object {
|
||||
this->thread = thread;
|
||||
wait_object = waitObject;
|
||||
wait_time = 0;
|
||||
waits = 0;
|
||||
next_in_list = NULL;
|
||||
}
|
||||
|
||||
@@ -1467,6 +1468,7 @@ analyze_scheduling(bigtime_t from, bigtime_t until,
|
||||
bigtime_t diffTime = entry->Time() - thread->lastTime;
|
||||
if (thread->waitObject != NULL) {
|
||||
thread->waitObject->wait_time += diffTime;
|
||||
thread->waitObject->waits++;
|
||||
thread->waitObject = NULL;
|
||||
} else if (thread->state != UNKNOWN)
|
||||
thread->unspecified_wait_time += diffTime;
|
||||
|
||||
Reference in New Issue
Block a user