Skip to content

Commit b59e3ae

Browse files
committed
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
1 parent aaf2f94 commit b59e3ae

File tree

4 files changed

+17
-0
lines changed

4 files changed

+17
-0
lines changed

runtime/command_stream/aub_command_stream_receiver.cpp

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -51,6 +51,10 @@ CommandStreamReceiver *AUBCommandStreamReceiver::create(const HardwareInfo &hwIn
5151
filePath.append(Os::fileSeparator);
5252
filePath.append(fileName);
5353

54+
if (DebugManager.flags.AUBDumpCaptureFileName.get() != "unk") {
55+
filePath.assign(DebugManager.flags.AUBDumpCaptureFileName.get());
56+
}
57+
5458
if (hwInfo.pPlatform->eRenderCoreFamily >= IGFX_MAX_CORE) {
5559
DEBUG_BREAK_IF(!false);
5660
return nullptr;

runtime/os_interface/DebugVariables_base.inl

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,7 @@
2323
DECLARE_DEBUG_VARIABLE(std::string, TbxServer, std::string("127.0.0.1"), "TCP-IP address of TBX server")
2424
DECLARE_DEBUG_VARIABLE(std::string, ProductFamilyOverride, std::string("unk"), "Specify product for use in AUB/TBX")
2525
DECLARE_DEBUG_VARIABLE(std::string, ForceCompilerUsePlatform, std::string("unk"), "Specify product for use in compiler interface")
26+
DECLARE_DEBUG_VARIABLE(std::string, AUBDumpCaptureFileName, std::string("unk"), "Name of file to save AUB capture into")
2627
DECLARE_DEBUG_VARIABLE(std::string, AUBDumpFilterKernelName, std::string("unk"), "Name of kernel to AUB capture")
2728
DECLARE_DEBUG_VARIABLE(std::string, AUBDumpToggleFileName, std::string("unk"), "Name of file to save AUB in toggle mode")
2829
DECLARE_DEBUG_VARIABLE(int32_t, AUBDumpSubCaptureMode, 0, "AUB dump subcapture mode (off, toggle, filter)")

unit_tests/command_stream/aub_command_stream_receiver_tests.cpp

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -781,6 +781,17 @@ HWTEST_F(AubCommandStreamReceiverTests, givenAubCommandStreamReceiverWhenAllocat
781781
EXPECT_FALSE(aubCsr->writeMemory(allocationView));
782782
}
783783

784+
HWTEST_F(AubCommandStreamReceiverTests, givenAubCommandStreamReceiverWhenAUBDumpCaptureFileNameHasBeenSpecifiedThenItShouldBeUsedToOpenTheFileWithAubCapture) {
785+
DebugManagerStateRestore stateRestore;
786+
DebugManager.flags.AUBDumpCaptureFileName.set("file_name.aub");
787+
788+
std::unique_ptr<MockAubCsr<FamilyType>> aubCsr(static_cast<MockAubCsr<FamilyType> *>(AUBCommandStreamReceiver::create(*platformDevices[0], "", true, *pDevice->executionEnvironment)));
789+
EXPECT_NE(nullptr, aubCsr);
790+
791+
EXPECT_TRUE(aubCsr->isFileOpen());
792+
EXPECT_STREQ(DebugManager.flags.AUBDumpCaptureFileName.get().c_str(), aubCsr->getFileName().c_str());
793+
}
794+
784795
HWTEST_F(AubCommandStreamReceiverTests, givenAubCommandStreamReceiverInSubCaptureModeWhenAubSubCaptureIsActivatedThenFileIsOpened) {
785796
DebugManagerStateRestore stateRestore;
786797
std::unique_ptr<MockAubCsr<FamilyType>> aubCsr(new MockAubCsr<FamilyType>(*platformDevices[0], "", false, *pDevice->executionEnvironment));

unit_tests/test_files/igdrcl.config

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -69,6 +69,7 @@ OverrideAubDeviceId = -1
6969
ForceCompilerUsePlatform = unk
7070
ForceCsrFlushing = false
7171
ForceCsrReprogramming = false
72+
AUBDumpCaptureFileName = unk
7273
AUBDumpSubCaptureMode = 0
7374
AUBDumpToggleFileName = unk
7475
AUBDumpToggleCaptureOnOff = 0

0 commit comments

Comments
 (0)