refactor: improve logging by adding size.

Signed-off-by: Michal Mrozek <michal.mrozek@intel.com>
This commit is contained in:
Michal Mrozek
2024-09-11 15:18:21 +00:00
committed by Compute-Runtime-Automation
parent ddce122991
commit 7cba813c81
2 changed files with 3 additions and 0 deletions

View File

@@ -110,6 +110,7 @@ void FileLogger<debugLevel>::logAllocation(GraphicsAllocation const *graphicsAll
ss << " AllocationType: " << getAllocationTypeString(graphicsAllocation);
ss << " MemoryPool: " << getMemoryPoolString(graphicsAllocation);
ss << " Root device index: " << graphicsAllocation->getRootDeviceIndex();
ss << " Size: " << graphicsAllocation->getUnderlyingBufferSize();
ss << " GPU address: 0x" << std::hex << graphicsAllocation->getGpuAddress() << " - 0x" << std::hex << graphicsAllocation->getGpuAddress() + graphicsAllocation->getUnderlyingBufferSize() - 1;
ss << graphicsAllocation->getAllocationInfoString();

View File

@@ -33,6 +33,7 @@ TEST_F(FileLoggerTests, GivenLogAllocationMemoryPoolFlagThenLogsCorrectInfo) {
allocation.memoryPool = MemoryPool::system64KBPages;
allocation.getDefaultGmm()->resourceParams.Flags.Info.NonLocalOnly = 0;
allocation.setGpuAddress(0x12345);
allocation.size = 777u;
fileLogger.logAllocation(&allocation);
@@ -58,6 +59,7 @@ TEST_F(FileLoggerTests, GivenLogAllocationMemoryPoolFlagThenLogsCorrectInfo) {
EXPECT_TRUE(str.find(gpuAddressCheck.str()) != std::string::npos);
EXPECT_TRUE(str.find(rootDeviceIndexCheck.str()) != std::string::npos);
EXPECT_TRUE(str.find("AllocationType: BUFFER") != std::string::npos);
EXPECT_TRUE(str.find("Size: 777") != std::string::npos);
}
}