PC Sampling - blit kernels handling (#878)

* correlation id 0 for blit kernels' samples

* rocprofiler_pc_sampling_snapshot_v1_t docs update (for future use)

* ROCPROFILER_CORRELATION_ID_VALUE_NONE introduced

* Simplifying ROCPROFILER_CORRELATION_ID_VALUE_NONE

* Apply suggestions from code review

Co-authored-by: Vladimir Indic <139573562+vlaindic@users.noreply.github.com>

---------

Co-authored-by: Jonathan R. Madsen <jrmadsen@users.noreply.github.com>
이 커밋은 다음에 포함됨:
Vladimir Indic
2024-05-29 12:55:47 +02:00
커밋한 사람 GitHub
부모 dc054eea76
커밋 c45bf712d1
4개의 변경된 파일19개의 추가작업 그리고 9개의 파일을 삭제
+6 -5
파일 보기
@@ -140,9 +140,9 @@ public:
if(dev.handle == cache_dev_id && correlation_in == cache_correlation_id_in)
return cache_correlation_id_out;
#endif
cache_correlation_id_out = dispatch_to_correlation.at({correlation_in, dev});
cache_dev_id = dev.handle;
cache_correlation_id_in = correlation_in;
cache_correlation_id_out = dispatch_to_correlation.at({correlation_in, dev});
return cache_correlation_id_out;
}
@@ -191,16 +191,17 @@ add_upcoming_samples(const device_handle device,
{
const auto* snap = reinterpret_cast<const perf_sample_snapshot_v1*>(buffer + p);
samples[p] = copySample<bHostTrap, GFXIP>((const void*) (buffer + p));
samples[p].size = 0; // pc sampling record with size 0 will indicate invalid sample
samples[p].size = sizeof(rocprofiler_pc_sampling_record_t);
try
{
Parser::trap_correlation_id_t trap{.raw = snap->correlation_id};
samples[p].correlation_id = corr_map->get(device, trap);
samples[p].size = sizeof(rocprofiler_pc_sampling_record_t);
// set size after corr_map->get which may throw
} catch(std::exception& e)
{
status = PCSAMPLE_STATUS_PARSER_ERROR;
samples[p].correlation_id = {.internal = ROCPROFILER_CORRELATION_ID_VALUE_NONE,
.external = rocprofiler_user_data_t{
.value = ROCPROFILER_CORRELATION_ID_VALUE_NONE}};
status = PCSAMPLE_STATUS_PARSER_ERROR;
}
}
return status;