performance(debugger): optimize ATT event handling

- check threads with attention state before reading SR_IDENT
- memory read is costly, for threads already in stopped state
there is no need to read sr_ident and check thread state again
- single stepping one thread performance is substantially improved,
by the factor of 6x

Related-To: NEO-8183

Signed-off-by: Mateusz Hoppe <mateusz.hoppe@intel.com>
This commit is contained in:
Mateusz Hoppe
2023-07-14 18:26:55 +00:00
committed by Compute-Runtime-Automation
parent 204e5fd306
commit 9a53f20e6c
8 changed files with 203 additions and 4 deletions

View File

@@ -1393,4 +1393,21 @@ ze_result_t DebugSessionImp::waitForCmdReady(EuThread::ThreadId threadId, uint16
return ZE_RESULT_SUCCESS;
}
void DebugSessionImp::getNotStoppedThreads(const std::vector<EuThread::ThreadId> &threadsWithAtt, std::vector<EuThread::ThreadId> &notStoppedThreads) {
for (const auto &threadId : threadsWithAtt) {
bool wasStopped = false;
if (tileSessionsEnabled) {
wasStopped = tileSessions[threadId.tileIndex].first->allThreads[threadId]->isStopped();
} else {
wasStopped = allThreads[threadId]->isStopped();
}
if (!wasStopped) {
notStoppedThreads.push_back(threadId);
}
}
}
} // namespace L0