Implement PMC AcquireTrace

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]
This commit is contained in:
Amber Lin
2017-02-15 11:32:49 -05:00
parent c28c344f78
commit 39ad1ba008
4 changed files with 300 additions and 33 deletions
+10
View File
@@ -192,6 +192,16 @@ static struct perf_counter_block polaris_blocks[PERFCOUNTER_BLOCKID__MAX] = {
*/
static struct perf_counter_block iommu_block;
uint32_t pmc_table_get_max_concurrent(int block_id)
{
switch (block_id) {
case PERFCOUNTER_BLOCKID__IOMMUV2:
return iommu_block.num_of_slots;
default:
return 0;
}
}
static HSAKMT_STATUS
alloc_pmc_blocks_iommu(void)
{