From a4f7dda98f6757479b86877f1b8ec00325f203d0 Mon Sep 17 00:00:00 2001 From: Kamil Kopryk Date: Fri, 2 Feb 2024 10:00:45 +0000 Subject: [PATCH] refactor: Add xe print debug key Signed-off-by: Kamil Kopryk --- shared/source/debug_settings/debug_variables_base.inl | 1 + shared/source/os_interface/linux/xe/ioctl_helper_xe.cpp | 2 +- shared/source/os_interface/linux/xe/ioctl_helper_xe.h | 2 +- shared/test/common/test_files/igdrcl.config | 1 + .../os_interface/linux/xe/ioctl_helper_xe_tests.cpp | 5 +++-- 5 files changed, 7 insertions(+), 4 deletions(-) diff --git a/shared/source/debug_settings/debug_variables_base.inl b/shared/source/debug_settings/debug_variables_base.inl index 25de07b894..d6c7fc9021 100644 --- a/shared/source/debug_settings/debug_variables_base.inl +++ b/shared/source/debug_settings/debug_variables_base.inl @@ -281,6 +281,7 @@ DECLARE_DEBUG_VARIABLE(bool, PrintExecutionBuffer, false, "print execution buffe DECLARE_DEBUG_VARIABLE(bool, PrintBOsForSubmit, false, "print all BOs passed to submission") DECLARE_DEBUG_VARIABLE(bool, PrintDebugSettings, false, "Dump all debug variables settings to text file. Print to stdout if value is different than default.") DECLARE_DEBUG_VARIABLE(bool, PrintDebugMessages, false, "when enabled, some debug messages will be propagated to console") +DECLARE_DEBUG_VARIABLE(bool, PrintXeLogs, false, "when enabled, xe logs will be propagated to console") DECLARE_DEBUG_VARIABLE(bool, DumpZEBin, false, "Enables dumping zebin (elf) to a binary file (.elf extension)") DECLARE_DEBUG_VARIABLE(bool, DumpKernels, false, "Enables dumping kernels' program source code to text files and program from binary to bin file") DECLARE_DEBUG_VARIABLE(bool, DumpKernelArgs, false, "Enables dumping kernels args to binary files") diff --git a/shared/source/os_interface/linux/xe/ioctl_helper_xe.cpp b/shared/source/os_interface/linux/xe/ioctl_helper_xe.cpp index ccd9cf110e..b2892829e8 100644 --- a/shared/source/os_interface/linux/xe/ioctl_helper_xe.cpp +++ b/shared/source/os_interface/linux/xe/ioctl_helper_xe.cpp @@ -1161,7 +1161,7 @@ int IoctlHelperXe::ioctl(DrmIoctl request, void *arg) { } void IoctlHelperXe::xeShowBindTable() { - if (debugManager.flags.PrintDebugMessages.get()) { + if (debugManager.flags.PrintXeLogs.get()) { std::unique_lock lock(xeLock); xeLog("show bind: ( )\n", ""); for (unsigned int i = 0; i < bindInfo.size(); i++) { diff --git a/shared/source/os_interface/linux/xe/ioctl_helper_xe.h b/shared/source/os_interface/linux/xe/ioctl_helper_xe.h index 9a4a1d09a7..b112f35719 100644 --- a/shared/source/os_interface/linux/xe/ioctl_helper_xe.h +++ b/shared/source/os_interface/linux/xe/ioctl_helper_xe.h @@ -209,7 +209,7 @@ class IoctlHelperXe : public IoctlHelper { template void IoctlHelperXe::xeLog(XeLogArgs &&...args) const { - PRINT_DEBUG_STRING(debugManager.flags.PrintDebugMessages.get(), stderr, args...); + PRINT_DEBUG_STRING(debugManager.flags.PrintXeLogs.get(), stderr, args...); } } // namespace NEO diff --git a/shared/test/common/test_files/igdrcl.config b/shared/test/common/test_files/igdrcl.config index c06dd57791..4972e43f99 100644 --- a/shared/test/common/test_files/igdrcl.config +++ b/shared/test/common/test_files/igdrcl.config @@ -225,6 +225,7 @@ DispatchCmdlistCmdBufferPrimary = -1 MultiStoragePolicy = -1; PrintExecutionBuffer = 0 PrintBOsForSubmit = 0 +PrintXeLogs = 0 PauseOnBlitCopy = -1 ForceImplicitFlush = 0 ForcePipeControlPriorToWalker = 0 diff --git a/shared/test/unit_test/os_interface/linux/xe/ioctl_helper_xe_tests.cpp b/shared/test/unit_test/os_interface/linux/xe/ioctl_helper_xe_tests.cpp index eaa6cee177..86dcc6795f 100644 --- a/shared/test/unit_test/os_interface/linux/xe/ioctl_helper_xe_tests.cpp +++ b/shared/test/unit_test/os_interface/linux/xe/ioctl_helper_xe_tests.cpp @@ -1545,9 +1545,10 @@ TEST(IoctlHelperXeTest, whenXeShowBindTableIsCalledThenBindLogsArePrinted) { ::testing::internal::CaptureStderr(); - debugManager.flags.PrintDebugMessages.set(true); + debugManager.flags.PrintXeLogs.set(true); xeIoctlHelper->xeShowBindTable(); - debugManager.flags.PrintDebugMessages.set(false); + debugManager.flags.PrintXeLogs.set(false); + std::string output = testing::internal::GetCapturedStderr(); std::string expectedOutput = R"(show bind: ( ) 0 x00000001 x0000000000000002 x0000000000000003 x0000000000000004