26#if !defined(ROCPROFILER_SDK_CXX_NAME_INFO_HPP_)
27# include <rocprofiler-sdk/cxx/name_info.hpp>
30#include <rocprofiler-sdk/buffer_tracing.h>
31#include <rocprofiler-sdk/callback_tracing.h>
32#include <rocprofiler-sdk/fwd.h>
44template <
typename EnumT,
typename ValueT>
45typename name_info_impl<EnumT, ValueT>::item_array_t
46name_info_impl<EnumT, ValueT>::items()
const
48 auto ret = item_array_t{};
49 ret.reserve(operations.size());
51 for(
const auto& itr : operations)
52 ret.emplace_back(_idx++, &itr);
56template <
typename EnumT,
typename ValueT>
58name_info<EnumT, ValueT>::emplace(EnumT idx,
const char* name)
60 impl.resize(idx + 1, value_type{});
61 impl.at(idx).value = idx;
62 impl.at(idx).name = support_type{}(name);
65template <
typename EnumT,
typename ValueT>
67name_info<EnumT, ValueT>::emplace(EnumT idx,
71 impl.resize(idx + 1, value_type{});
72 impl.at(idx).operations.resize(opidx + 1, support_type::default_value());
73 impl.at(idx).operations.at(opidx) = support_type{}(name);
76template <
typename EnumT,
typename ValueT>
77typename name_info<EnumT, ValueT>::return_type
78name_info<EnumT, ValueT>::at(EnumT idx)
const
80 return impl.at(idx).name;
83template <
typename EnumT,
typename ValueT>
84typename name_info<EnumT, ValueT>::return_type
87 return impl.at(idx).operations.at(opidx);
90template <
typename EnumT,
typename ValueT>
91typename name_info<EnumT, ValueT>::item_array_t
92name_info<EnumT, ValueT>::items()
const
94 auto ret = item_array_t{};
95 ret.reserve(impl.size());
96 for(
const auto& itr : impl)
97 ret.emplace_back(&itr);
104template <
typename Tp>
105inline callback_name_info_t<Tp>
106get_callback_tracing_names()
108 auto cb_name_info = callback_name_info_t<Tp>{};
115 auto* name_info_v =
static_cast<callback_name_info_t<Tp>*
>(data_v);
117 const char* name =
nullptr;
119 kindv, operation, &name,
nullptr);
120 if(status == success_v && name) name_info_v->emplace(kindv, operation, name);
129 auto* name_info_v =
static_cast<callback_name_info_t<Tp>*
>(data);
130 const char* name =
nullptr;
132 if(status == success_v && name) name_info_v->emplace(kind, name);
143template <
typename Tp>
144inline buffer_name_info_t<Tp>
145get_buffer_tracing_names()
147 auto cb_name_info = buffer_name_info_t<Tp>{};
154 auto* name_info_v =
static_cast<buffer_name_info_t<Tp>*
>(data_v);
156 const char* name =
nullptr;
159 if(status == success_v && name) name_info_v->emplace(kindv, operation, name);
168 auto* name_info_v =
static_cast<buffer_name_info_t<Tp>*
>(data);
169 const char* name =
nullptr;
171 if(status == success_v && name) name_info_v->emplace(kind, name);
int32_t rocprofiler_tracing_operation_t
Tracing Operation ID. Depending on the kind, operations can be determined. If the value is equal to z...
rocprofiler_buffer_tracing_kind_t
Service Buffer Tracing Kind.
rocprofiler_callback_tracing_kind_t
Service Callback Tracing Kind.
@ ROCPROFILER_STATUS_SUCCESS
No error occurred.
rocprofiler_status_t rocprofiler_iterate_buffer_tracing_kinds(rocprofiler_buffer_tracing_kind_cb_t callback, void *data)
Iterate over all the buffer tracing kinds and invokes the callback for each buffer tracing kind.
rocprofiler_status_t rocprofiler_query_buffer_tracing_kind_name(rocprofiler_buffer_tracing_kind_t kind, const char **name, uint64_t *name_len)
Query the name of the buffer tracing kind. The name retrieved from this function is a string literal ...
rocprofiler_status_t rocprofiler_query_buffer_tracing_kind_operation_name(rocprofiler_buffer_tracing_kind_t kind, rocprofiler_tracing_operation_t operation, const char **name, uint64_t *name_len)
Query the name of the buffer tracing kind. The name retrieved from this function is a string literal ...
rocprofiler_status_t rocprofiler_iterate_buffer_tracing_kind_operations(rocprofiler_buffer_tracing_kind_t kind, rocprofiler_buffer_tracing_kind_operation_cb_t callback, void *data)
Iterates over all the operations for a given rocprofiler_buffer_tracing_kind_t and invokes the callba...
rocprofiler_status_t rocprofiler_query_callback_tracing_kind_operation_name(rocprofiler_callback_tracing_kind_t kind, rocprofiler_tracing_operation_t operation, const char **name, uint64_t *name_len)
Query the name of the callback tracing kind. The name retrieved from this function is a string litera...
rocprofiler_status_t rocprofiler_query_callback_tracing_kind_name(rocprofiler_callback_tracing_kind_t kind, const char **name, uint64_t *name_len)
Query the name of the callback tracing kind. The name retrieved from this function is a string litera...
rocprofiler_status_t rocprofiler_iterate_callback_tracing_kind_operations(rocprofiler_callback_tracing_kind_t kind, rocprofiler_callback_tracing_kind_operation_cb_t callback, void *data)
Iterates over all the mappings of the operations for a given rocprofiler_callback_tracing_kind_t and ...
rocprofiler_status_t rocprofiler_iterate_callback_tracing_kinds(rocprofiler_callback_tracing_kind_cb_t callback, void *data)
Iterate over all the mappings of the callback tracing kinds and get a callback for each kind.