mirror of
https://github.com/intel/compute-runtime.git
synced 2025-09-15 13:01:45 +08:00
Add instrumentation to mocked Linux system calls
Related-To: NEO-5570 Signed-off-by: Zbigniew Zdanowicz <zbigniew.zdanowicz@intel.com>
This commit is contained in:

committed by
Compute-Runtime-Automation

parent
8e51eabb7b
commit
69afa8b4c3
@ -215,7 +215,6 @@ int drmContextDestroy(drm_i915_gem_context_destroy *destroy) {
|
|||||||
|
|
||||||
int drmVirtualMemoryCreate(drm_i915_gem_vm_control *control) {
|
int drmVirtualMemoryCreate(drm_i915_gem_vm_control *control) {
|
||||||
assert(control);
|
assert(control);
|
||||||
|
|
||||||
control->vm_id = ++vmId;
|
control->vm_id = ++vmId;
|
||||||
return failOnVirtualMemoryCreate;
|
return failOnVirtualMemoryCreate;
|
||||||
}
|
}
|
||||||
|
@ -30,6 +30,9 @@ constexpr int fakeFileDescriptor = 123;
|
|||||||
uint32_t vmId = 0;
|
uint32_t vmId = 0;
|
||||||
bool makeFakeDevicePath = false;
|
bool makeFakeDevicePath = false;
|
||||||
bool allowFakeDevicePath = false;
|
bool allowFakeDevicePath = false;
|
||||||
|
uint32_t ioctlVmCreateCalled = 0u;
|
||||||
|
int ioctlVmCreateReturned = 0u;
|
||||||
|
uint64_t ioctlVmCreateExtensionArg = 0ull;
|
||||||
|
|
||||||
int close(int fileDescriptor) {
|
int close(int fileDescriptor) {
|
||||||
closeFuncCalled++;
|
closeFuncCalled++;
|
||||||
@ -61,9 +64,11 @@ int ioctl(int fileDescriptor, unsigned long int request, void *arg) {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (request == DRM_IOCTL_I915_GEM_VM_CREATE) {
|
if (request == DRM_IOCTL_I915_GEM_VM_CREATE) {
|
||||||
|
ioctlVmCreateCalled++;
|
||||||
auto control = static_cast<drm_i915_gem_vm_control *>(arg);
|
auto control = static_cast<drm_i915_gem_vm_control *>(arg);
|
||||||
|
ioctlVmCreateExtensionArg = control->extensions;
|
||||||
control->vm_id = ++vmId;
|
control->vm_id = ++vmId;
|
||||||
return 0;
|
return ioctlVmCreateReturned;
|
||||||
}
|
}
|
||||||
if (request == DRM_IOCTL_I915_GEM_VM_DESTROY) {
|
if (request == DRM_IOCTL_I915_GEM_VM_DESTROY) {
|
||||||
auto control = static_cast<drm_i915_gem_vm_control *>(arg);
|
auto control = static_cast<drm_i915_gem_vm_control *>(arg);
|
||||||
|
Reference in New Issue
Block a user