fix(debugger): Fix handling pf event with flat hierarchy

Related-to: GSD-6918

Signed-off-by: Brandon Yates <brandon.yates@intel.com>
This commit is contained in:
Brandon Yates
2023-11-15 21:46:47 +00:00
committed by Compute-Runtime-Automation
parent 2b35c2374b
commit 7f1167d5fe
2 changed files with 8 additions and 5 deletions

View File

@@ -1391,9 +1391,12 @@ void DebugSessionLinuxi915::handlePageFaultEvent(prelim_drm_i915_debug_event_pag
lock = std::unique_lock<std::mutex>(threadStateMutex);
}
for (auto &threadId : threadsWithPF) {
PRINT_DEBUGGER_INFO_LOG("PageFault event for thread %s", EuThread::toString(threadId).c_str());
allThreads[threadId]->setPageFault(true);
if (tileSessionsEnabled) {
static_cast<TileDebugSessionLinuxi915 *>(tileSessions[tileIndex].first)->allThreads[threadId]->setPageFault(true);
} else {
allThreads[threadId]->setPageFault(true);
}
}
for (auto &threadId : stoppedThreads) {
if (tileSessionsEnabled) {

View File

@@ -856,8 +856,8 @@ TEST_F(TileAttachTest, givenStoppedThreadsWhenHandlingPageFaultEventThenStoppedT
auto &hwInfo = neoDevice->getHardwareInfo();
auto &l0GfxCoreHelper = neoDevice->getRootDeviceEnvironment().getHelper<L0GfxCoreHelper>();
l0GfxCoreHelper.getAttentionBitmaskForSingleThreads({thread}, hwInfo, bitmaskBefore, bitmaskSize);
l0GfxCoreHelper.getAttentionBitmaskForSingleThreads({thread}, hwInfo, bitmaskAfter, bitmaskSize);
l0GfxCoreHelper.getAttentionBitmaskForSingleThreads({}, hwInfo, bitmaskBefore, bitmaskSize);
l0GfxCoreHelper.getAttentionBitmaskForSingleThreads({}, hwInfo, bitmaskAfter, bitmaskSize);
l0GfxCoreHelper.getAttentionBitmaskForSingleThreads({thread}, hwInfo, bitmaskResolved, bitmaskSize);
prelim_drm_i915_debug_event_page_fault pf = {};
@@ -879,10 +879,10 @@ TEST_F(TileAttachTest, givenStoppedThreadsWhenHandlingPageFaultEventThenStoppedT
memcpy(ptrOffset(data, offsetof(prelim_drm_i915_debug_event_page_fault, bitmask) + (2 * bitmaskSize)), bitmaskResolved.get(), bitmaskSize);
rootSession->handleEvent(reinterpret_cast<prelim_drm_i915_debug_event *>(data));
auto expectedThreadsToCheck = hwInfo.capabilityTable.fusedEuEnabled ? 2u : 1u;
EXPECT_EQ(expectedThreadsToCheck, tileSessions[1]->newlyStoppedThreads.size());
EXPECT_TRUE(tileSessions[1]->triggerEvents);
EXPECT_TRUE(tileSessions[1]->allThreads[thread]->getPageFault());
}
TEST_F(TileAttachTest, GivenBlockingOnCpuDetachedTileAndZebinModulesWithEventsToAckWhenDetachingTileThenNoAckIoctlIsCalled) {