kfdtest: add query operations

Add polling query debug event operation.

Signed-off-by: Jonathan Kim <jonathan.kim@amd.com>
Change-Id: Ic82ce4a393bfb28c9f32e7920f80c12da7f627d5
Цей коміт міститься в:
Jonathan Kim authored and Jonathan Kim committed 2023-08-08 16:00:25 -04:00
1 джерело c7129edcb8
коміт bfb0d15ee8
2 files changed
+38

No files matched your search

+35
Переглянути файл
@@ -111,3 +111,38 @@ HSAKMT_STATUS BaseDebug::SendRuntimeEvent(uint64_t exceptions, int gpuId, int qu
return hsaKmtDebugTrapIoctl(&args, NULL);
}
HSAKMT_STATUS BaseDebug::QueryDebugEvent(uint64_t *exceptions,
uint32_t *gpuId, uint32_t *queueId,
int timeoutMsec)
{
struct kfd_ioctl_dbg_trap_args args = {0};
HSAKMT_STATUS result;
int r = poll(&m_Fd, 1, timeoutMsec);
if (r > 0) {
char tmp[r];
read(m_Fd.fd, tmp, sizeof(tmp));
} else {
return HSAKMT_STATUS_ERROR;
}
memset(&args, 0x00, sizeof(args));
args.pid = m_Pid;
args.op = KFD_IOC_DBG_TRAP_QUERY_DEBUG_EVENT;
args.query_debug_event.exception_mask = *exceptions;
result = hsaKmtDebugTrapIoctl(&args, NULL);
*exceptions = args.query_debug_event.exception_mask;
if (gpuId)
*gpuId = args.query_debug_event.gpu_id;
if (queueId)
*queueId = args.query_debug_event.queue_id;
return result;
}
+3
Переглянути файл
@@ -41,6 +41,9 @@ class BaseDebug {
void Detach(void);
HSAKMT_STATUS SendRuntimeEvent(uint64_t exceptions, int gpuId, int queueId);
HSAKMT_STATUS QueryDebugEvent(uint64_t *exceptions,
uint32_t *gpuId, uint32_t *queueId,
int timeoutMsec);
private:
unsigned int m_Pid;