From 82ee832befbda9bc93b14f3ce8f595d043066ce0 Mon Sep 17 00:00:00 2001 From: Evgeny Date: Wed, 19 Jun 2019 15:09:27 -0500 Subject: [PATCH] minor change for read packets support Change-Id: I6ca1087b29d00c60f7deedb4dbd25992e8a3e726 [ROCm/rocprofiler commit: 4d677562e657f3b73781425b57bdeb7efef4ca9e] --- projects/rocprofiler/src/core/profile.h | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/projects/rocprofiler/src/core/profile.h b/projects/rocprofiler/src/core/profile.h index 223e2e5edf..9ed033759b 100644 --- a/projects/rocprofiler/src/core/profile.h +++ b/projects/rocprofiler/src/core/profile.h @@ -140,13 +140,14 @@ class Profile { if (status != HSA_STATUS_SUCCESS) AQL_EXC_RAISING(status, "aqlprofile_start"); status = api->hsa_ven_amd_aqlprofile_stop(&profile_, &stop); if (status != HSA_STATUS_SUCCESS) AQL_EXC_RAISING(status, "aqlprofile_stop"); + hsa_status_t rd_status = HSA_STATUS_ERROR; #ifdef AQLPROF_NEW_API - hsa_status_t rd_status = api->hsa_ven_amd_aqlprofile_read(&profile_, &read); + if (profile_.type == HSA_VEN_AMD_AQLPROFILE_EVENT_TYPE_PMC) { + rd_status = api->hsa_ven_amd_aqlprofile_read(&profile_, &read); + } #if 0 // Read API returns error if disabled if (rd_status != HSA_STATUS_SUCCESS) AQL_EXC_RAISING(status, "aqlprofile_read"); #endif -#else - hsa_status_t rd_status = HSA_STATUS_ERROR; #endif // Set completion signal