kfdtest: add snapshot operations
Add queue and devices snapshot operations. Signed-off-by: Jonathan Kim <jonathan.kim@amd.com> Change-Id: I836884c9f3b65dd9e5e444d554d3eb87938e1634
Этот коммит содержится в:
коммит произвёл
Jonathan Kim
родитель
5a675921ea
Коммит
b0e84183c1
@@ -193,3 +193,49 @@ HSAKMT_STATUS BaseDebug::ResumeQueues(unsigned int *numQueues,
|
|||||||
|
|
||||||
return hsaKmtDebugTrapIoctl(&args, queues, (HSAuint64 *)numQueues);
|
return hsaKmtDebugTrapIoctl(&args, queues, (HSAuint64 *)numQueues);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
HSAKMT_STATUS BaseDebug::QueueSnapshot(uint64_t exceptionsToClear,
|
||||||
|
uint64_t snapshotBufAddr,
|
||||||
|
uint32_t *numSnapshots)
|
||||||
|
{
|
||||||
|
struct kfd_ioctl_dbg_trap_args args = {0};
|
||||||
|
HSAKMT_STATUS result;
|
||||||
|
|
||||||
|
memset(&args, 0x00, sizeof(args));
|
||||||
|
|
||||||
|
args.pid = m_Pid;
|
||||||
|
args.op = KFD_IOC_DBG_TRAP_GET_QUEUE_SNAPSHOT;
|
||||||
|
args.queue_snapshot.exception_mask = exceptionsToClear;
|
||||||
|
args.queue_snapshot.snapshot_buf_ptr = snapshotBufAddr;
|
||||||
|
args.queue_snapshot.num_queues = *numSnapshots;
|
||||||
|
args.queue_snapshot.entry_size = sizeof(struct kfd_queue_snapshot_entry);
|
||||||
|
|
||||||
|
result = hsaKmtDebugTrapIoctl(&args, NULL, NULL);
|
||||||
|
|
||||||
|
*numSnapshots = args.queue_snapshot.num_queues;
|
||||||
|
|
||||||
|
return result;
|
||||||
|
}
|
||||||
|
|
||||||
|
HSAKMT_STATUS BaseDebug::DeviceSnapshot(uint64_t exceptionsToClear,
|
||||||
|
uint64_t snapshotBufAddr,
|
||||||
|
uint32_t *numSnapshots)
|
||||||
|
{
|
||||||
|
struct kfd_ioctl_dbg_trap_args args = {0};
|
||||||
|
HSAKMT_STATUS result;
|
||||||
|
|
||||||
|
memset(&args, 0x00, sizeof(args));
|
||||||
|
|
||||||
|
args.pid = m_Pid;
|
||||||
|
args.op = KFD_IOC_DBG_TRAP_GET_DEVICE_SNAPSHOT;
|
||||||
|
args.device_snapshot.exception_mask = exceptionsToClear;
|
||||||
|
args.device_snapshot.snapshot_buf_ptr = snapshotBufAddr;
|
||||||
|
args.device_snapshot.num_devices = *numSnapshots;
|
||||||
|
args.device_snapshot.entry_size = sizeof(struct kfd_dbg_device_info_entry);
|
||||||
|
|
||||||
|
result = hsaKmtDebugTrapIoctl(&args, NULL, NULL);
|
||||||
|
|
||||||
|
*numSnapshots = args.device_snapshot.num_devices;
|
||||||
|
|
||||||
|
return result;
|
||||||
|
}
|
||||||
|
|||||||
@@ -48,6 +48,10 @@ class BaseDebug {
|
|||||||
HSAKMT_STATUS SuspendQueues(unsigned int *numQueues, HSA_QUEUEID *queues, uint32_t *queueIds,
|
HSAKMT_STATUS SuspendQueues(unsigned int *numQueues, HSA_QUEUEID *queues, uint32_t *queueIds,
|
||||||
uint64_t exceptionsToClear);
|
uint64_t exceptionsToClear);
|
||||||
HSAKMT_STATUS ResumeQueues(unsigned int *numQueues, HSA_QUEUEID *queues, uint32_t *queueIds);
|
HSAKMT_STATUS ResumeQueues(unsigned int *numQueues, HSA_QUEUEID *queues, uint32_t *queueIds);
|
||||||
|
HSAKMT_STATUS QueueSnapshot(uint64_t exceptionsToClear, uint64_t snapshotBufAddr,
|
||||||
|
uint32_t *numSnapshots);
|
||||||
|
HSAKMT_STATUS DeviceSnapshot(uint64_t exceptionsToClear, uint64_t snapshotBuffAddr,
|
||||||
|
uint32_t *numSnapshots);
|
||||||
|
|
||||||
private:
|
private:
|
||||||
unsigned int m_Pid;
|
unsigned int m_Pid;
|
||||||
|
|||||||
Ссылка в новой задаче
Block a user