SWDEV-295522: Fixing Performance Issue

Removing DEBUG_TRACES and the unnecessary use of roctracer_op_string, made the MS app reporting 78 to 81 stable samples per second, depending on the type of the trace, while the main app without rocprof reports 100 to 106. More detailed numbers will be posted in the ticket.

Change-Id: Ifbc529278cea54dd23e6086aa9b9ea2df952d5dd
This commit is contained in:
Ammar ELWazir authored and Ammar Elwazir committed 2022-04-22 18:51:49 -04:00
1 parent dc8717a6b5
commit e4569c41fe
3 files changed
+13 -16

No files matched your search

+7 -8
View File
@@ -409,12 +409,12 @@ void* HIP_SyncApiDataCallback(uint32_t op_id, roctracer_record_t* record, const
correlation_id_tls = 0;
}
const char* name = roctracer_op_string(ACTIVITY_DOMAIN_HIP_API, op_id, 0);
DEBUG_TRACE(
"HIP_SyncApiDataCallback(\"%s\") phase(%d): op(%u) record(%p) data(%p) pool(%p) depth(%d) "
"correlation_id(%lu) time_ns(%lu)\n",
name, phase, op_id, record, data, pool, (int)(record_pair_stack->size()),
(data_ptr) ? data_ptr->correlation_id : 0, timer.timestamp_ns());
roctracer_op_string(ACTIVITY_DOMAIN_HIP_API, op_id, 0), phase, op_id, record, data, pool,
(int)(record_pair_stack->size()), (data_ptr) ? data_ptr->correlation_id : 0,
timer.timestamp_ns());
return ret;
}
@@ -503,12 +503,11 @@ void* HIP_SyncActivityCallback(uint32_t op_id, roctracer_record_t* record,
correlation_id_tls = 0;
}
const char* name = roctracer_op_string(ACTIVITY_DOMAIN_HIP_API, op_id, 0);
DEBUG_TRACE(
"HIP_SyncActivityCallback(\"%s\") phase(%d): op(%u) record(%p) data(%p) pool(%p) depth(%d) "
"correlation_id(%lu) beg_ns(%lu) end_ns(%lu)\n",
name, phase, op_id, record, data, pool, (int)(record_pair_stack->size()),
(data_ptr) ? data_ptr->correlation_id : 0, timestamp_ns);
roctracer_op_string(ACTIVITY_DOMAIN_HIP_API, op_id, 0), phase, op_id, record, data, pool,
(int)(record_pair_stack->size()), (data_ptr) ? data_ptr->correlation_id : 0, timestamp_ns);
return ret;
}
@@ -525,11 +524,11 @@ void HIP_AsyncActivityCallback(uint32_t op_id, void* record, void* arg) {
if (record_ptr->correlation_id == 0) return;
pool->Write(*record_ptr);
const char* name = roctracer_op_string(ACTIVITY_DOMAIN_HIP_OPS, record_ptr->op, record_ptr->kind);
DEBUG_TRACE(
"HIP_AsyncActivityCallback(\"%s\"): op(%u) kind(%u) record(%p) pool(%p) correlation_id(%d) "
"beg_ns(%lu) end_ns(%lu)\n",
name, record_ptr->op, record_ptr->kind, record, pool, record_ptr->correlation_id,
roctracer_op_string(ACTIVITY_DOMAIN_HIP_OPS, record_ptr->op, record_ptr->kind),
record_ptr->op, record_ptr->kind, record, pool, record_ptr->correlation_id,
record_ptr->begin_ns, record_ptr->end_ns);
}
+1 -1
View File
@@ -209,7 +209,7 @@ inline static void DEBUG_TRACE(const char* fmt, ...) {
va_end(valist);
}
#else
inline static void DEBUG_TRACE(const char* fmt, ...) {}
#define DEBUG_TRACE(...)
#endif
#endif // SRC_UTIL_LOGGER_H_