AUB capture - add control to configure file name

This commit adds the AUBDumpCaptureFileName control to configure from outside
a file name with an optional path where to save the AUB capture into.

Change-Id: Ibf2f7663e23ad9e1001896b0c5b7030f9979dae2
This commit is contained in:
Milczarek, Slawomir
2018-08-23 17:15:33 +02:00
parent aaf2f94887
commit b59e3aec14
4 changed files with 17 additions and 0 deletions

View File

@@ -51,6 +51,10 @@ CommandStreamReceiver *AUBCommandStreamReceiver::create(const HardwareInfo &hwIn
filePath.append(Os::fileSeparator);
filePath.append(fileName);
if (DebugManager.flags.AUBDumpCaptureFileName.get() != "unk") {
filePath.assign(DebugManager.flags.AUBDumpCaptureFileName.get());
}
if (hwInfo.pPlatform->eRenderCoreFamily >= IGFX_MAX_CORE) {
DEBUG_BREAK_IF(!false);
return nullptr;

View File

@@ -23,6 +23,7 @@
DECLARE_DEBUG_VARIABLE(std::string, TbxServer, std::string("127.0.0.1"), "TCP-IP address of TBX server")
DECLARE_DEBUG_VARIABLE(std::string, ProductFamilyOverride, std::string("unk"), "Specify product for use in AUB/TBX")
DECLARE_DEBUG_VARIABLE(std::string, ForceCompilerUsePlatform, std::string("unk"), "Specify product for use in compiler interface")
DECLARE_DEBUG_VARIABLE(std::string, AUBDumpCaptureFileName, std::string("unk"), "Name of file to save AUB capture into")
DECLARE_DEBUG_VARIABLE(std::string, AUBDumpFilterKernelName, std::string("unk"), "Name of kernel to AUB capture")
DECLARE_DEBUG_VARIABLE(std::string, AUBDumpToggleFileName, std::string("unk"), "Name of file to save AUB in toggle mode")
DECLARE_DEBUG_VARIABLE(int32_t, AUBDumpSubCaptureMode, 0, "AUB dump subcapture mode (off, toggle, filter)")

View File

@@ -781,6 +781,17 @@ HWTEST_F(AubCommandStreamReceiverTests, givenAubCommandStreamReceiverWhenAllocat
EXPECT_FALSE(aubCsr->writeMemory(allocationView));
}
HWTEST_F(AubCommandStreamReceiverTests, givenAubCommandStreamReceiverWhenAUBDumpCaptureFileNameHasBeenSpecifiedThenItShouldBeUsedToOpenTheFileWithAubCapture) {
DebugManagerStateRestore stateRestore;
DebugManager.flags.AUBDumpCaptureFileName.set("file_name.aub");
std::unique_ptr<MockAubCsr<FamilyType>> aubCsr(static_cast<MockAubCsr<FamilyType> *>(AUBCommandStreamReceiver::create(*platformDevices[0], "", true, *pDevice->executionEnvironment)));
EXPECT_NE(nullptr, aubCsr);
EXPECT_TRUE(aubCsr->isFileOpen());
EXPECT_STREQ(DebugManager.flags.AUBDumpCaptureFileName.get().c_str(), aubCsr->getFileName().c_str());
}
HWTEST_F(AubCommandStreamReceiverTests, givenAubCommandStreamReceiverInSubCaptureModeWhenAubSubCaptureIsActivatedThenFileIsOpened) {
DebugManagerStateRestore stateRestore;
std::unique_ptr<MockAubCsr<FamilyType>> aubCsr(new MockAubCsr<FamilyType>(*platformDevices[0], "", false, *pDevice->executionEnvironment));

View File

@@ -69,6 +69,7 @@ OverrideAubDeviceId = -1
ForceCompilerUsePlatform = unk
ForceCsrFlushing = false
ForceCsrReprogramming = false
AUBDumpCaptureFileName = unk
AUBDumpSubCaptureMode = 0
AUBDumpToggleFileName = unk
AUBDumpToggleCaptureOnOff = 0