Add aub comments in AUB+HW mode

Change-Id: Id9227153ef3b43f2bb8c57be4804560ea223cbf8
Signed-off-by: Dunajski, Bartosz <bartosz.dunajski@intel.com>
This commit is contained in:
Dunajski, Bartosz 2020-02-17 13:25:57 +01:00 committed by sys_ocldev
parent e107bfd55c
commit 72aad33bde
3 changed files with 39 additions and 0 deletions

View File

@ -41,6 +41,8 @@ class CommandStreamReceiverWithAUBDump : public BaseCSR {
size_t getPreferredTagPoolSize() const override { return 1; }
void addAubComment(const char *comment) override;
std::unique_ptr<CommandStreamReceiver> aubCSR;
};

View File

@ -74,4 +74,12 @@ void CommandStreamReceiverWithAUBDump<BaseCSR>::waitForTaskCountWithKmdNotifyFal
BaseCSR::waitForTaskCountWithKmdNotifyFallback(taskCountToWait, flushStampToWait, useQuickKmdSleep, forcePowerSavingMode);
}
template <typename BaseCSR>
void CommandStreamReceiverWithAUBDump<BaseCSR>::addAubComment(const char *comment) {
if (aubCSR) {
aubCSR->addAubComment(comment);
}
BaseCSR::addAubComment(comment);
}
} // namespace NEO

View File

@ -220,6 +220,35 @@ HWTEST_F(CommandStreamReceiverWithAubDumpSimpleTest, givenCsrWithAubDumpWhenCrea
EXPECT_EQ(std::numeric_limits<uint32_t>::max(), *csrWithAubDump.aubCSR->getTagAddress());
}
HWTEST_F(CommandStreamReceiverWithAubDumpSimpleTest, givenAubCsrWithHwWhenAddingCommentThenAddCommentToAubManager) {
MockAubCenter *mockAubCenter = new MockAubCenter(*platformDevices, false, "file_name.aub", CommandStreamReceiverType::CSR_HW_WITH_AUB);
auto mockAubManager = new MockAubManager();
mockAubCenter->aubManager.reset(mockAubManager);
auto executionEnvironment = platform()->peekExecutionEnvironment();
executionEnvironment->initializeMemoryManager();
executionEnvironment->rootDeviceEnvironments[0]->aubCenter = std::unique_ptr<MockAubCenter>(mockAubCenter);
EXPECT_FALSE(mockAubManager->addCommentCalled);
CommandStreamReceiverWithAUBDump<UltCommandStreamReceiver<FamilyType>> csrWithAubDump("file_name.aub", *executionEnvironment, 0);
csrWithAubDump.addAubComment("test");
EXPECT_TRUE(mockAubManager->addCommentCalled);
}
HWTEST_F(CommandStreamReceiverWithAubDumpSimpleTest, givenAubCsrWithTbxWhenAddingCommentThenDontAddCommentToAubManager) {
MockAubCenter *mockAubCenter = new MockAubCenter(*platformDevices, false, "file_name.aub", CommandStreamReceiverType::CSR_TBX_WITH_AUB);
auto mockAubManager = new MockAubManager();
mockAubCenter->aubManager.reset(mockAubManager);
auto executionEnvironment = platform()->peekExecutionEnvironment();
executionEnvironment->initializeMemoryManager();
executionEnvironment->rootDeviceEnvironments[0]->aubCenter = std::unique_ptr<MockAubCenter>(mockAubCenter);
CommandStreamReceiverWithAUBDump<TbxCommandStreamReceiverHw<FamilyType>> csrWithAubDump("file_name.aub", *executionEnvironment, 0);
csrWithAubDump.addAubComment("test");
EXPECT_FALSE(mockAubManager->addCommentCalled);
}
struct CommandStreamReceiverTagTests : public ::testing::Test {
template <typename FamilyType>
using AubWithHw = CommandStreamReceiverWithAUBDump<UltCommandStreamReceiver<FamilyType>>;