mirror of
https://github.com/intel/compute-runtime.git
synced 2026-01-04 15:53:45 +08:00
feature(debugger): Implement attach for xe debugger
Related-to: NEO-8407 Signed-off-by: Brandon Yates <brandon.yates@intel.com>
This commit is contained in:
committed by
Compute-Runtime-Automation
parent
a94c54e353
commit
0c7ba17f1a
@@ -8,6 +8,7 @@ if(NEO_ENABLE_XE_DRM_DETECTION)
|
||||
set(NEO_CORE_OS_INTERFACE_TESTS_LINUX_XE
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/CMakeLists.txt
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/ioctl_helper_xe_tests.cpp
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/ioctl_helper_xe_debugger_tests.cpp
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/ioctl_helper_xe_vm_export_tests.cpp
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/ioctl_helper_xe_tests.h
|
||||
)
|
||||
|
||||
@@ -0,0 +1,35 @@
|
||||
/*
|
||||
* Copyright (C) 2023 Intel Corporation
|
||||
*
|
||||
* SPDX-License-Identifier: MIT
|
||||
*
|
||||
*/
|
||||
|
||||
#include "shared/source/os_interface/linux/xe/ioctl_helper_xe.h"
|
||||
#include "shared/test/common/helpers/debug_manager_state_restore.h"
|
||||
#include "shared/test/common/helpers/default_hw_info.h"
|
||||
#include "shared/test/common/libult/linux/drm_mock.h"
|
||||
#include "shared/test/common/mocks/linux/mock_os_time_linux.h"
|
||||
#include "shared/test/common/mocks/mock_execution_environment.h"
|
||||
#include "shared/test/common/test_macros/test.h"
|
||||
|
||||
#include "uapi-eudebug/drm/xe_drm.h"
|
||||
#include "uapi-eudebug/drm/xe_drm_tmp.h"
|
||||
|
||||
using namespace NEO;
|
||||
|
||||
TEST(IoctlHelperXeTest, givenIoctlHelperXeWhenCallingGetIoctForDebuggerThenCorrectValueReturned) {
|
||||
auto executionEnvironment = std::make_unique<MockExecutionEnvironment>();
|
||||
DrmMock drm{*executionEnvironment->rootDeviceEnvironments[0]};
|
||||
auto xeIoctlHelper = std::make_unique<IoctlHelperXe>(drm);
|
||||
auto verifyIoctlRequestValue = [&xeIoctlHelper](auto value, DrmIoctl drmIoctl) {
|
||||
EXPECT_EQ(xeIoctlHelper->getIoctlRequestValue(drmIoctl), static_cast<unsigned int>(value));
|
||||
};
|
||||
auto verifyIoctlString = [&xeIoctlHelper](DrmIoctl drmIoctl, const char *string) {
|
||||
EXPECT_STREQ(string, xeIoctlHelper->getIoctlString(drmIoctl).c_str());
|
||||
};
|
||||
|
||||
verifyIoctlString(DrmIoctl::debuggerOpen, "DRM_IOCTL_XE_EUDEBUG_CONNECT");
|
||||
|
||||
verifyIoctlRequestValue(DRM_IOCTL_XE_EUDEBUG_CONNECT, DrmIoctl::debuggerOpen);
|
||||
}
|
||||
@@ -385,8 +385,6 @@ TEST(IoctlHelperXeTest, givenIoctlHelperXeWhenCallingAnyMethodThenDummyValueIsRe
|
||||
verifyIoctlString(DrmIoctl::primeFdToHandle, "DRM_IOCTL_PRIME_FD_TO_HANDLE");
|
||||
verifyIoctlString(DrmIoctl::primeHandleToFd, "DRM_IOCTL_PRIME_HANDLE_TO_FD");
|
||||
|
||||
verifyIoctlString(DrmIoctl::debuggerOpen, "???");
|
||||
|
||||
EXPECT_TRUE(xeIoctlHelper->completionFenceExtensionSupported(true));
|
||||
|
||||
EXPECT_EQ(static_cast<uint32_t>(XE_NEO_VMCREATE_DISABLESCRATCH_FLAG |
|
||||
@@ -426,8 +424,6 @@ TEST(IoctlHelperXeTest, whenGettingIoctlRequestValueThenPropertValueIsReturned)
|
||||
verifyIoctlRequestValue(DRM_IOCTL_XE_EXEC_QUEUE_DESTROY, DrmIoctl::gemContextDestroy);
|
||||
verifyIoctlRequestValue(DRM_IOCTL_PRIME_FD_TO_HANDLE, DrmIoctl::primeFdToHandle);
|
||||
verifyIoctlRequestValue(DRM_IOCTL_PRIME_HANDLE_TO_FD, DrmIoctl::primeHandleToFd);
|
||||
|
||||
EXPECT_THROW(xeIoctlHelper->getIoctlRequestValue(DrmIoctl::debuggerOpen), std::runtime_error);
|
||||
}
|
||||
|
||||
TEST(IoctlHelperXeTest, verifyPublicFunctions) {
|
||||
|
||||
@@ -11,7 +11,6 @@
|
||||
#include "shared/source/helpers/compiler_product_helper.h"
|
||||
#include "shared/source/helpers/register_offsets.h"
|
||||
#include "shared/source/os_interface/linux/engine_info.h"
|
||||
#include "shared/source/os_interface/linux/i915_prelim.h"
|
||||
#include "shared/source/os_interface/linux/ioctl_helper.h"
|
||||
#include "shared/source/os_interface/linux/memory_info.h"
|
||||
#include "shared/source/os_interface/linux/xe/ioctl_helper_xe.h"
|
||||
|
||||
Reference in New Issue
Block a user