rocprofv3: do not abort if counter does not have dimensions (#150)
* rocprofv3: do not abort if counter does not have dimensions * Relax error handling further in rocprofv3 metadata --------- Co-authored-by: Jonathan R. Madsen <jonathanrmadsen@gmail.com>
This commit is contained in:
@@ -30,8 +30,12 @@
|
||||
#include "lib/rocprofiler-sdk-att/att_lib_wrapper.hpp"
|
||||
|
||||
#include <rocprofiler-sdk/fwd.h>
|
||||
#include <rocprofiler-sdk/rocprofiler.h>
|
||||
#include <rocprofiler-sdk/cxx/details/tokenize.hpp>
|
||||
|
||||
#include <fmt/format.h>
|
||||
|
||||
#include <unistd.h>
|
||||
#include <memory>
|
||||
#include <vector>
|
||||
|
||||
@@ -179,12 +183,22 @@ void metadata::init(inprocess)
|
||||
ROCPROFILER_COUNTER_INFO_VERSION_0,
|
||||
&static_cast<rocprofiler_counter_info_v0_t&>(_info)));
|
||||
|
||||
ROCPROFILER_CHECK(rocprofiler_iterate_counter_dimensions(
|
||||
counters[i], dimensions_info_callback, &_dim_info));
|
||||
|
||||
_dim_ids.reserve(_dim_info.size());
|
||||
for(auto ditr : _dim_info)
|
||||
_dim_ids.emplace_back(ditr.id);
|
||||
if(auto _itr_dim_stat = rocprofiler_iterate_counter_dimensions(
|
||||
counters[i], dimensions_info_callback, &_dim_info);
|
||||
_itr_dim_stat == ROCPROFILER_STATUS_SUCCESS)
|
||||
{
|
||||
_dim_ids.reserve(_dim_info.size());
|
||||
for(auto ditr : _dim_info)
|
||||
_dim_ids.emplace_back(ditr.id);
|
||||
}
|
||||
else
|
||||
{
|
||||
ROCP_WARNING << fmt::format("rocprofiler_iterate_counter_dimensions(...) "
|
||||
"for counter {} returned {} :: {}",
|
||||
_info.name,
|
||||
rocprofiler_get_status_name(_itr_dim_stat),
|
||||
rocprofiler_get_status_string(_itr_dim_stat));
|
||||
}
|
||||
|
||||
data_v->at(id).emplace_back(
|
||||
id, _info, std::move(_dim_ids), std::move(_dim_info));
|
||||
@@ -193,14 +207,12 @@ void metadata::init(inprocess)
|
||||
},
|
||||
&agent_counter_info);
|
||||
|
||||
if(status != ROCPROFILER_STATUS_ERROR_AGENT_ARCH_NOT_SUPPORTED)
|
||||
{
|
||||
ROCPROFILER_CHECK(status);
|
||||
}
|
||||
else
|
||||
{
|
||||
ROCP_WARNING << "Init failed for agent " << itr.node_id << " (" << itr.name << ")";
|
||||
}
|
||||
ROCP_WARNING_IF(status != ROCPROFILER_STATUS_SUCCESS) << fmt::format(
|
||||
"rocprofiler_iterate_agent_supported_counters returned {} for agent {} ({}) :: {}",
|
||||
rocprofiler_get_status_name(status),
|
||||
itr.node_id,
|
||||
itr.name,
|
||||
rocprofiler_get_status_string(status));
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -52,19 +52,22 @@
|
||||
#include <unordered_set>
|
||||
#include <vector>
|
||||
|
||||
#define ROCPROFILER_CHECK_NESTED(VAR, RESULT) \
|
||||
#define ROCPROFILER_CHECK_NESTED(VAR, RESULT, LEVEL) \
|
||||
{ \
|
||||
rocprofiler_status_t ROCPROFILER_VARIABLE(CHECKSTATUS, VAR) = RESULT; \
|
||||
if(ROCPROFILER_VARIABLE(CHECKSTATUS, VAR) != ROCPROFILER_STATUS_SUCCESS) \
|
||||
if(rocprofiler_status_t ROCPROFILER_VARIABLE(CHECKSTATUS, VAR) = RESULT; \
|
||||
ROCPROFILER_VARIABLE(CHECKSTATUS, VAR) != ROCPROFILER_STATUS_SUCCESS) \
|
||||
{ \
|
||||
std::string_view status_msg = \
|
||||
rocprofiler_get_status_string(ROCPROFILER_VARIABLE(CHECKSTATUS, VAR)); \
|
||||
ROCP_FATAL << "[" << __FUNCTION__ << "] " << #RESULT << " failed with error code " \
|
||||
<< ROCPROFILER_VARIABLE(CHECKSTATUS, VAR) << " :: " << status_msg; \
|
||||
ROCP_##LEVEL << fmt::format( \
|
||||
"[{}] {} returned {} :: {}", \
|
||||
__FUNCTION__, \
|
||||
#RESULT, \
|
||||
rocprofiler_get_status_name(ROCPROFILER_VARIABLE(CHECKSTATUS, VAR)), \
|
||||
rocprofiler_get_status_string(ROCPROFILER_VARIABLE(CHECKSTATUS, VAR))); \
|
||||
} \
|
||||
}
|
||||
|
||||
#define ROCPROFILER_CHECK(RESULT) ROCPROFILER_CHECK_NESTED(__COUNTER__, RESULT)
|
||||
#define ROCPROFILER_CHECK(RESULT) ROCPROFILER_CHECK_NESTED(__COUNTER__, RESULT, FATAL)
|
||||
#define ROCPROFILER_CHECK_WARNING(RESULT) ROCPROFILER_CHECK_NESTED(__COUNTER__, RESULT, WARNING)
|
||||
|
||||
namespace rocprofiler
|
||||
{
|
||||
|
||||
مرجع در شماره جدید
Block a user