diff --git a/inc/rocprofiler.h b/inc/rocprofiler.h index 7b52c2aefb..5d385d5cb3 100644 --- a/inc/rocprofiler.h +++ b/inc/rocprofiler.h @@ -484,6 +484,7 @@ struct rocprofiler_hsa_callback_data_t { struct { hsa_device_type_t type; // type of assigned device uint32_t id; // id of assigned device + hsa_agent_t agent; // device HSA agent handle const void* ptr; // ptr the device is assigned to } device; struct { diff --git a/src/core/hsa_interceptor.h b/src/core/hsa_interceptor.h index dcc495725d..9ebd850b4a 100644 --- a/src/core/hsa_interceptor.h +++ b/src/core/hsa_interceptor.h @@ -169,6 +169,7 @@ class HsaInterceptor { hsa_agent_t agent = *agent_p; rocprofiler_hsa_callback_data_t data{}; data.device.id = util::HsaRsrcFactory::Instance().GetAgentInfo(agent)->dev_index; + data.device.agent = agent; data.device.ptr = ptr; HSA_RT(hsa_agent_get_info(agent, HSA_AGENT_INFO_DEVICE, &data.device.type)); diff --git a/test/tool/tool.cpp b/test/tool/tool.cpp index 1dfbe5a9a0..bda99bf1f2 100644 --- a/test/tool/tool.cpp +++ b/test/tool/tool.cpp @@ -847,6 +847,7 @@ hsa_status_t hsa_unified_callback( case ROCPROFILER_HSA_CB_ID_DEVICE: printf(" device type = 0x%x\n", data->device.type); printf(" device id = %u\n", data->device.id); + printf(" device agent = 0x%lx\n", data->device.agent.handle); printf(" assigned ptr = %p\n", data->device.ptr); break; case ROCPROFILER_HSA_CB_ID_MEMCOPY: