diff --git a/projects/rocprofiler-sdk/samples/api_buffered_tracing/client.cpp b/projects/rocprofiler-sdk/samples/api_buffered_tracing/client.cpp index 00d9e7c3c9..58a721edd0 100644 --- a/projects/rocprofiler-sdk/samples/api_buffered_tracing/client.cpp +++ b/projects/rocprofiler-sdk/samples/api_buffered_tracing/client.cpp @@ -150,7 +150,7 @@ get_buffer_tracing_names() [](rocprofiler_service_buffer_tracing_kind_t kindv, uint32_t operation, void* data_v) { auto* name_info_v = static_cast(data_v); - if(kindv == ROCPROFILER_SERVICE_BUFFER_TRACING_HSA_API) + if(kindv == ROCPROFILER_BUFFER_TRACING_HSA_API) { const char* name = nullptr; ROCPROFILER_CALL(rocprofiler_query_buffer_tracing_kind_operation_name( @@ -172,7 +172,7 @@ get_buffer_tracing_names() "query buffer tracing kind operation name"); if(name) name_info_v->kind_names[kind] = name; - if(kind == ROCPROFILER_SERVICE_BUFFER_TRACING_HSA_API) + if(kind == ROCPROFILER_BUFFER_TRACING_HSA_API) { ROCPROFILER_CALL(rocprofiler_iterate_buffer_tracing_kind_operations( kind, tracing_kind_operation_cb, static_cast(data)), @@ -220,7 +220,7 @@ tool_tracing_callback(rocprofiler_context_id_t context, throw std::runtime_error{"rocprofiler_record_header_t (category | kind) != hash"}; } else if(header->category == ROCPROFILER_BUFFER_CATEGORY_TRACING && - header->kind == ROCPROFILER_SERVICE_BUFFER_TRACING_HSA_API) + header->kind == ROCPROFILER_BUFFER_TRACING_HSA_API) { auto* record = static_cast(header->payload); @@ -312,10 +312,9 @@ tool_init(rocprofiler_client_finalize_t fini_func, void* tool_data) &client_buffer), "buffer creation failed"); - ROCPROFILER_CALL( - rocprofiler_configure_buffer_tracing_service( - client_ctx, ROCPROFILER_SERVICE_BUFFER_TRACING_HSA_API, nullptr, 0, client_buffer), - "buffer tracing service failed to configure"); + ROCPROFILER_CALL(rocprofiler_configure_buffer_tracing_service( + client_ctx, ROCPROFILER_BUFFER_TRACING_HSA_API, nullptr, 0, client_buffer), + "buffer tracing service failed to configure"); auto client_thread = rocprofiler_callback_thread_t{}; ROCPROFILER_CALL(rocprofiler_create_callback_thread(&client_thread), diff --git a/projects/rocprofiler-sdk/samples/api_callback_tracing/client.cpp b/projects/rocprofiler-sdk/samples/api_callback_tracing/client.cpp index f1b5823b9c..29cf00b43c 100644 --- a/projects/rocprofiler-sdk/samples/api_callback_tracing/client.cpp +++ b/projects/rocprofiler-sdk/samples/api_callback_tracing/client.cpp @@ -147,7 +147,7 @@ get_callback_id_names() [](rocprofiler_service_callback_tracing_kind_t kindv, uint32_t operation, void* data_v) { auto* name_info_v = static_cast(data_v); - if(kindv == ROCPROFILER_SERVICE_CALLBACK_TRACING_HSA_API) + if(kindv == ROCPROFILER_CALLBACK_TRACING_HSA_API) { const char* name = nullptr; ROCPROFILER_CALL(rocprofiler_query_callback_tracing_kind_operation_name( @@ -169,7 +169,7 @@ get_callback_id_names() "query callback tracing kind operation name"); if(name) name_info_v->kind_names[kind] = name; - if(kind == ROCPROFILER_SERVICE_CALLBACK_TRACING_HSA_API) + if(kind == ROCPROFILER_CALLBACK_TRACING_HSA_API) { ROCPROFILER_CALL(rocprofiler_iterate_callback_tracing_kind_operations( kind, tracing_kind_operation_cb, static_cast(data)), @@ -194,7 +194,7 @@ tool_tracing_callback(rocprofiler_callback_tracing_record_t record, auto now = std::chrono::steady_clock::now().time_since_epoch().count(); uint64_t dt = 0; - if(record.phase == ROCPROFILER_SERVICE_CALLBACK_PHASE_ENTER) + if(record.phase == ROCPROFILER_CALLBACK_PHASE_ENTER) user_data->value = now; else dt = (now - user_data->value); @@ -273,7 +273,7 @@ tool_init(rocprofiler_client_finalize_t fini_func, void* tool_data) ROCPROFILER_CALL( rocprofiler_configure_callback_tracing_service(client_ctx, - ROCPROFILER_SERVICE_CALLBACK_TRACING_HSA_API, + ROCPROFILER_CALLBACK_TRACING_HSA_API, nullptr, 0, tool_tracing_callback, diff --git a/projects/rocprofiler-sdk/source/include/rocprofiler/fwd.h b/projects/rocprofiler-sdk/source/include/rocprofiler/fwd.h index 8bc6c45fd6..12232b76f3 100644 --- a/projects/rocprofiler-sdk/source/include/rocprofiler/fwd.h +++ b/projects/rocprofiler-sdk/source/include/rocprofiler/fwd.h @@ -104,16 +104,14 @@ typedef enum // NOLINT(performance-enum-size) */ typedef enum // NOLINT(performance-enum-size) { - ROCPROFILER_SERVICE_CALLBACK_PHASE_NONE = 0, ///< Callback has no phase - ROCPROFILER_SERVICE_CALLBACK_PHASE_ENTER, ///< Callback invoked prior to function execution - ROCPROFILER_SERVICE_CALLBACK_PHASE_LOAD = - ROCPROFILER_SERVICE_CALLBACK_PHASE_ENTER, ///< Callback invoked prior to code object - ///< loading - ROCPROFILER_SERVICE_CALLBACK_PHASE_EXIT, ///< Callback invoked after to function execution - ROCPROFILER_SERVICE_CALLBACK_PHASE_UNLOAD = - ROCPROFILER_SERVICE_CALLBACK_PHASE_EXIT, ///< Callback invoked prior to code object - ///< unloading - ROCPROFILER_SERVICE_CALLBACK_PHASE_LAST, + ROCPROFILER_CALLBACK_PHASE_NONE = 0, ///< Callback has no phase + ROCPROFILER_CALLBACK_PHASE_ENTER, ///< Callback invoked prior to function execution + ROCPROFILER_CALLBACK_PHASE_LOAD = + ROCPROFILER_CALLBACK_PHASE_ENTER, ///< Callback invoked prior to code object loading + ROCPROFILER_CALLBACK_PHASE_EXIT, ///< Callback invoked after to function execution + ROCPROFILER_CALLBACK_PHASE_UNLOAD = + ROCPROFILER_CALLBACK_PHASE_EXIT, ///< Callback invoked prior to code object unloading + ROCPROFILER_CALLBACK_PHASE_LAST, } rocprofiler_service_callback_phase_t; /** @@ -121,13 +119,13 @@ typedef enum // NOLINT(performance-enum-size) */ typedef enum // NOLINT(performance-enum-size) { - ROCPROFILER_SERVICE_CALLBACK_TRACING_NONE = 0, - ROCPROFILER_SERVICE_CALLBACK_TRACING_HSA_API, ///< Callbacks for HSA functions - ROCPROFILER_SERVICE_CALLBACK_TRACING_HIP_API, ///< Callbacks for HIP functions - ROCPROFILER_SERVICE_CALLBACK_TRACING_MARKER_API, ///< Callbacks for ROCTx functions - ROCPROFILER_SERVICE_CALLBACK_TRACING_CODE_OBJECT, ///< Callbacks for code object info - ROCPROFILER_SERVICE_CALLBACK_TRACING_KERNEL_DISPATCH, ///< Callbacks for kernel dispatches - ROCPROFILER_SERVICE_CALLBACK_TRACING_LAST, + ROCPROFILER_CALLBACK_TRACING_NONE = 0, + ROCPROFILER_CALLBACK_TRACING_HSA_API, ///< Callbacks for HSA functions + ROCPROFILER_CALLBACK_TRACING_HIP_API, ///< Callbacks for HIP functions + ROCPROFILER_CALLBACK_TRACING_MARKER_API, ///< Callbacks for ROCTx functions + ROCPROFILER_CALLBACK_TRACING_CODE_OBJECT, ///< Callbacks for code object info + ROCPROFILER_CALLBACK_TRACING_KERNEL_DISPATCH, ///< Callbacks for kernel dispatches + ROCPROFILER_CALLBACK_TRACING_LAST, } rocprofiler_service_callback_tracing_kind_t; /** @@ -135,18 +133,18 @@ typedef enum // NOLINT(performance-enum-size) */ typedef enum // NOLINT(performance-enum-size) { - ROCPROFILER_SERVICE_BUFFER_TRACING_NONE = 0, - ROCPROFILER_SERVICE_BUFFER_TRACING_HSA_API, ///< Buffer HSA function calls - ROCPROFILER_SERVICE_BUFFER_TRACING_HIP_API, ///< Buffer HIP function calls - ROCPROFILER_SERVICE_BUFFER_TRACING_MARKER_API, ///< Buffer ROCTx function calls - ROCPROFILER_SERVICE_BUFFER_TRACING_MEMORY_COPY, ///< Buffer memory copy info - ROCPROFILER_SERVICE_BUFFER_TRACING_KERNEL_DISPATCH, ///< Buffer kernel dispatch info - ROCPROFILER_SERVICE_BUFFER_TRACING_PAGE_MIGRATION, ///< Buffer page migration info - ROCPROFILER_SERVICE_BUFFER_TRACING_SCRATCH_MEMORY, ///< Buffer scratch memory reclaimation info - ROCPROFILER_SERVICE_BUFFER_TRACING_EXTERNAL_CORRELATION, ///< Buffer external correlation info + ROCPROFILER_BUFFER_TRACING_NONE = 0, + ROCPROFILER_BUFFER_TRACING_HSA_API, ///< Buffer HSA function calls + ROCPROFILER_BUFFER_TRACING_HIP_API, ///< Buffer HIP function calls + ROCPROFILER_BUFFER_TRACING_MARKER_API, ///< Buffer ROCTx function calls + ROCPROFILER_BUFFER_TRACING_MEMORY_COPY, ///< Buffer memory copy info + ROCPROFILER_BUFFER_TRACING_KERNEL_DISPATCH, ///< Buffer kernel dispatch info + ROCPROFILER_BUFFER_TRACING_PAGE_MIGRATION, ///< Buffer page migration info + ROCPROFILER_BUFFER_TRACING_SCRATCH_MEMORY, ///< Buffer scratch memory reclaimation info + ROCPROFILER_BUFFER_TRACING_EXTERNAL_CORRELATION, ///< Buffer external correlation info // To determine if this is possible to implement? - // ROCPROFILER_SERVICE_BUFFER_TRACING_QUEUE_SCHEDULING, - ROCPROFILER_SERVICE_BUFFER_TRACING_LAST, + // ROCPROFILER_BUFFER_TRACING_QUEUE_SCHEDULING, + ROCPROFILER_BUFFER_TRACING_LAST, } rocprofiler_service_buffer_tracing_kind_t; /** @@ -356,7 +354,7 @@ typedef struct rocprofiler_callback_tracing_record_t * rocprofiler_record_header_t* header = headers[i]; * * if(header->category == ROCPROFILER_BUFFER_CATEGORY_TRACING && - * header->kind == ROCPROFILER_SERVICE_BUFFER_TRACING_HSA_API) + * header->kind == ROCPROFILER_BUFFER_TRACING_HSA_API) * { * // cast to rocprofiler_buffer_tracing_hsa_api_record_t which * // is type associated with this category + kind diff --git a/projects/rocprofiler-sdk/source/lib/rocprofiler/buffer_tracing.cpp b/projects/rocprofiler-sdk/source/lib/rocprofiler/buffer_tracing.cpp index 7b5000c92e..fc6b0f4c9d 100644 --- a/projects/rocprofiler-sdk/source/lib/rocprofiler/buffer_tracing.cpp +++ b/projects/rocprofiler-sdk/source/lib/rocprofiler/buffer_tracing.cpp @@ -48,7 +48,7 @@ namespace { #define ROCPROFILER_BUFFER_TRACING_KIND_STRING(CODE) \ template <> \ - struct buffer_tracing_kind_string \ + struct buffer_tracing_kind_string \ { \ static constexpr auto value = \ std::pair{#CODE, std::string_view{#CODE}.length()}; \ @@ -131,7 +131,7 @@ rocprofiler_query_buffer_tracing_kind_name(rocprofiler_service_buffer_tracing_ki uint64_t* name_len) { auto&& val = rocprofiler::buffer_tracing::get_kind_name( - kind, std::make_index_sequence{}); + kind, std::make_index_sequence{}); if(name) *name = val.first; if(name_len) *name_len = val.second; @@ -145,11 +145,10 @@ rocprofiler_query_buffer_tracing_kind_operation_name(rocprofiler_service_buffer_ const char** name, uint64_t* name_len) { - if(kind < ROCPROFILER_SERVICE_BUFFER_TRACING_NONE || - kind >= ROCPROFILER_SERVICE_BUFFER_TRACING_LAST) + if(kind < ROCPROFILER_BUFFER_TRACING_NONE || kind >= ROCPROFILER_BUFFER_TRACING_LAST) return ROCPROFILER_STATUS_ERROR_KIND_NOT_FOUND; - if(kind == ROCPROFILER_SERVICE_BUFFER_TRACING_HSA_API) + if(kind == ROCPROFILER_BUFFER_TRACING_HSA_API) { const auto* val = rocprofiler::hsa::name_by_id(operation); @@ -173,7 +172,7 @@ rocprofiler_query_buffer_tracing_kind_operation_name(rocprofiler_service_buffer_ rocprofiler_status_t rocprofiler_iterate_buffer_tracing_kinds(rocprofiler_buffer_tracing_kind_cb_t callback, void* data) { - for(uint32_t i = 0; i < ROCPROFILER_SERVICE_BUFFER_TRACING_LAST; ++i) + for(uint32_t i = 0; i < ROCPROFILER_BUFFER_TRACING_LAST; ++i) { auto _success = callback(static_cast(i), data); if(_success != 0) break; @@ -188,7 +187,7 @@ rocprofiler_iterate_buffer_tracing_kind_operations( rocprofiler_buffer_tracing_kind_operation_cb_t callback, void* data) { - if(kind == ROCPROFILER_SERVICE_BUFFER_TRACING_HSA_API) + if(kind == ROCPROFILER_BUFFER_TRACING_HSA_API) { auto ops = rocprofiler::hsa::get_ids(); for(const auto& itr : ops) diff --git a/projects/rocprofiler-sdk/source/lib/rocprofiler/callback_tracing.cpp b/projects/rocprofiler-sdk/source/lib/rocprofiler/callback_tracing.cpp index 440e104079..79619b43a1 100644 --- a/projects/rocprofiler-sdk/source/lib/rocprofiler/callback_tracing.cpp +++ b/projects/rocprofiler-sdk/source/lib/rocprofiler/callback_tracing.cpp @@ -47,7 +47,7 @@ namespace { #define ROCPROFILER_CALLBACK_TRACING_KIND_STRING(CODE) \ template <> \ - struct callback_tracing_kind_string \ + struct callback_tracing_kind_string \ { \ static constexpr auto value = \ std::pair{#CODE, std::string_view{#CODE}.length()}; \ @@ -122,7 +122,7 @@ rocprofiler_query_callback_tracing_kind_name(rocprofiler_service_callback_tracin uint64_t* name_len) { auto&& val = rocprofiler::callback_tracing::get_kind_name( - kind, std::make_index_sequence{}); + kind, std::make_index_sequence{}); if(name) *name = val.first; if(name_len) *name_len = val.second; @@ -137,11 +137,10 @@ rocprofiler_query_callback_tracing_kind_operation_name( const char** name, uint64_t* name_len) { - if(kind < ROCPROFILER_SERVICE_CALLBACK_TRACING_NONE || - kind >= ROCPROFILER_SERVICE_CALLBACK_TRACING_LAST) + if(kind < ROCPROFILER_CALLBACK_TRACING_NONE || kind >= ROCPROFILER_CALLBACK_TRACING_LAST) return ROCPROFILER_STATUS_ERROR_KIND_NOT_FOUND; - if(kind == ROCPROFILER_SERVICE_CALLBACK_TRACING_HSA_API) + if(kind == ROCPROFILER_CALLBACK_TRACING_HSA_API) { const auto* val = rocprofiler::hsa::name_by_id(operation); @@ -166,7 +165,7 @@ rocprofiler_status_t rocprofiler_iterate_callback_tracing_kinds(rocprofiler_callback_tracing_kind_cb_t callback, void* data) { - for(uint32_t i = 0; i < ROCPROFILER_SERVICE_CALLBACK_TRACING_LAST; ++i) + for(uint32_t i = 0; i < ROCPROFILER_CALLBACK_TRACING_LAST; ++i) { auto _success = callback(static_cast(i), data); if(_success != 0) break; @@ -181,7 +180,7 @@ rocprofiler_iterate_callback_tracing_kind_operations( rocprofiler_callback_tracing_kind_operation_cb_t callback, void* data) { - if(kind == ROCPROFILER_SERVICE_CALLBACK_TRACING_HSA_API) + if(kind == ROCPROFILER_CALLBACK_TRACING_HSA_API) { auto ops = rocprofiler::hsa::get_ids(); for(const auto& itr : ops) @@ -201,7 +200,7 @@ rocprofiler_iterate_callback_tracing_kind_operation_args( rocprofiler_callback_tracing_operation_args_cb_t callback, void* user_data) { - if(record.kind == ROCPROFILER_SERVICE_CALLBACK_TRACING_HSA_API) + if(record.kind == ROCPROFILER_CALLBACK_TRACING_HSA_API) { rocprofiler::hsa::iterate_args( record.operation, diff --git a/projects/rocprofiler-sdk/source/lib/rocprofiler/context/domain.hpp b/projects/rocprofiler-sdk/source/lib/rocprofiler/context/domain.hpp index 9c4c451a75..d1dfae5f30 100644 --- a/projects/rocprofiler-sdk/source/lib/rocprofiler/context/domain.hpp +++ b/projects/rocprofiler-sdk/source/lib/rocprofiler/context/domain.hpp @@ -43,16 +43,16 @@ struct domain_info; template <> struct domain_info { - static constexpr size_t none = ROCPROFILER_SERVICE_CALLBACK_TRACING_NONE; - static constexpr size_t last = ROCPROFILER_SERVICE_CALLBACK_TRACING_LAST; + static constexpr size_t none = ROCPROFILER_CALLBACK_TRACING_NONE; + static constexpr size_t last = ROCPROFILER_CALLBACK_TRACING_LAST; static constexpr auto padding = domain_ops_padding; }; template <> struct domain_info { - static constexpr size_t none = ROCPROFILER_SERVICE_BUFFER_TRACING_NONE; - static constexpr size_t last = ROCPROFILER_SERVICE_BUFFER_TRACING_LAST; + static constexpr size_t none = ROCPROFILER_BUFFER_TRACING_NONE; + static constexpr size_t last = ROCPROFILER_BUFFER_TRACING_LAST; static constexpr auto padding = domain_ops_padding; }; diff --git a/projects/rocprofiler-sdk/source/lib/rocprofiler/hsa/defines.hpp b/projects/rocprofiler-sdk/source/lib/rocprofiler/hsa/defines.hpp index 2f6a4df6bc..ba933f58f2 100644 --- a/projects/rocprofiler-sdk/source/lib/rocprofiler/hsa/defines.hpp +++ b/projects/rocprofiler-sdk/source/lib/rocprofiler/hsa/defines.hpp @@ -88,8 +88,8 @@ template <> \ struct hsa_api_info \ { \ - static constexpr auto callback_domain_idx = ROCPROFILER_SERVICE_CALLBACK_TRACING_HSA_API; \ - static constexpr auto buffered_domain_idx = ROCPROFILER_SERVICE_BUFFER_TRACING_HSA_API; \ + static constexpr auto callback_domain_idx = ROCPROFILER_CALLBACK_TRACING_HSA_API; \ + static constexpr auto buffered_domain_idx = ROCPROFILER_BUFFER_TRACING_HSA_API; \ static constexpr auto table_idx = HSA_TABLE; \ static constexpr auto operation_idx = HSA_API_ID; \ static constexpr auto name = #HSA_FUNC; \ @@ -160,8 +160,8 @@ template <> \ struct hsa_api_info \ { \ - static constexpr auto callback_domain_idx = ROCPROFILER_SERVICE_CALLBACK_TRACING_HSA_API; \ - static constexpr auto buffered_domain_idx = ROCPROFILER_SERVICE_BUFFER_TRACING_HSA_API; \ + static constexpr auto callback_domain_idx = ROCPROFILER_CALLBACK_TRACING_HSA_API; \ + static constexpr auto buffered_domain_idx = ROCPROFILER_BUFFER_TRACING_HSA_API; \ static constexpr auto table_idx = HSA_TABLE; \ static constexpr auto operation_idx = HSA_API_ID; \ static constexpr auto name = #HSA_FUNC; \ diff --git a/projects/rocprofiler-sdk/source/lib/rocprofiler/hsa/hsa.cpp b/projects/rocprofiler-sdk/source/lib/rocprofiler/hsa/hsa.cpp index 3811f518b7..4049718608 100644 --- a/projects/rocprofiler-sdk/source/lib/rocprofiler/hsa/hsa.cpp +++ b/projects/rocprofiler-sdk/source/lib/rocprofiler/hsa/hsa.cpp @@ -263,7 +263,7 @@ hsa_api_impl::functor(Args&&... args) corr_id, info_type::callback_domain_idx, info_type::operation_idx, - ROCPROFILER_SERVICE_CALLBACK_PHASE_ENTER, + ROCPROFILER_CALLBACK_PHASE_ENTER, static_cast(&tracer_data)}; auto& callback_info = @@ -305,7 +305,7 @@ hsa_api_impl::functor(Args&&... args) auto& record = itr.record; auto& user_data = itr.user_data; - record.phase = ROCPROFILER_SERVICE_CALLBACK_PHASE_EXIT; + record.phase = ROCPROFILER_CALLBACK_PHASE_EXIT; record.payload = static_cast(&tracer_data); auto& callback_info = diff --git a/projects/rocprofiler-sdk/source/lib/rocprofiler/hsa/queue_controller.cpp b/projects/rocprofiler-sdk/source/lib/rocprofiler/hsa/queue_controller.cpp index eba0fa9be5..613782f32d 100644 --- a/projects/rocprofiler-sdk/source/lib/rocprofiler/hsa/queue_controller.cpp +++ b/projects/rocprofiler-sdk/source/lib/rocprofiler/hsa/queue_controller.cpp @@ -172,8 +172,8 @@ QueueController::init(CoreApiTable& core_table, AmdExtTable& ext_table) } else if(itr->buffered_tracer) { - if(itr->buffered_tracer->domains(ROCPROFILER_SERVICE_BUFFER_TRACING_KERNEL_DISPATCH) || - itr->buffered_tracer->domains(ROCPROFILER_SERVICE_BUFFER_TRACING_MEMORY_COPY)) + if(itr->buffered_tracer->domains(ROCPROFILER_BUFFER_TRACING_KERNEL_DISPATCH) || + itr->buffered_tracer->domains(ROCPROFILER_BUFFER_TRACING_MEMORY_COPY)) { enable_intercepter = true; break; diff --git a/projects/rocprofiler-sdk/source/lib/rocprofiler/tests/external_correlation.cpp b/projects/rocprofiler-sdk/source/lib/rocprofiler/tests/external_correlation.cpp index fc9f8e5a4a..5869607c70 100644 --- a/projects/rocprofiler-sdk/source/lib/rocprofiler/tests/external_correlation.cpp +++ b/projects/rocprofiler-sdk/source/lib/rocprofiler/tests/external_correlation.cpp @@ -93,10 +93,10 @@ tool_tracing_callback(rocprofiler_callback_tracing_record_t record, cb_data->client_callback_count++; static auto first = std::once_flag{}; - std::call_once( - first, [record]() { EXPECT_EQ(record.phase, ROCPROFILER_SERVICE_CALLBACK_PHASE_ENTER); }); + std::call_once(first, + [record]() { EXPECT_EQ(record.phase, ROCPROFILER_CALLBACK_PHASE_ENTER); }); - if(record.phase == ROCPROFILER_SERVICE_CALLBACK_PHASE_ENTER) + if(record.phase == ROCPROFILER_CALLBACK_PHASE_ENTER) { EXPECT_EQ(cb_data->client_correlation.find(internal_corr_id), cb_data->client_correlation.end()) @@ -169,7 +169,7 @@ tool_tracing_buffered(rocprofiler_context_id_t context, auto hash = rocprofiler_record_header_compute_hash(header->category, header->kind); EXPECT_EQ(header->hash, hash); EXPECT_TRUE(header->category == ROCPROFILER_BUFFER_CATEGORY_TRACING && - header->kind == ROCPROFILER_SERVICE_BUFFER_TRACING_HSA_API); + header->kind == ROCPROFILER_BUFFER_TRACING_HSA_API); v_records.emplace_back( static_cast(header->payload)); @@ -242,14 +242,14 @@ TEST(rocprofiler_lib, callback_external_correlation) ROCPROFILER_CALL(rocprofiler_create_context(&cb_data->client_ctx), "failed to create context"); - ROCPROFILER_CALL(rocprofiler_configure_callback_tracing_service( - cb_data->client_ctx, - ROCPROFILER_SERVICE_CALLBACK_TRACING_HSA_API, - nullptr, - 0, - tool_tracing_callback, - client_data), - "callback tracing service failed to configure"); + ROCPROFILER_CALL( + rocprofiler_configure_callback_tracing_service(cb_data->client_ctx, + ROCPROFILER_CALLBACK_TRACING_HSA_API, + nullptr, + 0, + tool_tracing_callback, + client_data), + "callback tracing service failed to configure"); int valid_ctx = 0; ROCPROFILER_CALL(rocprofiler_context_is_valid(cb_data->client_ctx, &valid_ctx), @@ -392,7 +392,7 @@ TEST(rocprofiler_lib, buffered_external_correlation) ROCPROFILER_CALL( rocprofiler_configure_buffer_tracing_service(cb_data->client_ctx, - ROCPROFILER_SERVICE_BUFFER_TRACING_HSA_API, + ROCPROFILER_BUFFER_TRACING_HSA_API, nullptr, 0, cb_data->client_buffer), diff --git a/projects/rocprofiler-sdk/source/lib/rocprofiler/tests/registration.cpp b/projects/rocprofiler-sdk/source/lib/rocprofiler/tests/registration.cpp index 75e498ad02..3b1d6ca1c4 100644 --- a/projects/rocprofiler-sdk/source/lib/rocprofiler/tests/registration.cpp +++ b/projects/rocprofiler-sdk/source/lib/rocprofiler/tests/registration.cpp @@ -92,7 +92,7 @@ get_callback_tracing_names() [](rocprofiler_service_callback_tracing_kind_t kindv, uint32_t operation, void* data_v) { auto* name_info_v = static_cast(data_v); - if(kindv == ROCPROFILER_SERVICE_CALLBACK_TRACING_HSA_API) + if(kindv == ROCPROFILER_CALLBACK_TRACING_HSA_API) { const char* name = nullptr; ROCPROFILER_CALL(rocprofiler_query_callback_tracing_kind_operation_name( @@ -114,7 +114,7 @@ get_callback_tracing_names() "query callback tracing kind operation name"); if(name) name_info_v->kind_names[kind] = name; - if(kind == ROCPROFILER_SERVICE_CALLBACK_TRACING_HSA_API) + if(kind == ROCPROFILER_CALLBACK_TRACING_HSA_API) { ROCPROFILER_CALL(rocprofiler_iterate_callback_tracing_kind_operations( kind, tracing_kind_operation_cb, static_cast(data)), @@ -151,7 +151,7 @@ get_buffer_tracing_names() [](rocprofiler_service_buffer_tracing_kind_t kindv, uint32_t operation, void* data_v) { auto* name_info_v = static_cast(data_v); - if(kindv == ROCPROFILER_SERVICE_BUFFER_TRACING_HSA_API) + if(kindv == ROCPROFILER_BUFFER_TRACING_HSA_API) { const char* name = nullptr; ROCPROFILER_CALL(rocprofiler_query_buffer_tracing_kind_operation_name( @@ -173,7 +173,7 @@ get_buffer_tracing_names() "query buffer tracing kind operation name"); if(name) name_info_v->kind_names[kind] = name; - if(kind == ROCPROFILER_SERVICE_BUFFER_TRACING_HSA_API) + if(kind == ROCPROFILER_BUFFER_TRACING_HSA_API) { ROCPROFILER_CALL(rocprofiler_iterate_buffer_tracing_kind_operations( kind, tracing_kind_operation_cb, static_cast(data)), @@ -199,15 +199,15 @@ tool_tracing_callback(rocprofiler_callback_tracing_record_t record, return std::chrono::steady_clock::now().time_since_epoch().count(); }; - if(record.phase == ROCPROFILER_SERVICE_CALLBACK_PHASE_ENTER && cb_data->current_depth == 0) + if(record.phase == ROCPROFILER_CALLBACK_PHASE_ENTER && cb_data->current_depth == 0) { user_data->value = get_timestamp(); } static auto name_map = get_callback_tracing_names(); - EXPECT_EQ(name_map.kind_names.size(), ROCPROFILER_SERVICE_CALLBACK_TRACING_LAST); - EXPECT_EQ(name_map.operation_names.at(ROCPROFILER_SERVICE_CALLBACK_TRACING_HSA_API).size(), + EXPECT_EQ(name_map.kind_names.size(), ROCPROFILER_CALLBACK_TRACING_LAST); + EXPECT_EQ(name_map.operation_names.at(ROCPROFILER_CALLBACK_TRACING_HSA_API).size(), ROCPROFILER_HSA_API_ID_LAST); std::cout << "[" << __FILE__ << ":" << __LINE__ << "] " @@ -215,11 +215,11 @@ tool_tracing_callback(rocprofiler_callback_tracing_record_t record, << std::flush; cb_data->client_callback_count++; - if(record.phase == ROCPROFILER_SERVICE_CALLBACK_PHASE_ENTER) + if(record.phase == ROCPROFILER_CALLBACK_PHASE_ENTER) { cb_data->current_depth++; } - else if(record.phase == ROCPROFILER_SERVICE_CALLBACK_PHASE_EXIT) + else if(record.phase == ROCPROFILER_CALLBACK_PHASE_EXIT) { cb_data->max_depth = std::max(cb_data->current_depth, cb_data->max_depth); cb_data->current_depth--; @@ -256,7 +256,7 @@ tool_tracing_callback(rocprofiler_callback_tracing_record_t record, ROCPROFILER_CALL(rocprofiler_iterate_callback_tracing_kind_operation_args( record, info_data_cb, static_cast(&info_data_v)), "Failure iterating trace operation args"); - if(record.kind == ROCPROFILER_SERVICE_CALLBACK_TRACING_HSA_API && + if(record.kind == ROCPROFILER_CALLBACK_TRACING_HSA_API && !(record.operation == ROCPROFILER_HSA_API_ID_hsa_init || record.operation == ROCPROFILER_HSA_API_ID_hsa_shut_down)) { @@ -264,7 +264,7 @@ tool_tracing_callback(rocprofiler_callback_tracing_record_t record, << name_map.operation_names[record.kind][record.operation] << info_data_v.arg_ss.str(); } - if(record.phase == ROCPROFILER_SERVICE_CALLBACK_PHASE_EXIT && cb_data->current_depth == 0) + if(record.phase == ROCPROFILER_CALLBACK_PHASE_EXIT && cb_data->current_depth == 0) { cb_data->client_elapsed += (get_timestamp() - user_data->value); } @@ -282,8 +282,8 @@ tool_tracing_buffered(rocprofiler_context_id_t context, static auto name_map = get_buffer_tracing_names(); - EXPECT_EQ(name_map.kind_names.size(), ROCPROFILER_SERVICE_BUFFER_TRACING_LAST); - EXPECT_EQ(name_map.operation_names.at(ROCPROFILER_SERVICE_BUFFER_TRACING_HSA_API).size(), + EXPECT_EQ(name_map.kind_names.size(), ROCPROFILER_BUFFER_TRACING_LAST); + EXPECT_EQ(name_map.operation_names.at(ROCPROFILER_BUFFER_TRACING_HSA_API).size(), ROCPROFILER_HSA_API_ID_LAST); auto v_records = std::vector{}; @@ -297,7 +297,7 @@ tool_tracing_buffered(rocprofiler_context_id_t context, auto hash = rocprofiler_record_header_compute_hash(header->category, header->kind); EXPECT_EQ(header->hash, hash); EXPECT_TRUE(header->category == ROCPROFILER_BUFFER_CATEGORY_TRACING && - header->kind == ROCPROFILER_SERVICE_BUFFER_TRACING_HSA_API); + header->kind == ROCPROFILER_BUFFER_TRACING_HSA_API); v_records.emplace_back( static_cast(header->payload)); @@ -393,14 +393,14 @@ TEST(rocprofiler_lib, callback_registration_lambda_with_result) ROCPROFILER_CALL(rocprofiler_create_context(&cb_data->client_ctx), "failed to create context"); - ROCPROFILER_CALL(rocprofiler_configure_callback_tracing_service( - cb_data->client_ctx, - ROCPROFILER_SERVICE_CALLBACK_TRACING_HSA_API, - nullptr, - 0, - tool_tracing_callback, - client_data), - "callback tracing service failed to configure"); + ROCPROFILER_CALL( + rocprofiler_configure_callback_tracing_service(cb_data->client_ctx, + ROCPROFILER_CALLBACK_TRACING_HSA_API, + nullptr, + 0, + tool_tracing_callback, + client_data), + "callback tracing service failed to configure"); int valid_ctx = 0; ROCPROFILER_CALL(rocprofiler_context_is_valid(cb_data->client_ctx, &valid_ctx), @@ -533,7 +533,7 @@ TEST(rocprofiler_lib, buffer_registration_lambda_with_result) ROCPROFILER_CALL( rocprofiler_configure_buffer_tracing_service(cb_data->client_ctx, - ROCPROFILER_SERVICE_BUFFER_TRACING_HSA_API, + ROCPROFILER_BUFFER_TRACING_HSA_API, nullptr, 0, cb_data->client_buffer),