Fix an application crash when collecting performance counters with rocprofiler (#117)

* Add check to skip counter_storage::write() if internal storage field is destroyed.
* Output warning message if counter data is not available when trying to write out to Timemory

---------

Co-authored-by: David Galiffi <David.Galiffi@amd.com>
이 커밋은 다음에 포함됨:
Sohaib Nadeem그리고David Galiffi 작성하고 GitHub가 2025-02-27 14:34:52 -05:00를 커밋함
1 부모 3bea1d8eac
커밋 43f900d01e
1 파일이 변경됨
+8
+8
파일 보기
@@ -126,6 +126,14 @@ counter_storage::operator()(const counter_event& _event, timing_interval _timing
void
counter_storage::write() const
{
if(!trait::runtime_enabled<counter_data_tracker>::get())
{
ROCPROFSYS_WARNING_F(
1, "%s counter_data_tracker is disabled. Can't write storage.\n",
metric_name.c_str());
return;
}
operation::set_storage<counter_data_tracker>{}(storage.get());
counter_data_tracker::label() = metric_name;
counter_data_tracker::description() = metric_description;