Skip to content

Commit 5b1bd4b

Browse files
refactor: dont mix aub and hw wait prints
Signed-off-by: Bartosz Dunajski <[email protected]>
1 parent 9a32628 commit 5b1bd4b

File tree

2 files changed

+35
-0
lines changed

2 files changed

+35
-0
lines changed

shared/source/command_stream/command_stream_receiver.cpp

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1090,6 +1090,14 @@ bool CommandStreamReceiver::createPerDssBackedBuffer(Device &device) {
10901090
}
10911091

10921092
void CommandStreamReceiver::printTagAddressContent(TaskCountType taskCountToWait, int64_t waitTimeout, bool start) {
1093+
if (getType() == NEO::CommandStreamReceiverType::aub) {
1094+
if (start) {
1095+
PRINT_DEBUG_STRING(true, stdout, "\nAub dump wait for task count %llu", taskCountToWait);
1096+
} else {
1097+
PRINT_DEBUG_STRING(true, stdout, "\nAub dump wait completed.");
1098+
}
1099+
return;
1100+
}
10931101
auto postSyncAddress = getTagAddress();
10941102
if (start) {
10951103
PRINT_DEBUG_STRING(true, stdout,
@@ -1099,6 +1107,7 @@ void CommandStreamReceiver::printTagAddressContent(TaskCountType taskCountToWait
10991107
PRINT_DEBUG_STRING(true, stdout,
11001108
"%s", "\nWaiting completed. Current value:");
11011109
}
1110+
11021111
for (uint32_t i = 0; i < activePartitions; i++) {
11031112
PRINT_DEBUG_STRING(true, stdout, " %u", *postSyncAddress);
11041113
postSyncAddress = ptrOffset(postSyncAddress, this->immWritePostSyncWriteOffset);

shared/test/unit_test/command_stream/command_stream_receiver_tests.cpp

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2519,6 +2519,32 @@ HWTEST_F(CommandStreamReceiverTest, givenMultipleActivePartitionsWhenWaitLogIsEn
25192519
EXPECT_STREQ(expectedOutput.str().c_str(), output.c_str());
25202520
}
25212521

2522+
HWTEST_F(CommandStreamReceiverTest, givenAubCsrWhenLogWaitingForCompletionEnabledThenSkipFullPrint) {
2523+
DebugManagerStateRestore restorer;
2524+
debugManager.flags.LogWaitingForCompletion.set(true);
2525+
2526+
auto &csr = pDevice->getUltCommandStreamReceiver<FamilyType>();
2527+
csr.commandStreamReceiverType = NEO::CommandStreamReceiverType::aub;
2528+
2529+
WaitParams waitParams;
2530+
waitParams.waitTimeout = std::numeric_limits<int64_t>::max();
2531+
2532+
testing::internal::CaptureStdout();
2533+
2534+
WaitStatus status = csr.waitForCompletionWithTimeout(waitParams, 0);
2535+
EXPECT_EQ(WaitStatus::ready, status);
2536+
2537+
std::string output = testing::internal::GetCapturedStdout();
2538+
2539+
std::string expectedOutput1 = "Aub dump wait for task count";
2540+
std::string expectedOutput2 = "Aub dump wait completed";
2541+
std::string notExpectedOutput = "Waiting for task count";
2542+
2543+
EXPECT_NE(std::string::npos, output.find(expectedOutput1));
2544+
EXPECT_NE(std::string::npos, output.find(expectedOutput2));
2545+
EXPECT_EQ(std::string::npos, output.find(notExpectedOutput));
2546+
}
2547+
25222548
TEST_F(CommandStreamReceiverTest, givenPreambleFlagIsSetWhenGettingFlagStateThenExpectCorrectState) {
25232549
EXPECT_FALSE(commandStreamReceiver->getPreambleSetFlag());
25242550
commandStreamReceiver->setPreambleSetFlag(true);

0 commit comments

Comments
 (0)