mirror of
https://github.com/intel/compute-runtime.git
synced 2025-12-29 09:03:14 +08:00
L0 Debugger - DebugSession linux implementation
- new feature, enabled with PRELIM build - implementation of debug session for linux - move ResourceClass enum from Drm to drm_debug.h Resolves: NEO-6814 Signed-off-by: Mateusz Hoppe <mateusz.hoppe@intel.com>
This commit is contained in:
committed by
Compute-Runtime-Automation
parent
4e4560fe91
commit
c021e2ec5e
@@ -306,7 +306,7 @@ class DrmMockResources : public DrmMock {
|
||||
return true;
|
||||
}
|
||||
|
||||
uint32_t registerResource(ResourceClass classType, const void *data, size_t size) override {
|
||||
uint32_t registerResource(DrmResourceClass classType, const void *data, size_t size) override {
|
||||
registeredClass = classType;
|
||||
memcpy_s(registeredData, sizeof(registeredData), data, size);
|
||||
registeredDataSize = size;
|
||||
@@ -339,7 +339,7 @@ class DrmMockResources : public DrmMock {
|
||||
|
||||
uint32_t unregisteredHandle = 0;
|
||||
uint32_t unregisterCalledCount = 0;
|
||||
ResourceClass registeredClass = ResourceClass::MaxSize;
|
||||
DrmResourceClass registeredClass = DrmResourceClass::MaxSize;
|
||||
bool registerClassesCalled = false;
|
||||
uint64_t registeredData[128];
|
||||
size_t registeredDataSize;
|
||||
|
||||
@@ -241,6 +241,12 @@ int DrmMockPrelimContext::handlePrelimRequest(unsigned long request, void *arg)
|
||||
return uuidControlReturn;
|
||||
} break;
|
||||
|
||||
case PRELIM_DRM_IOCTL_I915_DEBUGGER_OPEN: {
|
||||
auto debugger_open = reinterpret_cast<prelim_drm_i915_debugger_open_param *>(arg);
|
||||
if (debugger_open->pid != 0 && debugger_open->events == 0) {
|
||||
return debuggerOpenRetval;
|
||||
}
|
||||
} break;
|
||||
default:
|
||||
return -1;
|
||||
}
|
||||
|
||||
@@ -135,6 +135,9 @@ struct DrmMockPrelimContext {
|
||||
bool failDistanceInfoQuery{false};
|
||||
bool disableCcsSupport{false};
|
||||
|
||||
// Debugger ioctls
|
||||
int debuggerOpenRetval = 10; // debugFd
|
||||
|
||||
int handlePrelimRequest(unsigned long request, void *arg);
|
||||
bool handlePrelimQueryItem(void *arg);
|
||||
void storeVmBindExtensions(uint64_t ptr, bool bind);
|
||||
|
||||
@@ -40,6 +40,7 @@ constexpr unsigned long int invalidIoctl = static_cast<unsigned long int>(-1);
|
||||
int setErrno = 0;
|
||||
int fstatFuncRetVal = 0;
|
||||
uint32_t preadFuncCalled = 0u;
|
||||
uint32_t pwriteFuncCalled = 0u;
|
||||
uint32_t mmapFuncCalled = 0u;
|
||||
uint32_t munmapFuncCalled = 0u;
|
||||
bool isInvalidAILTest = false;
|
||||
@@ -184,6 +185,7 @@ ssize_t pread(int fd, void *buf, size_t count, off_t offset) {
|
||||
}
|
||||
|
||||
ssize_t pwrite(int fd, const void *buf, size_t count, off_t offset) {
|
||||
pwriteFuncCalled++;
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user