Improve dumping timestamp packet contents.

Remove not useful profiling capable flag.
Add command type to identify source.
Add delta's to see if there are any fluctuations.

Signed-off-by: Michal Mrozek <michal.mrozek@intel.com>
This commit is contained in:
Michal Mrozek 2022-01-28 11:59:34 +00:00 committed by Compute-Runtime-Automation
parent 28345061f0
commit f83cc1c140
2 changed files with 11 additions and 6 deletions

View File

@ -1,5 +1,5 @@
/*
* Copyright (C) 2018-2021 Intel Corporation
* Copyright (C) 2018-2022 Intel Corporation
*
* SPDX-License-Identifier: MIT
*
@ -298,15 +298,18 @@ bool Event::calcProfilingData() {
const auto timestamps = timestampPacketContainer->peekNodes();
if (DebugManager.flags.PrintTimestampPacketContents.get()) {
for (auto i = 0u; i < timestamps.size(); i++) {
std::cout << "Timestamp " << i << ", "
<< "profiling capable: " << timestamps[i]->isProfilingCapable() << ", ";
<< "cmd type: " << this->cmdType << ", ";
for (auto j = 0u; j < timestamps[i]->getPacketsUsed(); j++) {
std::cout << "packet " << j << ": "
<< "global start: " << timestamps[i]->getGlobalStartValue(j) << ", "
<< "global end: " << timestamps[i]->getGlobalEndValue(j) << ", "
<< "context start: " << timestamps[i]->getContextStartValue(j) << ", "
<< "context end: " << timestamps[i]->getContextEndValue(j) << std::endl;
<< "context end: " << timestamps[i]->getContextEndValue(j) << ", "
<< "global delta: " << timestamps[i]->getGlobalEndValue(j) - timestamps[i]->getGlobalStartValue(j) << ", "
<< "context delta: " << timestamps[i]->getContextEndValue(j) - timestamps[i]->getContextStartValue(j) << std::endl;
}
}
}

View File

@ -1,5 +1,5 @@
/*
* Copyright (C) 2018-2021 Intel Corporation
* Copyright (C) 2018-2022 Intel Corporation
*
* SPDX-License-Identifier: MIT
*
@ -1326,13 +1326,15 @@ TEST_F(ProfilingTimestampPacketsTest, givenPrintTimestampPacketContentsSetWhenCa
std::string output = testing::internal::GetCapturedStdout();
std::stringstream expected;
expected << "Timestamp 0, profiling capable: " << ev->timestampPacketContainer->peekNodes()[0]->isProfilingCapable() << ", ";
expected << "Timestamp 0, cmd type: " << ev->getCommandType() << ", ";
for (int i = 0; i < 16; i++) {
expected << "packet " << i << ": "
<< "global start: " << globalStart[i] << ", "
<< "global end: " << globalEnd[i] << ", "
<< "context start: " << contextStart[i] << ", "
<< "context end: " << contextEnd[i] << std::endl;
<< "context end: " << contextEnd[i] << ", "
<< "global delta: " << globalEnd[i] - globalStart[i] << ", "
<< "context delta: " << contextEnd[i] - contextStart[i] << std::endl;
}
EXPECT_EQ(0, output.compare(expected.str().c_str()));
}