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

@@ -1325,8 +1325,14 @@ void DebugSessionLinux::handleAttentionEvent(prelim_drm_i915_debug_event_eu_atte
}
if (gpuVa != 0 && stateSaveAreaSize != 0) {
stateSaveArea = std::make_unique<char[]>(stateSaveAreaSize);
stateSaveReadResult = readGpuMemory(vmHandle, stateSaveArea.get(), stateSaveAreaSize, gpuVa);
std::vector<EuThread::ThreadId> newThreads;
getNotStoppedThreads(threadsWithAttention, newThreads);
if (newThreads.size() > 0) {
stateSaveArea = std::make_unique<char[]>(stateSaveAreaSize);
stateSaveReadResult = readGpuMemory(vmHandle, stateSaveArea.get(), stateSaveAreaSize, gpuVa);
}
} else {
PRINT_DEBUGGER_ERROR_LOG("Context state save area bind info invalid\n", "");
DEBUG_BREAK_IF(true);