performance: Add flag to aub dump only command stream

Signed-off-by: Lukasz Jobczyk <lukasz.jobczyk@intel.com>
This commit is contained in:
Lukasz Jobczyk
2025-10-23 10:51:09 +00:00
committed by Compute-Runtime-Automation
parent 9474d455b1
commit 0bfcd9783c
4 changed files with 36 additions and 0 deletions

View File

@@ -18,6 +18,7 @@ DECLARE_DEBUG_VARIABLE(std::string, AUBDumpFilterKernelName, std::string("unk"),
DECLARE_DEBUG_VARIABLE(std::string, AUBDumpToggleFileName, std::string("unk"), "Name of file to save AUB in toggle mode")
DECLARE_DEBUG_VARIABLE(std::string, OverrideGdiPath, std::string("unk"), "When different value than \"unk\", will override default path to gdi library.")
DECLARE_DEBUG_VARIABLE(std::string, AubDumpAddMmioRegistersList, std::string("unk"), "Semicolon separated sequence of additional MMIO registers offset;values pairs i.e. 0x111;0x123;0x222;0x456")
DECLARE_DEBUG_VARIABLE(int64_t, AUBDumpAllocations, 0, "0: default, >0: (bitmask) dump given allocation types to AUB")
DECLARE_DEBUG_VARIABLE(int32_t, BlitterEnableMaskOverride, 0, "Specify bitmask with BCS engines available on the device, for use in AUB/TBX mode")
DECLARE_DEBUG_VARIABLE(int32_t, AUBDumpFilterNamedKernelStartIdx, 0, "Start index of named kernel to AUB capture")
DECLARE_DEBUG_VARIABLE(int32_t, AUBDumpFilterNamedKernelEndIdx, -1, "End index of named kernel to AUB capture")

View File

@@ -100,6 +100,13 @@ void GraphicsAllocation::setAubWritable(bool writable, uint32_t banks) {
}
bool GraphicsAllocation::isAubWritable(uint32_t banks) const {
if (debugManager.flags.AUBDumpAllocations.get()) {
UNRECOVERABLE_IF(allocationType == AllocationType::unknown);
if ((1llu << (static_cast<int64_t>(this->getAllocationType()) - 1)) & ~debugManager.flags.AUBDumpAllocations.get()) {
return false;
}
}
return isAnyBitSet(aubInfo.aubWritable, banks);
}

View File

@@ -9,6 +9,7 @@ AUBDumpCaptureFileName = unk
AUBDumpCaptureDirPath = unk
AUBDumpFilterKernelName = unk
AUBDumpToggleFileName = unk
AUBDumpAllocations = 0
OverrideGdiPath = unk
AubDumpAddMmioRegistersList = unk
ZE_AFFINITY_MASK = default

View File

@@ -695,6 +695,33 @@ HWTEST_F(AubCommandStreamReceiverTests, givenAubCommandStreamReceiverWhenGraphic
memoryManager->freeGraphicsMemory(gfxAllocation);
}
HWTEST_F(AubCommandStreamReceiverTests, givenAUBDumpAllocationsThenOnlySetAllocationsAubWritable) {
DebugManagerStateRestore restorer;
debugManager.flags.AUBDumpAllocations.set((1ll << (static_cast<int64_t>(AllocationType::commandBuffer) - 1)) |
(1ll << (static_cast<int64_t>(AllocationType::kernelIsa) - 1)) |
(1ll << (static_cast<int64_t>(AllocationType::gpuTimestampDeviceBuffer) - 1)));
auto aubExecutionEnvironment = getEnvironment<AUBCommandStreamReceiverHw<FamilyType>>(false, false, true);
auto memoryManager = aubExecutionEnvironment->executionEnvironment->memoryManager.get();
auto gfxAllocation = memoryManager->allocateGraphicsMemoryWithProperties(MockAllocationProperties{pDevice->getRootDeviceIndex(), MemoryConstants::pageSize});
for (int i = 0; i < static_cast<int>(AllocationType::count); ++i) {
auto allocationType = static_cast<AllocationType>(i);
gfxAllocation->setAllocationType(allocationType);
if (allocationType == AllocationType::commandBuffer || allocationType == AllocationType::kernelIsa || allocationType == AllocationType::gpuTimestampDeviceBuffer) {
EXPECT_TRUE(gfxAllocation->isAubWritable(GraphicsAllocation::defaultBank));
} else if (allocationType == AllocationType::unknown) {
EXPECT_ANY_THROW(gfxAllocation->isAubWritable(GraphicsAllocation::defaultBank));
} else {
EXPECT_FALSE(gfxAllocation->isAubWritable(GraphicsAllocation::defaultBank));
}
}
memoryManager->freeGraphicsMemory(gfxAllocation);
}
HWTEST_F(AubCommandStreamReceiverTests, givenAubCommandStreamReceiverWhenProcessResidencyIsCalledOnDefaultAllocationThenAllocationTypeShouldNotBeMadeNonAubWritable) {
auto aubExecutionEnvironment = getEnvironment<AUBCommandStreamReceiverHw<FamilyType>>(false, false, true);
auto aubCsr = aubExecutionEnvironment->template getCsr<AUBCommandStreamReceiverHw<FamilyType>>();