add queue snapshot test

adds api and test to get newly create queue snapshot per ptraced process.

Change-Id: Ife97123a5b930e837ccaa386801145ef23c2cc2c
Signed-off-by: Jonathan Kim <Jonathan.Kim@amd.com>
Cette révision appartient à :
Jonathan Kim
2019-08-29 00:21:52 -04:00
révisé par Jonathan Kim
Parent ad76ffd544
révision 8b01a1c4c5
5 fichiers modifiés avec 112 ajouts et 6 suppressions
+21
Voir le fichier
@@ -823,6 +823,27 @@ hsaKmtQueryDebugEvent(
bool *IsNew //OUT
);
/**
Newly created queue snapshot per ptraced process.
Returns queue snapshot including queue id, gpuid, context save base address,
queue status word, queue address and size, and queue read and write pointer.
ClearEvents set will clear new queue bit and queue status word bits.
Returns:
- HSAKMT_STATUS_SUCCESS if successful
*/
HSAKMT_STATUS
HSAKMTAPI
hsaKmtGetQueueSnapshot(
HSAuint32 NodeId, // IN
HSAuint32 Pid, // IN
bool ClearEvents, // IN
void *SnapshotBuf, // IN
HSAuint32 *QssEntries // IN/OUT
);
/**
Set the trap override mask. When debug trap is enabled by
hsaKmtEnableDebugTrap() each wave launched has its initial
+23 -1
Voir le fichier
@@ -93,6 +93,19 @@ struct kfd_ioctl_get_queue_wave_state_args {
__u32 pad;
};
struct kfd_queue_snapshot_entry {
__u64 ring_base_address;
__u64 write_pointer_address;
__u64 read_pointer_address;
__u64 ctx_save_restore_address;
__u32 queue_id;
__u32 gpu_id;
__u32 ring_size;
__u32 queue_type;
__u32 queue_status;
__u32 reserved[19];
};
/* For kfd_ioctl_set_memory_policy_args.default_policy and alternate_policy */
#define KFD_IOC_CACHE_POLICY_COHERENT 0
#define KFD_IOC_CACHE_POLICY_NONCOHERENT 1
@@ -246,6 +259,14 @@ struct kfd_ioctl_dbg_wave_control_args {
*/
#define KFD_IOC_DBG_TRAP_QUERY_DEBUG_EVENT 5
/* KFD_IOC_DBG_TRAP_GET_QUEUE_SNAPSHOT:
* ptr: user buffer (IN)
* data1: flags (IN)
* data2: number of queue snapshot entries (IN/OUT)
* data3: unused
*/
#define KFD_IOC_DBG_TRAP_GET_QUEUE_SNAPSHOT 6
/* KFD_IOC_DBG_TRAP_GET_VERSION:
* prt: unsused
* data1: major version (OUT)
@@ -254,6 +275,7 @@ struct kfd_ioctl_dbg_wave_control_args {
*/
#define KFD_IOC_DBG_TRAP_GET_VERSION 7
struct kfd_ioctl_dbg_trap_args {
__u64 ptr; /* to KFD -- used for pointer arguments: queue arrays */
__u32 pid; /* to KFD */
@@ -677,7 +699,7 @@ struct kfd_ioctl_cross_memory_copy_args {
AMDKFD_IOWR(0x20, struct kfd_ioctl_ipc_export_handle_args)
#define AMDKFD_IOC_DBG_TRAP \
AMDKFD_IOW(0x21, struct kfd_ioctl_dbg_trap_args)
AMDKFD_IOWR(0x21, struct kfd_ioctl_dbg_trap_args)
#define AMDKFD_IOC_CROSS_MEMORY_COPY \
AMDKFD_IOWR(0x22, struct kfd_ioctl_cross_memory_copy_args)