Existing code uses lockf to ensure exclusive PMC access of one process and
one TraceId. However Thunk spec allows hsaKmtPmcAcquireTraceAccess to get
exclusive access to the defined set of counters, not exclusive to one
process or one TraceId. Multiple counter sets of multiple TraceIds is
allowed if they meet the concurrent access limit evaluated by the hardware
/driver.

Change-Id: I59cacb855a707fe326a4070452fcbbd3c95ac223


[ROCm/ROCR-Runtime commit: 1025579c0b]
Этот коммит содержится в:
Amber Lin
2017-02-15 11:32:49 -05:00
родитель c28c344f78
Коммит 39ad1ba008
4 изменённых файлов: 300 добавлений и 33 удалений
+8 -5
Просмотреть файл
@@ -113,13 +113,16 @@ hsaKmtOpenKFD(void)
if (init_device_debugging_memory(sys_props.NumNodes) != HSAKMT_STATUS_SUCCESS)
printf("Insufficient Memory. Debugging unavailable\n");
if (init_counter_props(sys_props.NumNodes) != HSAKMT_STATUS_SUCCESS)
printf("Insufficient Memory. Performance Counter information unavailable\n");
amd_hsa_thunk_lock_fd = open(tmp_file,
O_CREAT | //create the file if it's not present.
O_RDWR, //only need write access for the internal locking semantics.
S_IRUSR | S_IWUSR); //permissions on the file, 600 here.
O_RDWR,
S_IROTH | S_IWOTH); //allow others to read/write
if (amd_hsa_thunk_lock_fd < 0)
fprintf(stderr,
"Profiling of privileged counters is not available\n");
if (init_counter_props(sys_props.NumNodes) !=
HSAKMT_STATUS_SUCCESS)
fprintf(stderr, "Profiling is not available\n");
}
else
{