mirror of
https://github.com/intel/compute-runtime.git
synced 2026-01-08 22:12:59 +08:00
Revert "feature: Add debug/release variable prefixes"
This reverts commit ec95d9314a.
Signed-off-by: Artur Harasimiuk <artur.harasimiuk@intel.com>
This commit is contained in:
committed by
Compute-Runtime-Automation
parent
3c71062b4e
commit
f6e0c0cf89
@@ -5,7 +5,6 @@
|
||||
*
|
||||
*/
|
||||
|
||||
#include "shared/source/helpers/api_specific_config.h"
|
||||
#include "shared/source/memory_manager/graphics_allocation.h"
|
||||
#include "shared/source/memory_manager/memory_manager.h"
|
||||
#include "shared/source/utilities/debug_file_reader.h"
|
||||
@@ -22,12 +21,6 @@
|
||||
#include <sstream>
|
||||
#include <string>
|
||||
|
||||
namespace NEO {
|
||||
extern ApiSpecificConfig::ApiType apiTypeForUlts;
|
||||
extern std::vector<const char *> validPrefixes;
|
||||
extern std::vector<NEO::DebugVarPrefix> validPrefixTypes;
|
||||
} // namespace NEO
|
||||
|
||||
TEST(DebugSettingsManager, WhenDebugManagerIsCreatedThenInjectFcnIsNull) {
|
||||
FullyEnabledTestDebugManager debugManager;
|
||||
|
||||
@@ -121,19 +114,13 @@ TEST(DebugSettingsManager, givenReaderImplInDebugManagerWhenSettingDifferentRead
|
||||
EXPECT_EQ(readerImpl2, debugManager.getReaderImpl());
|
||||
}
|
||||
|
||||
TEST(DebugSettingsManager, givenPrintDebugSettingsEnabledWithNoPrefixWhenCallingDumpFlagsThenFlagsAreWrittenToDumpFile) {
|
||||
TEST(DebugSettingsManager, givenPrintDebugSettingsEnabledWhenCallingDumpFlagsThenFlagsAreWrittenToDumpFile) {
|
||||
testing::internal::CaptureStdout();
|
||||
FullyEnabledTestDebugManager debugManager;
|
||||
|
||||
ApiSpecificConfig::initPrefixes();
|
||||
debugManager.flags.PrintDebugSettings.set(true);
|
||||
debugManager.flags.PrintDebugSettings.setPrefixType(DebugVarPrefix::None);
|
||||
debugManager.flags.LoopAtDriverInit.set(true);
|
||||
debugManager.flags.LoopAtDriverInit.setPrefixType(DebugVarPrefix::None);
|
||||
debugManager.flags.Enable64kbpages.set(1);
|
||||
debugManager.flags.Enable64kbpages.setPrefixType(DebugVarPrefix::None);
|
||||
debugManager.flags.TbxServer.set("192.168.0.1");
|
||||
debugManager.flags.TbxServer.setPrefixType(DebugVarPrefix::None);
|
||||
|
||||
// Clear dump files and generate new
|
||||
std::remove(FullyEnabledTestDebugManager::settingsDumpFileName);
|
||||
@@ -141,15 +128,11 @@ TEST(DebugSettingsManager, givenPrintDebugSettingsEnabledWithNoPrefixWhenCalling
|
||||
|
||||
// Validate allSettingsDumpFile
|
||||
SettingsFileReader allSettingsReader{FullyEnabledTestDebugManager::settingsDumpFileName};
|
||||
#define DECLARE_DEBUG_VARIABLE(dataType, varName, defaultValue, description) \
|
||||
{ \
|
||||
DebugVarPrefix type; \
|
||||
EXPECT_EQ(debugManager.flags.varName.get(), allSettingsReader.getSetting(#varName, defaultValue, type)); \
|
||||
}
|
||||
#define DECLARE_DEBUG_VARIABLE(dataType, varName, defaultValue, description) \
|
||||
EXPECT_EQ(debugManager.flags.varName.get(), allSettingsReader.getSetting(#varName, defaultValue));
|
||||
|
||||
#include "debug_variables.inl"
|
||||
#undef DECLARE_DEBUG_VARIABLE
|
||||
|
||||
std::remove(FullyEnabledTestDebugManager::settingsDumpFileName);
|
||||
std::string output = testing::internal::GetCapturedStdout();
|
||||
ASSERT_NE(0u, output.size());
|
||||
@@ -160,177 +143,6 @@ TEST(DebugSettingsManager, givenPrintDebugSettingsEnabledWithNoPrefixWhenCalling
|
||||
EXPECT_NE(std::string::npos, output.find("Non-default value of debug variable: Enable64kbpages = 1"));
|
||||
}
|
||||
|
||||
TEST(DebugSettingsManager, givenPrintDebugSettingsEnabledWithNeoPrefixWhenCallingDumpFlagsThenFlagsAreWrittenToDumpFile) {
|
||||
testing::internal::CaptureStdout();
|
||||
FullyEnabledTestDebugManager debugManager;
|
||||
|
||||
ApiSpecificConfig::initPrefixes();
|
||||
debugManager.flags.PrintDebugSettings.set(true);
|
||||
debugManager.flags.PrintDebugSettings.setPrefixType(DebugVarPrefix::Neo);
|
||||
debugManager.flags.LoopAtDriverInit.set(true);
|
||||
debugManager.flags.LoopAtDriverInit.setPrefixType(DebugVarPrefix::Neo);
|
||||
debugManager.flags.Enable64kbpages.set(1);
|
||||
debugManager.flags.Enable64kbpages.setPrefixType(DebugVarPrefix::Neo);
|
||||
debugManager.flags.TbxServer.set("192.168.0.1");
|
||||
debugManager.flags.TbxServer.setPrefixType(DebugVarPrefix::Neo);
|
||||
|
||||
// Clear dump files and generate new
|
||||
std::remove(FullyEnabledTestDebugManager::settingsDumpFileName);
|
||||
debugManager.dumpFlags();
|
||||
|
||||
// Validate allSettingsDumpFile
|
||||
SettingsFileReader allSettingsReader{FullyEnabledTestDebugManager::settingsDumpFileName};
|
||||
#define DECLARE_DEBUG_VARIABLE(dataType, varName, defaultValue, description) \
|
||||
{ \
|
||||
DebugVarPrefix type; \
|
||||
EXPECT_EQ(debugManager.flags.varName.get(), allSettingsReader.getSetting(#varName, defaultValue, type)); \
|
||||
}
|
||||
|
||||
#include "debug_variables.inl"
|
||||
#undef DECLARE_DEBUG_VARIABLE
|
||||
|
||||
std::remove(FullyEnabledTestDebugManager::settingsDumpFileName);
|
||||
std::string output = testing::internal::GetCapturedStdout();
|
||||
ASSERT_NE(0u, output.size());
|
||||
|
||||
EXPECT_NE(std::string::npos, output.find("Non-default value of debug variable: NEO_TbxServer = 192.168.0.1"));
|
||||
EXPECT_NE(std::string::npos, output.find("Non-default value of debug variable: NEO_LoopAtDriverInit = 1"));
|
||||
EXPECT_NE(std::string::npos, output.find("Non-default value of debug variable: NEO_PrintDebugSettings = 1"));
|
||||
EXPECT_NE(std::string::npos, output.find("Non-default value of debug variable: NEO_Enable64kbpages = 1"));
|
||||
}
|
||||
|
||||
TEST(DebugSettingsManager, givenPrintDebugSettingsEnabledWithLevelZeroPrefixWhenCallingDumpFlagsThenFlagsAreWrittenToDumpFile) {
|
||||
testing::internal::CaptureStdout();
|
||||
FullyEnabledTestDebugManager debugManager;
|
||||
|
||||
VariableBackup<ApiSpecificConfig::ApiType> backup(&apiTypeForUlts, ApiSpecificConfig::L0);
|
||||
VariableBackup<std::vector<const char *>> validPrefixesBackup(&validPrefixes);
|
||||
VariableBackup<std::vector<NEO::DebugVarPrefix>> validPrefixTypesBackup(&validPrefixTypes);
|
||||
validPrefixes.clear();
|
||||
validPrefixTypes.clear();
|
||||
ApiSpecificConfig::initPrefixes();
|
||||
debugManager.flags.PrintDebugSettings.set(true);
|
||||
debugManager.flags.PrintDebugSettings.setPrefixType(DebugVarPrefix::Neo_L0);
|
||||
debugManager.flags.LoopAtDriverInit.set(true);
|
||||
debugManager.flags.LoopAtDriverInit.setPrefixType(DebugVarPrefix::Neo_L0);
|
||||
debugManager.flags.Enable64kbpages.set(1);
|
||||
debugManager.flags.Enable64kbpages.setPrefixType(DebugVarPrefix::Neo_L0);
|
||||
debugManager.flags.TbxServer.set("192.168.0.1");
|
||||
debugManager.flags.TbxServer.setPrefixType(DebugVarPrefix::Neo_L0);
|
||||
|
||||
// Clear dump files and generate new
|
||||
std::remove(FullyEnabledTestDebugManager::settingsDumpFileName);
|
||||
debugManager.dumpFlags();
|
||||
|
||||
// Validate allSettingsDumpFile
|
||||
SettingsFileReader allSettingsReader{FullyEnabledTestDebugManager::settingsDumpFileName};
|
||||
#define DECLARE_DEBUG_VARIABLE(dataType, varName, defaultValue, description) \
|
||||
{ \
|
||||
DebugVarPrefix type; \
|
||||
EXPECT_EQ(debugManager.flags.varName.get(), allSettingsReader.getSetting(#varName, defaultValue, type)); \
|
||||
}
|
||||
|
||||
#include "debug_variables.inl"
|
||||
#undef DECLARE_DEBUG_VARIABLE
|
||||
|
||||
std::remove(FullyEnabledTestDebugManager::settingsDumpFileName);
|
||||
std::string output = testing::internal::GetCapturedStdout();
|
||||
ASSERT_NE(0u, output.size());
|
||||
|
||||
EXPECT_NE(std::string::npos, output.find("Non-default value of debug variable: NEO_L0_TbxServer = 192.168.0.1"));
|
||||
EXPECT_NE(std::string::npos, output.find("Non-default value of debug variable: NEO_L0_LoopAtDriverInit = 1"));
|
||||
EXPECT_NE(std::string::npos, output.find("Non-default value of debug variable: NEO_L0_PrintDebugSettings = 1"));
|
||||
EXPECT_NE(std::string::npos, output.find("Non-default value of debug variable: NEO_L0_Enable64kbpages = 1"));
|
||||
}
|
||||
|
||||
TEST(DebugSettingsManager, givenPrintDebugSettingsEnabledWithOclPrefixWhenCallingDumpFlagsThenFlagsAreWrittenToDumpFile) {
|
||||
testing::internal::CaptureStdout();
|
||||
FullyEnabledTestDebugManager debugManager;
|
||||
|
||||
VariableBackup<ApiSpecificConfig::ApiType> backup(&apiTypeForUlts, ApiSpecificConfig::OCL);
|
||||
VariableBackup<std::vector<const char *>> validPrefixesBackup(&validPrefixes);
|
||||
VariableBackup<std::vector<NEO::DebugVarPrefix>> validPrefixTypesBackup(&validPrefixTypes);
|
||||
validPrefixes.clear();
|
||||
validPrefixTypes.clear();
|
||||
ApiSpecificConfig::initPrefixes();
|
||||
debugManager.flags.PrintDebugSettings.set(true);
|
||||
debugManager.flags.PrintDebugSettings.setPrefixType(DebugVarPrefix::Neo_Ocl);
|
||||
debugManager.flags.LoopAtDriverInit.set(true);
|
||||
debugManager.flags.LoopAtDriverInit.setPrefixType(DebugVarPrefix::Neo_Ocl);
|
||||
debugManager.flags.Enable64kbpages.set(1);
|
||||
debugManager.flags.Enable64kbpages.setPrefixType(DebugVarPrefix::Neo_Ocl);
|
||||
debugManager.flags.TbxServer.set("192.168.0.1");
|
||||
debugManager.flags.TbxServer.setPrefixType(DebugVarPrefix::Neo_Ocl);
|
||||
|
||||
// Clear dump files and generate new
|
||||
std::remove(FullyEnabledTestDebugManager::settingsDumpFileName);
|
||||
debugManager.dumpFlags();
|
||||
|
||||
// Validate allSettingsDumpFile
|
||||
SettingsFileReader allSettingsReader{FullyEnabledTestDebugManager::settingsDumpFileName};
|
||||
#define DECLARE_DEBUG_VARIABLE(dataType, varName, defaultValue, description) \
|
||||
{ \
|
||||
DebugVarPrefix type; \
|
||||
EXPECT_EQ(debugManager.flags.varName.get(), allSettingsReader.getSetting(#varName, defaultValue, type)); \
|
||||
}
|
||||
|
||||
#include "debug_variables.inl"
|
||||
#undef DECLARE_DEBUG_VARIABLE
|
||||
|
||||
std::remove(FullyEnabledTestDebugManager::settingsDumpFileName);
|
||||
std::string output = testing::internal::GetCapturedStdout();
|
||||
ASSERT_NE(0u, output.size());
|
||||
|
||||
EXPECT_NE(std::string::npos, output.find("Non-default value of debug variable: NEO_OCL_TbxServer = 192.168.0.1"));
|
||||
EXPECT_NE(std::string::npos, output.find("Non-default value of debug variable: NEO_OCL_LoopAtDriverInit = 1"));
|
||||
EXPECT_NE(std::string::npos, output.find("Non-default value of debug variable: NEO_OCL_PrintDebugSettings = 1"));
|
||||
EXPECT_NE(std::string::npos, output.find("Non-default value of debug variable: NEO_OCL_Enable64kbpages = 1"));
|
||||
}
|
||||
|
||||
TEST(DebugSettingsManager, givenPrintDebugSettingsEnabledWithMixedPrefixWhenCallingDumpFlagsThenFlagsAreWrittenToDumpFile) {
|
||||
testing::internal::CaptureStdout();
|
||||
FullyEnabledTestDebugManager debugManager;
|
||||
|
||||
VariableBackup<ApiSpecificConfig::ApiType> backup(&apiTypeForUlts, ApiSpecificConfig::L0);
|
||||
VariableBackup<std::vector<const char *>> validPrefixesBackup(&validPrefixes);
|
||||
VariableBackup<std::vector<NEO::DebugVarPrefix>> validPrefixTypesBackup(&validPrefixTypes);
|
||||
validPrefixes.clear();
|
||||
validPrefixTypes.clear();
|
||||
ApiSpecificConfig::initPrefixes();
|
||||
debugManager.flags.PrintDebugSettings.set(true);
|
||||
debugManager.flags.PrintDebugSettings.setPrefixType(DebugVarPrefix::Neo_L0);
|
||||
debugManager.flags.LoopAtDriverInit.set(true);
|
||||
debugManager.flags.LoopAtDriverInit.setPrefixType(DebugVarPrefix::Neo);
|
||||
debugManager.flags.Enable64kbpages.set(1);
|
||||
debugManager.flags.Enable64kbpages.setPrefixType(DebugVarPrefix::None);
|
||||
debugManager.flags.TbxServer.set("192.168.0.1");
|
||||
debugManager.flags.TbxServer.setPrefixType(DebugVarPrefix::Neo_L0);
|
||||
|
||||
// Clear dump files and generate new
|
||||
std::remove(FullyEnabledTestDebugManager::settingsDumpFileName);
|
||||
debugManager.dumpFlags();
|
||||
|
||||
// Validate allSettingsDumpFile
|
||||
SettingsFileReader allSettingsReader{FullyEnabledTestDebugManager::settingsDumpFileName};
|
||||
#define DECLARE_DEBUG_VARIABLE(dataType, varName, defaultValue, description) \
|
||||
{ \
|
||||
DebugVarPrefix type; \
|
||||
EXPECT_EQ(debugManager.flags.varName.get(), allSettingsReader.getSetting(#varName, defaultValue, type)); \
|
||||
}
|
||||
|
||||
#include "debug_variables.inl"
|
||||
#undef DECLARE_DEBUG_VARIABLE
|
||||
|
||||
std::remove(FullyEnabledTestDebugManager::settingsDumpFileName);
|
||||
std::string output = testing::internal::GetCapturedStdout();
|
||||
ASSERT_NE(0u, output.size());
|
||||
|
||||
EXPECT_NE(std::string::npos, output.find("Non-default value of debug variable: NEO_L0_TbxServer = 192.168.0.1"));
|
||||
EXPECT_NE(std::string::npos, output.find("Non-default value of debug variable: NEO_LoopAtDriverInit = 1"));
|
||||
EXPECT_NE(std::string::npos, output.find("Non-default value of debug variable: NEO_L0_PrintDebugSettings = 1"));
|
||||
EXPECT_NE(std::string::npos, output.find("Non-default value of debug variable: Enable64kbpages = 1"));
|
||||
}
|
||||
|
||||
TEST(DebugSettingsManager, givenPrintDebugSettingsEnabledOnDisabledDebugManagerWhenCallingDumpFlagsThenFlagsAreNotWrittenToDumpFile) {
|
||||
testing::internal::CaptureStdout();
|
||||
FullyDisabledTestDebugManager debugManager;
|
||||
|
||||
Reference in New Issue
Block a user