From 97fc25bb8d5bcda75ccc8910b2750cda1194ede7 Mon Sep 17 00:00:00 2001 From: Jonathan Kim Date: Wed, 27 Apr 2022 10:42:00 -0400 Subject: [PATCH] kfdtest: add set exceptions enable base debug operation Add set exceptions enabled debug option Signed-off-by: Jonathan Kim Change-Id: I6ee1769bbbb90a74074d8100974c4bfeabaf7f2c --- tests/kfdtest/src/BaseDebug.cpp | 13 +++++++++++++ tests/kfdtest/src/BaseDebug.hpp | 1 + 2 files changed, 14 insertions(+) diff --git a/tests/kfdtest/src/BaseDebug.cpp b/tests/kfdtest/src/BaseDebug.cpp index a673ad8448..1de15f80e6 100644 --- a/tests/kfdtest/src/BaseDebug.cpp +++ b/tests/kfdtest/src/BaseDebug.cpp @@ -146,3 +146,16 @@ HSAKMT_STATUS BaseDebug::QueryDebugEvent(uint64_t *exceptions, return result; } + +void BaseDebug::SetExceptionsEnabled(uint64_t exceptions) +{ + struct kfd_ioctl_dbg_trap_args args = {0}; + + memset(&args, 0x00, sizeof(args)); + + args.pid = m_Pid; + args.op = KFD_IOC_DBG_TRAP_SET_EXCEPTIONS_ENABLED; + args.set_exceptions_enabled.exception_mask = exceptions; + + hsaKmtDebugTrapIoctl(&args, NULL); +} diff --git a/tests/kfdtest/src/BaseDebug.hpp b/tests/kfdtest/src/BaseDebug.hpp index eede721a7c..f744761b5c 100644 --- a/tests/kfdtest/src/BaseDebug.hpp +++ b/tests/kfdtest/src/BaseDebug.hpp @@ -44,6 +44,7 @@ class BaseDebug { HSAKMT_STATUS QueryDebugEvent(uint64_t *exceptions, uint32_t *gpuId, uint32_t *queueId, int timeoutMsec); + void SetExceptionsEnabled(uint64_t exceptions); private: unsigned int m_Pid;