Fixed format of presenting MI300 counters for individual xccs

1. Modified rocprofiler_record_profiler_t to include xcc_index
2. Modified file plugin to add additional column XCC_Index to the csv

Change-Id: Ic526c739e16b50dca5704070ccabbcbecd994d6a


[ROCm/rocprofiler commit: b18bc9930b]
Этот коммит содержится в:
Saurabh Verma
2023-11-10 16:11:59 -06:00
коммит произвёл Giovanni Baraldi
родитель 44c150c7d4
Коммит 5486b9de3a
3 изменённых файлов: 12 добавлений и 1 удалений
+5 -1
Просмотреть файл
@@ -1102,6 +1102,10 @@ typedef struct {
* The count of the counters that were collected by the profiler
*/
rocprofiler_record_counters_instances_count_t counters_count; /* Counters Count */
/**
* The index of the xcc from which these counters were collected
*/
uint32_t xcc_index;
/**
* kernel properties, including the grid size, work group size,
* registers count, wave size and completion signal
@@ -2394,7 +2398,7 @@ rocprofiler_codeobj_capture_free(rocprofiler_record_id_t id);
* \param[in] id record handle.
* \retval ::ROCPROFILER_STATUS_SUCCESS The function has been executed successfully.
* \retval ::ROCPROFILER_STATUS_ERROR_INVALID_ARGUMENTS invalid ID.
*/
*/
ROCPROFILER_API rocprofiler_status_t
rocprofiler_codeobj_capture_start(rocprofiler_record_id_t id);
+6
Просмотреть файл
@@ -175,6 +175,9 @@ class file_plugin_t {
file_plugin_t(void* data) {
if (data) counter_names_ = GetCounterNames();
const char* str = getenv("ROCPROFILER_INDIVIDUAL_XCC_MODE");
if (str != NULL) is_individual_xcc_mode = (atol(str) > 0);
valid_ = true;
}
@@ -342,6 +345,7 @@ class file_plugin_t {
if (!counter_header_written_) {
if (profiler_record->counters) {
if(is_individual_xcc_mode) ss << ',' << "XCC_Index";
for (uint64_t i = 0; i < profiler_record->counters_count.value; i++) {
auto counter_handler = profiler_record->counters[i].counter_handler;
if (!counter_handler.handle) continue;
@@ -393,6 +397,7 @@ class file_plugin_t {
// For Counters
if (profiler_record->counters) {
if(is_individual_xcc_mode) ss << "," << profiler_record->xcc_index;
for (uint64_t i = 0; i < profiler_record->counters_count.value; i++) {
if (profiler_record->counters[i].counter_handler.handle > 0) {
ss << "," << std::to_string(profiler_record->counters[i].value.value);
@@ -456,6 +461,7 @@ class file_plugin_t {
private:
bool valid_{false};
bool counter_header_written_ = false;
bool is_individual_xcc_mode=false;
std::vector<std::string> counter_names_;
std::atomic<bool> roctx_header_written_{false}, hsa_api_header_written_{false},
+1
Просмотреть файл
@@ -434,6 +434,7 @@ bool AsyncSignalHandler(hsa_signal_value_t signal_value, void* data) {
record.queue_idx = rocprofiler_queue_index_t{pending->queue_index};
record.timestamps = rocprofiler_record_header_timestamp_t{time.start, time.end};
record.queue_id = rocprofiler_queue_id_t{queue_info_session->queue_id};
record.xcc_index = xcc_id;
// Kernel Descriptor is the right record id generated in the WriteInterceptor function and
// will be used to handle the kernel name of that dispatch
record.header = rocprofiler_record_header_t{