Pass info about system routine in module debug area

Resolves: NEO-6097

Signed-off-by: Mateusz Hoppe <mateusz.hoppe@intel.com>
This commit is contained in:
Mateusz Hoppe
2021-07-26 12:47:55 +00:00
committed by Compute-Runtime-Automation
parent 1d1a8473aa
commit c96c1b045a
6 changed files with 83 additions and 0 deletions

View File

@@ -137,5 +137,33 @@ TEST(RootDebugSession, givenAllSlicesWhenGettingSingleThreadsThenCorrectThreadsA
}
}
TEST(RootDebugSession, givenBindlessSystemRoutineWhenQueryingIsBindlessThenTrueReturned) {
zet_debug_config_t config = {};
config.pid = 0x1234;
auto hwInfo = *NEO::defaultHwInfo.get();
NEO::Device *neoDevice(NEO::MockDevice::createWithNewExecutionEnvironment<NEO::MockDevice>(&hwInfo, 0));
Mock<L0::DeviceImp> deviceImp(neoDevice, neoDevice->getExecutionEnvironment());
auto debugSession = std::make_unique<DebugSessionMock>(config, &deviceImp);
debugSession->debugArea.reserved1 = 1u;
EXPECT_TRUE(debugSession->isBindlessSystemRoutine());
}
TEST(RootDebugSession, givenBindfulSystemRoutineWhenQueryingIsBindlessThenFalseReturned) {
zet_debug_config_t config = {};
config.pid = 0x1234;
auto hwInfo = *NEO::defaultHwInfo.get();
NEO::Device *neoDevice(NEO::MockDevice::createWithNewExecutionEnvironment<NEO::MockDevice>(&hwInfo, 0));
Mock<L0::DeviceImp> deviceImp(neoDevice, neoDevice->getExecutionEnvironment());
auto debugSession = std::make_unique<DebugSessionMock>(config, &deviceImp);
debugSession->debugArea.reserved1 = 0u;
EXPECT_FALSE(debugSession->isBindlessSystemRoutine());
}
} // namespace ult
} // namespace L0

View File

@@ -24,7 +24,9 @@ class OsInterfaceWithDebugAttach : public NEO::OSInterface {
};
struct DebugSessionMock : public L0::RootDebugSession {
using L0::RootDebugSession::debugArea;
using L0::RootDebugSession::getSingleThreads;
using L0::RootDebugSession::isBindlessSystemRoutine;
DebugSessionMock(const zet_debug_config_t &config, L0::Device *device) : RootDebugSession(config, device), config(config){};
bool closeConnection() override { return true; }