Host trap PC sampling uses new record type (#1207)

* Host trap PC sampling uses new record type

* removing redundant field

* formatting

* simplifying templates in the parser - no need for HostTrap boolean

* reviving some parser tests

* hw_id decoding on GFX9

* HW id parser test

* parser CID test

* Parser multigpu test

* removing rocprofiler_pc_sampling_record_t and some fields from hw_id

* simplifying parser context

* keep bench test internally

* initializing gfx9_hw_id_t differently

* anonymous struct first

* avoiding inlining initialization of struct
Этот коммит содержится в:
Vladimir Indic
2024-11-20 21:02:47 +01:00
коммит произвёл GitHub
родитель 55aea3ef10
Коммит bc52c17e64
21 изменённых файлов: 1319 добавлений и 738 удалений
+14 -12
Просмотреть файл
@@ -266,7 +266,8 @@ configure_pc_sampling_prefer_stochastic(tool_agent_info* agent_info,
picked_cfg->method,
picked_cfg->unit,
interval,
buffer_id);
buffer_id,
0);
if(status == ROCPROFILER_STATUS_SUCCESS)
{
*utils::get_output_stream()
@@ -334,24 +335,25 @@ rocprofiler_pc_sampling_callback(rocprofiler_context_id_t /*context_id*/,
}
else if(cur_header->category == ROCPROFILER_BUFFER_CATEGORY_PC_SAMPLING)
{
if(cur_header->kind == ROCPROFILER_PC_SAMPLING_RECORD_SAMPLE)
if(cur_header->kind == ROCPROFILER_PC_SAMPLING_RECORD_HOST_TRAP_V0_SAMPLE)
{
auto* pc_sample =
static_cast<rocprofiler_pc_sampling_record_t*>(cur_header->payload);
auto* pc_sample = static_cast<rocprofiler_pc_sampling_record_host_trap_v0_t*>(
cur_header->payload);
ss << "(code_obj_id, offset): (" << pc_sample->pc.loaded_code_object_id
<< ", 0x" << std::hex << pc_sample->pc.loaded_code_object_offset << "), "
ss << "(code_obj_id, offset): (" << pc_sample->pc.code_object_id << ", 0x"
<< std::hex << pc_sample->pc.code_object_offset << "), "
<< "timestamp: " << std::dec << pc_sample->timestamp << ", "
<< "exec: " << std::hex << std::setw(16) << pc_sample->exec_mask << ", "
<< "workgroup_id_(x=" << std::dec << std::setw(5)
<< pc_sample->workgroup_id.x << ", "
<< "y=" << std::setw(5) << pc_sample->workgroup_id.y << ", "
<< "z=" << std::setw(5) << pc_sample->workgroup_id.z << "), "
<< "wave_id: " << std::setw(2)
<< static_cast<unsigned int>(pc_sample->wave_id) << ", "
<< "wave_in_group: " << std::setw(2)
<< static_cast<unsigned int>(pc_sample->wave_in_group) << ", "
<< "chiplet: " << std::setw(2)
<< static_cast<unsigned int>(pc_sample->chiplet) << ", "
<< "cu_id: " << pc_sample->hw_id << ", "
<< static_cast<unsigned int>(pc_sample->hw_id.chiplet)
<< ", "
// << "cu_id: " << pc_sample->hw_id << ", "
<< "correlation: {internal=" << std::setw(7)
<< pc_sample->correlation_id.internal << ", "
<< "external=" << std::setw(5) << pc_sample->correlation_id.external.value
@@ -373,8 +375,8 @@ rocprofiler_pc_sampling_callback(rocprofiler_context_id_t /*context_id*/,
assert(corr_id.external.value > 0);
// Decoding the PC
auto inst = translator.get(pc_sample->pc.loaded_code_object_id,
pc_sample->pc.loaded_code_object_offset);
auto inst = translator.get(pc_sample->pc.code_object_id,
pc_sample->pc.code_object_offset);
flat_profile.add_sample(std::move(inst), pc_sample->exec_mask);
}
else