Skip to content

Commit 39b4c87

Browse files
Add root device index to aub filename
Related-To: NEO-3691 Signed-off-by: Mateusz Jablonski <[email protected]>
1 parent 4ffe456 commit 39b4c87

File tree

5 files changed

+14
-8
lines changed

5 files changed

+14
-8
lines changed

opencl/source/command_stream/aub_command_stream_receiver.cpp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@
2424
namespace NEO {
2525
AubCommandStreamReceiverCreateFunc aubCommandStreamReceiverFactory[IGFX_MAX_CORE] = {};
2626

27-
std::string AUBCommandStreamReceiver::createFullFilePath(const HardwareInfo &hwInfo, const std::string &filename) {
27+
std::string AUBCommandStreamReceiver::createFullFilePath(const HardwareInfo &hwInfo, const std::string &filename, uint32_t rootDeviceIndex) {
2828
std::string hwPrefix = hardwarePrefix[hwInfo.platform.eProductFamily];
2929

3030
// Generate the full filename
@@ -36,7 +36,7 @@ std::string AUBCommandStreamReceiver::createFullFilePath(const HardwareInfo &hwI
3636
if (subDevicesCount > 1) {
3737
strfilename << subDevicesCount << "tx";
3838
}
39-
strfilename << gtSystemInfo.SliceCount << "x" << subSlicesPerSlice << "x" << gtSystemInfo.MaxEuPerSubSlice << "_" << filename << ".aub";
39+
strfilename << gtSystemInfo.SliceCount << "x" << subSlicesPerSlice << "x" << gtSystemInfo.MaxEuPerSubSlice << "_" << rootDeviceIndex << "_" << filename << ".aub";
4040

4141
// clean-up any fileName issues because of the file system incompatibilities
4242
auto fileName = strfilename.str();
@@ -57,7 +57,7 @@ CommandStreamReceiver *AUBCommandStreamReceiver::create(const std::string &baseN
5757
uint32_t rootDeviceIndex,
5858
const DeviceBitfield deviceBitfield) {
5959
auto hwInfo = executionEnvironment.rootDeviceEnvironments[rootDeviceIndex]->getHardwareInfo();
60-
std::string filePath = AUBCommandStreamReceiver::createFullFilePath(*hwInfo, baseName);
60+
std::string filePath = AUBCommandStreamReceiver::createFullFilePath(*hwInfo, baseName, rootDeviceIndex);
6161
if (DebugManager.flags.AUBDumpCaptureFileName.get() != "unk") {
6262
filePath.assign(DebugManager.flags.AUBDumpCaptureFileName.get());
6363
}

opencl/source/command_stream/aub_command_stream_receiver.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ struct AUBCommandStreamReceiver {
2323
ExecutionEnvironment &executionEnvironment,
2424
uint32_t rootDeviceIndex,
2525
const DeviceBitfield deviceBitfield);
26-
static std::string createFullFilePath(const HardwareInfo &hwInfo, const std::string &filename);
26+
static std::string createFullFilePath(const HardwareInfo &hwInfo, const std::string &filename, uint32_t rootDeviceIndex);
2727

2828
using AubFileStream = AubMemDump::AubFileStream;
2929
};

opencl/source/command_stream/tbx_command_stream_receiver_hw.inl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -164,7 +164,7 @@ CommandStreamReceiver *TbxCommandStreamReceiverHw<GfxFamily>::create(const std::
164164
auto &hwHelper = HwHelper::get(hwInfo.platform.eRenderCoreFamily);
165165
if (withAubDump) {
166166
auto localMemoryEnabled = hwHelper.getEnableLocalMemory(hwInfo);
167-
auto fullName = AUBCommandStreamReceiver::createFullFilePath(hwInfo, baseName);
167+
auto fullName = AUBCommandStreamReceiver::createFullFilePath(hwInfo, baseName, rootDeviceIndex);
168168
if (DebugManager.flags.AUBDumpCaptureFileName.get() != "unk") {
169169
fullName.assign(DebugManager.flags.AUBDumpCaptureFileName.get());
170170
}

opencl/test/unit_test/command_stream/aub_file_stream_tests.cpp

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -987,10 +987,16 @@ HWTEST_F(AubFileStreamTests, givenAubCommandStreamReceiverWhenCreateFullFilePath
987987
DebugManagerStateRestore stateRestore;
988988

989989
DebugManager.flags.CreateMultipleSubDevices.set(1);
990-
auto fullName = AUBCommandStreamReceiver::createFullFilePath(*defaultHwInfo, "aubfile");
990+
auto fullName = AUBCommandStreamReceiver::createFullFilePath(*defaultHwInfo, "aubfile", mockRootDeviceIndex);
991991
EXPECT_EQ(std::string::npos, fullName.find("tx"));
992992

993993
DebugManager.flags.CreateMultipleSubDevices.set(2);
994-
fullName = AUBCommandStreamReceiver::createFullFilePath(*defaultHwInfo, "aubfile");
994+
fullName = AUBCommandStreamReceiver::createFullFilePath(*defaultHwInfo, "aubfile", mockRootDeviceIndex);
995995
EXPECT_NE(std::string::npos, fullName.find("2tx"));
996996
}
997+
998+
HWTEST_F(AubFileStreamTests, givenAubCommandStreamReceiverWhenCreateFullFilePathIsCalledThenFileNameIsExtendedWithRootDeviceIndex) {
999+
uint32_t rootDeviceIndex = 123u;
1000+
auto fullName = AUBCommandStreamReceiver::createFullFilePath(*defaultHwInfo, "aubfile", rootDeviceIndex);
1001+
EXPECT_NE(std::string::npos, fullName.find("_123_aubfile.aub"));
1002+
}

opencl/test/unit_test/command_stream/tbx_command_stream_tests.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -576,7 +576,7 @@ HWTEST_F(TbxCommandStreamTests, givenTbxCsrWhenCreatedWithAubDumpThenFileNameIsE
576576
auto rootDeviceEnvironment = static_cast<MockRootDeviceEnvironment *>(executionEnvironment.rootDeviceEnvironments[0].get());
577577
setMockAubCenter(*rootDeviceEnvironment, CommandStreamReceiverType::CSR_TBX);
578578

579-
auto fullName = AUBCommandStreamReceiver::createFullFilePath(*defaultHwInfo, "aubfile");
579+
auto fullName = AUBCommandStreamReceiver::createFullFilePath(*defaultHwInfo, "aubfile", mockRootDeviceIndex);
580580

581581
std::unique_ptr<TbxCommandStreamReceiverHw<FamilyType>> tbxCsr(reinterpret_cast<TbxCommandStreamReceiverHw<FamilyType> *>(TbxCommandStreamReceiver::create("aubfile", true, executionEnvironment, 0, 1)));
582582
EXPECT_STREQ(fullName.c_str(), rootDeviceEnvironment->aubFileNameReceived.c_str());

0 commit comments

Comments
 (0)