mirror of
https://github.com/intel/compute-runtime.git
synced 2026-01-12 17:33:00 +08:00
performance(debugger): optimize ATT handling - minimize mem allocs
- do not allocate state save area every time attention event is handled - keep allocated memory for subsequent events - remove not needed DBEUG_BREAK Related-To: NEO-8183 Signed-off-by: Mateusz Hoppe <mateusz.hoppe@intel.com>
This commit is contained in:
committed by
Compute-Runtime-Automation
parent
6d458cd002
commit
8e07dd30cb
@@ -1783,6 +1783,44 @@ TEST(DebugSessionTest, givenStoppedThreadWhenGettingNotStoppedThreadsThenOnlyRun
|
||||
EXPECT_EQ(thread1, newStops[0]);
|
||||
}
|
||||
|
||||
TEST(DebugSessionTest, givenSizeBiggerThanPreviousWhenAllocatingStateSaveAreaMemoryThenNewMemoryIsAllocated) {
|
||||
zet_debug_config_t config = {};
|
||||
config.pid = 0x1234;
|
||||
auto hwInfo = *NEO::defaultHwInfo.get();
|
||||
|
||||
NEO::MockDevice *neoDevice(NEO::MockDevice::createWithNewExecutionEnvironment<NEO::MockDevice>(&hwInfo, 0));
|
||||
Mock<L0::DeviceImp> deviceImp(neoDevice, neoDevice->getExecutionEnvironment());
|
||||
|
||||
auto sessionMock = std::make_unique<MockDebugSession>(config, &deviceImp);
|
||||
|
||||
EXPECT_EQ(0u, sessionMock->stateSaveAreaMemory.size());
|
||||
sessionMock->allocateStateSaveAreaMemory(0x1000);
|
||||
EXPECT_EQ(0x1000u, sessionMock->stateSaveAreaMemory.size());
|
||||
|
||||
sessionMock->allocateStateSaveAreaMemory(0x2000);
|
||||
EXPECT_EQ(0x2000u, sessionMock->stateSaveAreaMemory.size());
|
||||
}
|
||||
|
||||
TEST(DebugSessionTest, givenTheSameSizeWhenAllocatingStateSaveAreaMemoryThenNewMemoryIsNotAllocated) {
|
||||
zet_debug_config_t config = {};
|
||||
config.pid = 0x1234;
|
||||
auto hwInfo = *NEO::defaultHwInfo.get();
|
||||
|
||||
NEO::MockDevice *neoDevice(NEO::MockDevice::createWithNewExecutionEnvironment<NEO::MockDevice>(&hwInfo, 0));
|
||||
Mock<L0::DeviceImp> deviceImp(neoDevice, neoDevice->getExecutionEnvironment());
|
||||
|
||||
auto sessionMock = std::make_unique<MockDebugSession>(config, &deviceImp);
|
||||
|
||||
EXPECT_EQ(0u, sessionMock->stateSaveAreaMemory.size());
|
||||
sessionMock->allocateStateSaveAreaMemory(0x1000);
|
||||
EXPECT_EQ(0x1000u, sessionMock->stateSaveAreaMemory.size());
|
||||
|
||||
auto oldMem = sessionMock->stateSaveAreaMemory.data();
|
||||
|
||||
sessionMock->allocateStateSaveAreaMemory(0x1000);
|
||||
EXPECT_EQ(oldMem, sessionMock->stateSaveAreaMemory.data());
|
||||
}
|
||||
|
||||
using MultiTileDebugSessionTest = Test<MultipleDevicesWithCustomHwInfo>;
|
||||
|
||||
TEST_F(MultiTileDebugSessionTest, givenThreadsFromMultipleTilesWhenResumeCalledThenThreadsResumedInAllTiles) {
|
||||
|
||||
@@ -141,6 +141,7 @@ struct MockDebugSession : public L0::DebugSessionImp {
|
||||
using L0::DebugSession::debugArea;
|
||||
|
||||
using L0::DebugSessionImp::addThreadToNewlyStoppedFromRaisedAttention;
|
||||
using L0::DebugSessionImp::allocateStateSaveAreaMemory;
|
||||
using L0::DebugSessionImp::apiEvents;
|
||||
using L0::DebugSessionImp::applyResumeWa;
|
||||
using L0::DebugSessionImp::calculateThreadSlotOffset;
|
||||
@@ -156,6 +157,7 @@ struct MockDebugSession : public L0::DebugSessionImp {
|
||||
using L0::DebugSessionImp::registersAccessHelper;
|
||||
using L0::DebugSessionImp::resumeAccidentallyStoppedThreads;
|
||||
using L0::DebugSessionImp::sendInterrupts;
|
||||
using L0::DebugSessionImp::stateSaveAreaMemory;
|
||||
using L0::DebugSessionImp::typeToRegsetDesc;
|
||||
using L0::DebugSessionImp::validateAndSetStateSaveAreaHeader;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user