mirror of
https://github.com/intel/compute-runtime.git
synced 2026-01-01 12:33:12 +08:00
refactor: make Debugger ClientConnection common for xe/i915
- Add base ClientConnection type and derived i915/xe types - Add accessor function fo retreive ClientConnection - Move getElfOffset to common linux code - Add accessor functions for getElfSize and getElfData Related-to: NEO-9669 Signed-off-by: Brandon Yates <brandon.yates@intel.com>
This commit is contained in:
committed by
Compute-Runtime-Automation
parent
a05cc69a5a
commit
0fb6f4bf3f
@@ -307,7 +307,7 @@ void DebugSessionLinuxi915::handleEvent(prelim_drm_i915_debug_event *event) {
|
||||
|
||||
if (event->flags & PRELIM_DRM_I915_DEBUG_EVENT_CREATE) {
|
||||
DEBUG_BREAK_IF(clientHandleToConnection.find(clientEvent->handle) != clientHandleToConnection.end());
|
||||
clientHandleToConnection[clientEvent->handle].reset(new ClientConnection);
|
||||
clientHandleToConnection[clientEvent->handle].reset(new ClientConnectioni915);
|
||||
clientHandleToConnection[clientEvent->handle]->client = *clientEvent;
|
||||
}
|
||||
|
||||
@@ -1445,35 +1445,6 @@ void DebugSessionLinuxi915::printContextVms() {
|
||||
}
|
||||
}
|
||||
|
||||
ze_result_t DebugSessionLinuxi915::getElfOffset(const zet_debug_memory_space_desc_t *desc, size_t size, const char *&elfData, uint64_t &offset) {
|
||||
auto &elfMap = clientHandleToConnection[clientHandle]->elfMap;
|
||||
auto accessVA = desc->address;
|
||||
ze_result_t status = ZE_RESULT_ERROR_UNINITIALIZED;
|
||||
elfData = nullptr;
|
||||
|
||||
if (elfMap.size() > 0) {
|
||||
uint64_t baseVa;
|
||||
uint64_t ceilVa;
|
||||
for (auto &elf : elfMap) {
|
||||
baseVa = elf.first;
|
||||
ceilVa = elf.first + clientHandleToConnection[clientHandle]->uuidMap[elf.second].dataSize;
|
||||
if (accessVA >= baseVa && accessVA < ceilVa) {
|
||||
if (accessVA + size > ceilVa) {
|
||||
status = ZE_RESULT_ERROR_INVALID_ARGUMENT;
|
||||
} else {
|
||||
DEBUG_BREAK_IF(clientHandleToConnection[clientHandle]->uuidMap[elf.second].data.get() == nullptr);
|
||||
elfData = clientHandleToConnection[clientHandle]->uuidMap[elf.second].data.get();
|
||||
offset = accessVA - baseVa;
|
||||
status = ZE_RESULT_SUCCESS;
|
||||
}
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return status;
|
||||
}
|
||||
|
||||
bool DebugSessionLinuxi915::ackIsaEvents(uint32_t deviceIndex, uint64_t isaVa) {
|
||||
std::lock_guard<std::mutex> lock(asyncThreadMutex);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user