Remove _service from rocprofiler_service_* types (#221)
- this is a continuation of #168 which removed _SERVICE from the ROCPROFILER_SERVICE_ enums
Dieser Commit ist enthalten in:
committet von
GitHub
Ursprung
cf5e4b4b1b
Commit
ca296ff22b
@@ -69,7 +69,7 @@ ROCPROFILER_BUFFER_TRACING_KIND_STRING(EXTERNAL_CORRELATION)
|
||||
|
||||
template <size_t Idx, size_t... Tail>
|
||||
std::pair<const char*, size_t>
|
||||
get_kind_name(rocprofiler_service_buffer_tracing_kind_t kind, std::index_sequence<Idx, Tail...>)
|
||||
get_kind_name(rocprofiler_buffer_tracing_kind_t kind, std::index_sequence<Idx, Tail...>)
|
||||
{
|
||||
if(kind == Idx) return buffer_tracing_kind_string<Idx>::value;
|
||||
// recursion until tail empty
|
||||
@@ -82,11 +82,11 @@ get_kind_name(rocprofiler_service_buffer_tracing_kind_t kind, std::index_sequenc
|
||||
|
||||
extern "C" {
|
||||
rocprofiler_status_t
|
||||
rocprofiler_configure_buffer_tracing_service(rocprofiler_context_id_t context_id,
|
||||
rocprofiler_service_buffer_tracing_kind_t kind,
|
||||
rocprofiler_tracing_operation_t* operations,
|
||||
size_t operations_count,
|
||||
rocprofiler_buffer_id_t buffer_id)
|
||||
rocprofiler_configure_buffer_tracing_service(rocprofiler_context_id_t context_id,
|
||||
rocprofiler_buffer_tracing_kind_t kind,
|
||||
rocprofiler_tracing_operation_t* operations,
|
||||
size_t operations_count,
|
||||
rocprofiler_buffer_id_t buffer_id)
|
||||
{
|
||||
if(rocprofiler::registration::get_init_status() > -1)
|
||||
return ROCPROFILER_STATUS_ERROR_CONFIGURATION_LOCKED;
|
||||
@@ -126,9 +126,9 @@ rocprofiler_configure_buffer_tracing_service(rocprofiler_context_id_t
|
||||
}
|
||||
|
||||
rocprofiler_status_t
|
||||
rocprofiler_query_buffer_tracing_kind_name(rocprofiler_service_buffer_tracing_kind_t kind,
|
||||
const char** name,
|
||||
uint64_t* name_len)
|
||||
rocprofiler_query_buffer_tracing_kind_name(rocprofiler_buffer_tracing_kind_t kind,
|
||||
const char** name,
|
||||
uint64_t* name_len)
|
||||
{
|
||||
auto&& val = rocprofiler::buffer_tracing::get_kind_name(
|
||||
kind, std::make_index_sequence<ROCPROFILER_BUFFER_TRACING_LAST>{});
|
||||
@@ -140,10 +140,10 @@ rocprofiler_query_buffer_tracing_kind_name(rocprofiler_service_buffer_tracing_ki
|
||||
}
|
||||
|
||||
rocprofiler_status_t
|
||||
rocprofiler_query_buffer_tracing_kind_operation_name(rocprofiler_service_buffer_tracing_kind_t kind,
|
||||
uint32_t operation,
|
||||
const char** name,
|
||||
uint64_t* name_len)
|
||||
rocprofiler_query_buffer_tracing_kind_operation_name(rocprofiler_buffer_tracing_kind_t kind,
|
||||
uint32_t operation,
|
||||
const char** name,
|
||||
uint64_t* name_len)
|
||||
{
|
||||
if(kind < ROCPROFILER_BUFFER_TRACING_NONE || kind >= ROCPROFILER_BUFFER_TRACING_LAST)
|
||||
return ROCPROFILER_STATUS_ERROR_KIND_NOT_FOUND;
|
||||
@@ -174,7 +174,7 @@ rocprofiler_iterate_buffer_tracing_kinds(rocprofiler_buffer_tracing_kind_cb_t ca
|
||||
{
|
||||
for(uint32_t i = 0; i < ROCPROFILER_BUFFER_TRACING_LAST; ++i)
|
||||
{
|
||||
auto _success = callback(static_cast<rocprofiler_service_buffer_tracing_kind_t>(i), data);
|
||||
auto _success = callback(static_cast<rocprofiler_buffer_tracing_kind_t>(i), data);
|
||||
if(_success != 0) break;
|
||||
}
|
||||
|
||||
@@ -183,7 +183,7 @@ rocprofiler_iterate_buffer_tracing_kinds(rocprofiler_buffer_tracing_kind_cb_t ca
|
||||
|
||||
rocprofiler_status_t
|
||||
rocprofiler_iterate_buffer_tracing_kind_operations(
|
||||
rocprofiler_service_buffer_tracing_kind_t kind,
|
||||
rocprofiler_buffer_tracing_kind_t kind,
|
||||
rocprofiler_buffer_tracing_kind_operation_cb_t callback,
|
||||
void* data)
|
||||
{
|
||||
|
||||
@@ -65,7 +65,7 @@ ROCPROFILER_CALLBACK_TRACING_KIND_STRING(KERNEL_DISPATCH)
|
||||
|
||||
template <size_t Idx, size_t... Tail>
|
||||
std::pair<const char*, size_t>
|
||||
get_kind_name(rocprofiler_service_callback_tracing_kind_t kind, std::index_sequence<Idx, Tail...>)
|
||||
get_kind_name(rocprofiler_callback_tracing_kind_t kind, std::index_sequence<Idx, Tail...>)
|
||||
{
|
||||
if(kind == Idx) return callback_tracing_kind_string<Idx>::value;
|
||||
// recursion until tail empty
|
||||
@@ -78,12 +78,12 @@ get_kind_name(rocprofiler_service_callback_tracing_kind_t kind, std::index_seque
|
||||
|
||||
extern "C" {
|
||||
rocprofiler_status_t
|
||||
rocprofiler_configure_callback_tracing_service(rocprofiler_context_id_t context_id,
|
||||
rocprofiler_service_callback_tracing_kind_t kind,
|
||||
rocprofiler_tracing_operation_t* operations,
|
||||
size_t operations_count,
|
||||
rocprofiler_callback_tracing_cb_t callback,
|
||||
void* callback_args)
|
||||
rocprofiler_configure_callback_tracing_service(rocprofiler_context_id_t context_id,
|
||||
rocprofiler_callback_tracing_kind_t kind,
|
||||
rocprofiler_tracing_operation_t* operations,
|
||||
size_t operations_count,
|
||||
rocprofiler_callback_tracing_cb_t callback,
|
||||
void* callback_args)
|
||||
{
|
||||
if(rocprofiler::registration::get_init_status() > -1)
|
||||
return ROCPROFILER_STATUS_ERROR_CONFIGURATION_LOCKED;
|
||||
@@ -117,9 +117,9 @@ rocprofiler_configure_callback_tracing_service(rocprofiler_context_id_t context_
|
||||
}
|
||||
|
||||
rocprofiler_status_t
|
||||
rocprofiler_query_callback_tracing_kind_name(rocprofiler_service_callback_tracing_kind_t kind,
|
||||
const char** name,
|
||||
uint64_t* name_len)
|
||||
rocprofiler_query_callback_tracing_kind_name(rocprofiler_callback_tracing_kind_t kind,
|
||||
const char** name,
|
||||
uint64_t* name_len)
|
||||
{
|
||||
auto&& val = rocprofiler::callback_tracing::get_kind_name(
|
||||
kind, std::make_index_sequence<ROCPROFILER_CALLBACK_TRACING_LAST>{});
|
||||
@@ -131,11 +131,10 @@ rocprofiler_query_callback_tracing_kind_name(rocprofiler_service_callback_tracin
|
||||
}
|
||||
|
||||
rocprofiler_status_t
|
||||
rocprofiler_query_callback_tracing_kind_operation_name(
|
||||
rocprofiler_service_callback_tracing_kind_t kind,
|
||||
uint32_t operation,
|
||||
const char** name,
|
||||
uint64_t* name_len)
|
||||
rocprofiler_query_callback_tracing_kind_operation_name(rocprofiler_callback_tracing_kind_t kind,
|
||||
uint32_t operation,
|
||||
const char** name,
|
||||
uint64_t* name_len)
|
||||
{
|
||||
if(kind < ROCPROFILER_CALLBACK_TRACING_NONE || kind >= ROCPROFILER_CALLBACK_TRACING_LAST)
|
||||
return ROCPROFILER_STATUS_ERROR_KIND_NOT_FOUND;
|
||||
@@ -167,7 +166,7 @@ rocprofiler_iterate_callback_tracing_kinds(rocprofiler_callback_tracing_kind_cb_
|
||||
{
|
||||
for(uint32_t i = 0; i < ROCPROFILER_CALLBACK_TRACING_LAST; ++i)
|
||||
{
|
||||
auto _success = callback(static_cast<rocprofiler_service_callback_tracing_kind_t>(i), data);
|
||||
auto _success = callback(static_cast<rocprofiler_callback_tracing_kind_t>(i), data);
|
||||
if(_success != 0) break;
|
||||
}
|
||||
|
||||
@@ -176,7 +175,7 @@ rocprofiler_iterate_callback_tracing_kinds(rocprofiler_callback_tracing_kind_cb_
|
||||
|
||||
rocprofiler_status_t
|
||||
rocprofiler_iterate_callback_tracing_kind_operations(
|
||||
rocprofiler_service_callback_tracing_kind_t kind,
|
||||
rocprofiler_callback_tracing_kind_t kind,
|
||||
rocprofiler_callback_tracing_kind_operation_cb_t callback,
|
||||
void* data)
|
||||
{
|
||||
|
||||
@@ -44,9 +44,7 @@ namespace rocprofiler
|
||||
{
|
||||
namespace context
|
||||
{
|
||||
using external_cid_cb_t = uint64_t (*)(rocprofiler_service_callback_tracing_kind_t,
|
||||
uint32_t,
|
||||
uint64_t);
|
||||
using external_cid_cb_t = uint64_t (*)(rocprofiler_callback_tracing_kind_t, uint32_t, uint64_t);
|
||||
|
||||
constexpr auto null_user_data = rocprofiler_user_data_t{.value = 0};
|
||||
struct correlation_id
|
||||
@@ -105,7 +103,7 @@ struct callback_tracing_service
|
||||
void* data = nullptr;
|
||||
};
|
||||
|
||||
using domain_t = rocprofiler_service_callback_tracing_kind_t;
|
||||
using domain_t = rocprofiler_callback_tracing_kind_t;
|
||||
using callback_array_t = std::array<callback_data, domain_info<domain_t>::last>;
|
||||
|
||||
domain_context<domain_t> domains = {};
|
||||
@@ -114,7 +112,7 @@ struct callback_tracing_service
|
||||
|
||||
struct buffer_tracing_service
|
||||
{
|
||||
using domain_t = rocprofiler_service_buffer_tracing_kind_t;
|
||||
using domain_t = rocprofiler_buffer_tracing_kind_t;
|
||||
using buffer_array_t = std::array<rocprofiler_buffer_id_t, domain_info<domain_t>::last>;
|
||||
|
||||
domain_context<domain_t> domains = {};
|
||||
|
||||
@@ -70,30 +70,28 @@ add_domain_op(domain_context<DomainT>& _cfg, DomainT _domain, uint32_t _op)
|
||||
}
|
||||
|
||||
// instantiate the templates
|
||||
template struct domain_context<rocprofiler_service_callback_tracing_kind_t>;
|
||||
template struct domain_context<rocprofiler_callback_tracing_kind_t>;
|
||||
|
||||
template rocprofiler_status_t
|
||||
add_domain<rocprofiler_service_callback_tracing_kind_t>(
|
||||
domain_context<rocprofiler_service_callback_tracing_kind_t>&,
|
||||
rocprofiler_service_callback_tracing_kind_t);
|
||||
add_domain<rocprofiler_callback_tracing_kind_t>(
|
||||
domain_context<rocprofiler_callback_tracing_kind_t>&,
|
||||
rocprofiler_callback_tracing_kind_t);
|
||||
|
||||
template rocprofiler_status_t
|
||||
add_domain<rocprofiler_service_buffer_tracing_kind_t>(
|
||||
domain_context<rocprofiler_service_buffer_tracing_kind_t>&,
|
||||
rocprofiler_service_buffer_tracing_kind_t);
|
||||
add_domain<rocprofiler_buffer_tracing_kind_t>(domain_context<rocprofiler_buffer_tracing_kind_t>&,
|
||||
rocprofiler_buffer_tracing_kind_t);
|
||||
|
||||
template rocprofiler_status_t
|
||||
add_domain_op<rocprofiler_service_callback_tracing_kind_t>(
|
||||
domain_context<rocprofiler_service_callback_tracing_kind_t>&,
|
||||
rocprofiler_service_callback_tracing_kind_t,
|
||||
add_domain_op<rocprofiler_callback_tracing_kind_t>(
|
||||
domain_context<rocprofiler_callback_tracing_kind_t>&,
|
||||
rocprofiler_callback_tracing_kind_t,
|
||||
uint32_t);
|
||||
|
||||
template struct domain_context<rocprofiler_service_buffer_tracing_kind_t>;
|
||||
template struct domain_context<rocprofiler_buffer_tracing_kind_t>;
|
||||
|
||||
template rocprofiler_status_t
|
||||
add_domain_op<rocprofiler_service_buffer_tracing_kind_t>(
|
||||
domain_context<rocprofiler_service_buffer_tracing_kind_t>&,
|
||||
rocprofiler_service_buffer_tracing_kind_t,
|
||||
uint32_t);
|
||||
add_domain_op<rocprofiler_buffer_tracing_kind_t>(domain_context<rocprofiler_buffer_tracing_kind_t>&,
|
||||
rocprofiler_buffer_tracing_kind_t,
|
||||
uint32_t);
|
||||
} // namespace context
|
||||
} // namespace rocprofiler
|
||||
|
||||
@@ -41,7 +41,7 @@ template <typename Tp>
|
||||
struct domain_info;
|
||||
|
||||
template <>
|
||||
struct domain_info<rocprofiler_service_callback_tracing_kind_t>
|
||||
struct domain_info<rocprofiler_callback_tracing_kind_t>
|
||||
{
|
||||
static constexpr size_t none = ROCPROFILER_CALLBACK_TRACING_NONE;
|
||||
static constexpr size_t last = ROCPROFILER_CALLBACK_TRACING_LAST;
|
||||
@@ -49,7 +49,7 @@ struct domain_info<rocprofiler_service_callback_tracing_kind_t>
|
||||
};
|
||||
|
||||
template <>
|
||||
struct domain_info<rocprofiler_service_buffer_tracing_kind_t>
|
||||
struct domain_info<rocprofiler_buffer_tracing_kind_t>
|
||||
{
|
||||
static constexpr size_t none = ROCPROFILER_BUFFER_TRACING_NONE;
|
||||
static constexpr size_t last = ROCPROFILER_BUFFER_TRACING_LAST;
|
||||
@@ -61,8 +61,8 @@ struct domain_info<rocprofiler_service_buffer_tracing_kind_t>
|
||||
template <typename DomainT>
|
||||
struct domain_context
|
||||
{
|
||||
using supported_domains_v = common::mpl::type_list<rocprofiler_service_callback_tracing_kind_t,
|
||||
rocprofiler_service_buffer_tracing_kind_t>;
|
||||
using supported_domains_v = common::mpl::type_list<rocprofiler_callback_tracing_kind_t,
|
||||
rocprofiler_buffer_tracing_kind_t>;
|
||||
static_assert(common::mpl::is_one_of<DomainT, supported_domains_v>::value,
|
||||
"Unsupported domain type");
|
||||
static constexpr auto opcode_padding_v = domain_info<DomainT>::padding;
|
||||
|
||||
@@ -450,9 +450,9 @@ get_names(std::vector<const char*>& _name_list, std::index_sequence<Idx...>)
|
||||
}
|
||||
|
||||
bool
|
||||
should_wrap_functor(rocprofiler_service_callback_tracing_kind_t _callback_domain,
|
||||
rocprofiler_service_buffer_tracing_kind_t _buffered_domain,
|
||||
int _operation)
|
||||
should_wrap_functor(rocprofiler_callback_tracing_kind_t _callback_domain,
|
||||
rocprofiler_buffer_tracing_kind_t _buffered_domain,
|
||||
int _operation)
|
||||
{
|
||||
// we loop over all the *registered* contexts and see if any of them, at any point in time,
|
||||
// might require callback or buffered API tracing
|
||||
|
||||
@@ -31,9 +31,9 @@ namespace rocprofiler
|
||||
{
|
||||
namespace hsa
|
||||
{
|
||||
using activity_functor_t = int (*)(rocprofiler_service_callback_tracing_kind_t domain,
|
||||
uint32_t operation_id,
|
||||
void* data);
|
||||
using activity_functor_t = int (*)(rocprofiler_callback_tracing_kind_t domain,
|
||||
uint32_t operation_id,
|
||||
void* data);
|
||||
|
||||
using hsa_api_table_t = HsaApiTable;
|
||||
|
||||
|
||||
@@ -86,9 +86,9 @@ struct agent_data
|
||||
std::vector<hsa_device_type_t> agents = {};
|
||||
};
|
||||
|
||||
using callback_kind_names_t = std::map<rocprofiler_service_callback_tracing_kind_t, const char*>;
|
||||
using callback_kind_names_t = std::map<rocprofiler_callback_tracing_kind_t, const char*>;
|
||||
using callback_kind_operation_names_t =
|
||||
std::map<rocprofiler_service_callback_tracing_kind_t, std::map<uint32_t, const char*>>;
|
||||
std::map<rocprofiler_callback_tracing_kind_t, std::map<uint32_t, const char*>>;
|
||||
using wrap_count_t = std::pair<std::string_view, size_t>;
|
||||
|
||||
struct callback_name_info
|
||||
@@ -126,7 +126,7 @@ get_callback_tracing_names()
|
||||
// callback for each kind operation
|
||||
//
|
||||
static auto tracing_kind_operation_cb =
|
||||
[](rocprofiler_service_callback_tracing_kind_t kindv, uint32_t operation, void* data_v) {
|
||||
[](rocprofiler_callback_tracing_kind_t kindv, uint32_t operation, void* data_v) {
|
||||
auto* name_info_v = static_cast<callback_name_info*>(data_v);
|
||||
|
||||
if(kindv == ROCPROFILER_CALLBACK_TRACING_HSA_API)
|
||||
@@ -143,7 +143,7 @@ get_callback_tracing_names()
|
||||
//
|
||||
// callback for each callback kind (i.e. domain)
|
||||
//
|
||||
static auto tracing_kind_cb = [](rocprofiler_service_callback_tracing_kind_t kind, void* data) {
|
||||
static auto tracing_kind_cb = [](rocprofiler_callback_tracing_kind_t kind, void* data) {
|
||||
// store the callback kind name
|
||||
auto* name_info_v = static_cast<callback_name_info*>(data);
|
||||
const char* name = nullptr;
|
||||
|
||||
@@ -72,9 +72,9 @@ struct agent_data
|
||||
std::vector<hsa_device_type_t> agents = {};
|
||||
};
|
||||
|
||||
using callback_kind_names_t = std::map<rocprofiler_service_callback_tracing_kind_t, const char*>;
|
||||
using callback_kind_names_t = std::map<rocprofiler_callback_tracing_kind_t, const char*>;
|
||||
using callback_kind_operation_names_t =
|
||||
std::map<rocprofiler_service_callback_tracing_kind_t, std::map<uint32_t, const char*>>;
|
||||
std::map<rocprofiler_callback_tracing_kind_t, std::map<uint32_t, const char*>>;
|
||||
|
||||
struct callback_name_info
|
||||
{
|
||||
@@ -90,7 +90,7 @@ get_callback_tracing_names()
|
||||
// callback for each kind operation
|
||||
//
|
||||
static auto tracing_kind_operation_cb =
|
||||
[](rocprofiler_service_callback_tracing_kind_t kindv, uint32_t operation, void* data_v) {
|
||||
[](rocprofiler_callback_tracing_kind_t kindv, uint32_t operation, void* data_v) {
|
||||
auto* name_info_v = static_cast<callback_name_info*>(data_v);
|
||||
|
||||
if(kindv == ROCPROFILER_CALLBACK_TRACING_HSA_API)
|
||||
@@ -107,7 +107,7 @@ get_callback_tracing_names()
|
||||
//
|
||||
// callback for each callback kind (i.e. domain)
|
||||
//
|
||||
static auto tracing_kind_cb = [](rocprofiler_service_callback_tracing_kind_t kind, void* data) {
|
||||
static auto tracing_kind_cb = [](rocprofiler_callback_tracing_kind_t kind, void* data) {
|
||||
// store the callback kind name
|
||||
auto* name_info_v = static_cast<callback_name_info*>(data);
|
||||
const char* name = nullptr;
|
||||
@@ -131,9 +131,9 @@ get_callback_tracing_names()
|
||||
return cb_name_info;
|
||||
}
|
||||
|
||||
using buffer_kind_names_t = std::map<rocprofiler_service_buffer_tracing_kind_t, const char*>;
|
||||
using buffer_kind_names_t = std::map<rocprofiler_buffer_tracing_kind_t, const char*>;
|
||||
using buffer_kind_operation_names_t =
|
||||
std::map<rocprofiler_service_buffer_tracing_kind_t, std::map<uint32_t, const char*>>;
|
||||
std::map<rocprofiler_buffer_tracing_kind_t, std::map<uint32_t, const char*>>;
|
||||
|
||||
struct buffer_name_info
|
||||
{
|
||||
@@ -149,7 +149,7 @@ get_buffer_tracing_names()
|
||||
// callback for each kind operation
|
||||
//
|
||||
static auto tracing_kind_operation_cb =
|
||||
[](rocprofiler_service_buffer_tracing_kind_t kindv, uint32_t operation, void* data_v) {
|
||||
[](rocprofiler_buffer_tracing_kind_t kindv, uint32_t operation, void* data_v) {
|
||||
auto* name_info_v = static_cast<buffer_name_info*>(data_v);
|
||||
|
||||
if(kindv == ROCPROFILER_BUFFER_TRACING_HSA_API)
|
||||
@@ -166,7 +166,7 @@ get_buffer_tracing_names()
|
||||
//
|
||||
// callback for each buffer kind (i.e. domain)
|
||||
//
|
||||
static auto tracing_kind_cb = [](rocprofiler_service_buffer_tracing_kind_t kind, void* data) {
|
||||
static auto tracing_kind_cb = [](rocprofiler_buffer_tracing_kind_t kind, void* data) {
|
||||
// store the buffer kind name
|
||||
auto* name_info_v = static_cast<buffer_name_info*>(data);
|
||||
const char* name = nullptr;
|
||||
@@ -236,7 +236,7 @@ tool_tracing_callback(rocprofiler_callback_tracing_record_t record,
|
||||
std::stringstream arg_ss = {};
|
||||
} info_data_v;
|
||||
|
||||
auto info_data_cb = [](rocprofiler_service_callback_tracing_kind_t,
|
||||
auto info_data_cb = [](rocprofiler_callback_tracing_kind_t,
|
||||
uint32_t,
|
||||
uint32_t arg_num,
|
||||
const char* arg_name,
|
||||
|
||||
In neuem Issue referenzieren
Einen Benutzer sperren