Dump debug settings to a file

Related-To: NEO-3033

Change-Id: I1c4de1868ba68aada0e2e50f6b84b7f91e6dc45b
Signed-off-by: Maciej Dziuban <maciej.dziuban@intel.com>
This commit is contained in:
Maciej Dziuban
2019-04-01 11:25:47 +02:00
committed by sys_ocldev
parent 17f70f3fe2
commit c43cdd23b3
6 changed files with 71 additions and 5 deletions

View File

@@ -60,6 +60,9 @@ class TestDebugFlagsChecker {
template <DebugFunctionalityLevel DebugLevel>
class TestDebugSettingsManager : public DebugSettingsManager<DebugLevel> {
public:
using DebugSettingsManager<DebugLevel>::dumpFlags;
using DebugSettingsManager<DebugLevel>::settingsDumpFileName;
~TestDebugSettingsManager() {
remove(DebugSettingsManager<DebugLevel>::logFileName.c_str());
}

View File

@@ -5,6 +5,7 @@
*
*/
#include "runtime/utilities/debug_file_reader.h"
#include "unit_tests/fixtures/buffer_fixture.h"
#include "unit_tests/fixtures/image_fixture.h"
#include "unit_tests/helpers/debug_manager_state_restore.h"
@@ -864,6 +865,27 @@ TEST(DebugSettingsManager, givenReaderImplInDebugManagerWhenSettingDifferentRead
EXPECT_EQ(readerImpl2, debugManager.getReaderImpl());
}
TEST(DebugSettingsManager, givenPrintDebugSettingsEnabledWhenCallingDumpFlagsThenFlagsAreWrittenToDumpFile) {
FullyEnabledTestDebugManager debugManager;
debugManager.flags.PrintDebugSettings.set(true);
debugManager.flags.LoopAtPlatformInitialize.set(true);
debugManager.flags.Enable64kbpages.set(1);
debugManager.flags.TbxServer.set("192.168.0.1");
// 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) \
EXPECT_EQ(debugManager.flags.varName.get(), allSettingsReader.getSetting(#varName, defaultValue));
#include "debug_variables.inl"
#undef DECLARE_DEBUG_VARIABLE
std::remove(FullyEnabledTestDebugManager::settingsDumpFileName);
}
struct AllocationTypeTestCase {
GraphicsAllocation::AllocationType type;
const char *str;

View File

@@ -4,6 +4,7 @@ EnableNullHardware = 0
DoCpuCopyOnReadBuffer = 0
DoCpuCopyOnWriteBuffer = 0
DisableResourceRecycling = 0
PrintDebugSettings = 0
PrintDebugMessages = 0
DumpKernels = 0
DumpKernelArgs = 0