[rocprof-sys] Fix roctx wall clock tree, change timemory push/pop to use proper category, and add roctx as valid domain choice (#2062)

When doing this ticket, I also noticed the program would SEGFAULT when ROCPROFSYS_ROCM_DOMAINS=roctx even though the docs tell us we can do this. Went ahead and fixed that.

Also noticed that timemory push/pop in rocprofiler-sdk.cpp was always using category::rocm_marker_api instead of CategoryT. Fixed that as well.
Этот коммит содержится в:
Kian Cossettini
2025-12-01 09:50:58 -05:00
коммит произвёл GitHub
родитель ae29018bb0
Коммит b506c75f28
2 изменённых файлов: 13 добавлений и 5 удалений
+1
Просмотреть файл
@@ -328,6 +328,7 @@ config_settings(const std::shared_ptr<settings>& _config)
_add_domain("hip_api");
_add_domain("hsa_api");
_add_domain("marker_api");
_add_domain("roctx");
for(const auto& itr : buffered_tracing_info)
_add_domain(itr.name);
+12 -5
Просмотреть файл
@@ -651,7 +651,14 @@ tool_tracing_callback_start(CategoryT, rocprofiler_callback_tracing_record_t rec
}
default:
{
break;
// A basic roctx marker region starts with roctxRangePushA ENTER and
// ends with roctxRangePop EXIT.
// Breaking instead of returning allows the roctxRangePop ENTER to be
// processed, which timemory will link to the roctxRangePop EXIT. As
// we do not push roctxRangePushA EXIT into timemory, it will think
// that the roctxRangePushA ENTER is still active when it is in fact
// not. This will cause the wall clock tree to be incorrect.
return;
}
}
}
@@ -659,7 +666,7 @@ tool_tracing_callback_start(CategoryT, rocprofiler_callback_tracing_record_t rec
if(get_use_timemory())
{
tracing::push_timemory(category::rocm_marker_api{}, _name);
tracing::push_timemory(CategoryT{}, _name);
}
}
@@ -729,7 +736,7 @@ tool_tracing_callback_stop(
if(get_use_timemory())
{
tracing::pop_timemory(category::rocm_marker_api{}, _name);
tracing::pop_timemory(CategoryT{}, _name);
}
if(get_use_perfetto())
@@ -1069,7 +1076,7 @@ ompt_tracing_callback_start(rocprofiler_callback_tracing_record_t record,
if(get_use_timemory())
{
tracing::push_timemory(category::rocm_marker_api{}, _name);
tracing::push_timemory(category::rocm_ompt_api{}, _name);
}
if(get_use_perfetto())
@@ -1115,7 +1122,7 @@ ompt_tracing_callback_stop(
if(get_use_timemory())
{
tracing::pop_timemory(category::rocm_marker_api{}, _name);
tracing::pop_timemory(category::rocm_ompt_api{}, _name);
}
if(get_use_perfetto())