diff --git a/samples/advanced_thread_trace/client.cpp b/samples/advanced_thread_trace/client.cpp index ee4b787b..c35991ec 100644 --- a/samples/advanced_thread_trace/client.cpp +++ b/samples/advanced_thread_trace/client.cpp @@ -37,7 +37,7 @@ #include #include #include -#include +#include #include #include "common/defines.hpp" @@ -106,9 +106,9 @@ namespace client using code_obj_load_data_t = rocprofiler_callback_tracing_code_object_load_data_t; using kernel_symbol_data_t = rocprofiler_callback_tracing_code_object_kernel_symbol_register_data_t; -using Instruction = rocprofiler::codeobj::disassembly::Instruction; -using CodeobjAddressTranslate = rocprofiler::codeobj::disassembly::CodeobjAddressTranslate; -using SymbolInfo = rocprofiler::codeobj::disassembly::SymbolInfo; +using Instruction = rocprofiler::sdk::codeobj::disassembly::Instruction; +using CodeobjAddressTranslate = rocprofiler::sdk::codeobj::disassembly::CodeobjAddressTranslate; +using SymbolInfo = rocprofiler::sdk::codeobj::disassembly::SymbolInfo; rocprofiler_client_id_t* client_id = nullptr; rocprofiler_context_id_t client_ctx = {}; diff --git a/samples/code_object_isa_decode/client.cpp b/samples/code_object_isa_decode/client.cpp index 255bbd85..3f3d176f 100644 --- a/samples/code_object_isa_decode/client.cpp +++ b/samples/code_object_isa_decode/client.cpp @@ -38,7 +38,7 @@ #include #include #include -#include +#include #include "common/defines.hpp" #include "common/filesystem.hpp" @@ -90,8 +90,8 @@ using code_obj_load_data_t = rocprofiler_callback_tracing_code_object_load_data_ using kernel_symbol_data_t = rocprofiler_callback_tracing_code_object_kernel_symbol_register_data_t; using kernel_symbol_map_t = std::unordered_map>; -using Instruction = rocprofiler::codeobj::disassembly::Instruction; -using CodeobjAddressTranslate = rocprofiler::codeobj::disassembly::CodeobjAddressTranslate; +using Instruction = rocprofiler::sdk::codeobj::disassembly::Instruction; +using CodeobjAddressTranslate = rocprofiler::sdk::codeobj::disassembly::CodeobjAddressTranslate; rocprofiler_client_id_t* client_id = nullptr; rocprofiler_client_finalize_t client_fini_func = nullptr; diff --git a/source/include/rocprofiler-sdk/amd_detail/CMakeLists.txt b/source/include/rocprofiler-sdk/amd_detail/CMakeLists.txt index 1e0bdd70..8d00d134 100644 --- a/source/include/rocprofiler-sdk/amd_detail/CMakeLists.txt +++ b/source/include/rocprofiler-sdk/amd_detail/CMakeLists.txt @@ -10,5 +10,3 @@ install( FILES ${ROCPROFILER_AMD_DETAIL_HEADER_FILES} DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}/rocprofiler-sdk/amd_detail/ COMPONENT development) - -add_subdirectory(rocprofiler-sdk-codeobj) diff --git a/source/include/rocprofiler-sdk/amd_detail/rocprofiler-sdk-codeobj/CMakeLists.txt b/source/include/rocprofiler-sdk/amd_detail/rocprofiler-sdk-codeobj/CMakeLists.txt deleted file mode 100644 index a997a7d0..00000000 --- a/source/include/rocprofiler-sdk/amd_detail/rocprofiler-sdk-codeobj/CMakeLists.txt +++ /dev/null @@ -1,25 +0,0 @@ -# ############################################################################## -# # Copyright (c) 2024 Advanced Micro Devices, Inc. # # Permission is hereby -# granted, free of charge, to any person obtaining a copy # of this software and -# associated documentation files (the "Software"), to # deal in the Software -# without restriction, including without limitation the # rights to use, copy, -# modify, merge, publish, distribute, sublicense, and/or # sell copies of the -# Software, and to permit persons to whom the Software is # furnished to do so, -# subject to the following conditions: # # The above copyright notice and this -# permission notice shall be included in # all copies or substantial portions of -# the Software. # # THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY -# KIND, EXPRESS OR # IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -# MERCHANTABILITY, # FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO -# EVENT SHALL THE # AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, -# DAMAGES OR OTHER # LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR -# OTHERWISE, ARISING # FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE -# USE OR OTHER DEALINGS # IN THE SOFTWARE. -# ############################################################################## - -set(CODEOBJ_PARSER_HEADERS code_printing.hpp disassembly.hpp segment.hpp) - -install( - FILES ${CODEOBJ_PARSER_HEADERS} - DESTINATION - ${CMAKE_INSTALL_INCLUDEDIR}/rocprofiler-sdk/amd_detail/rocprofiler-sdk-codeobj - COMPONENT development) diff --git a/source/include/rocprofiler-sdk/cxx/CMakeLists.txt b/source/include/rocprofiler-sdk/cxx/CMakeLists.txt index da9ddc76..0360b725 100644 --- a/source/include/rocprofiler-sdk/cxx/CMakeLists.txt +++ b/source/include/rocprofiler-sdk/cxx/CMakeLists.txt @@ -11,4 +11,5 @@ install( DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}/rocprofiler-sdk/cxx COMPONENT development) +add_subdirectory(codeobj) add_subdirectory(details) diff --git a/source/include/rocprofiler-sdk/cxx/codeobj/CMakeLists.txt b/source/include/rocprofiler-sdk/cxx/codeobj/CMakeLists.txt new file mode 100644 index 00000000..96473009 --- /dev/null +++ b/source/include/rocprofiler-sdk/cxx/codeobj/CMakeLists.txt @@ -0,0 +1,6 @@ +set(ROCPROFILER_CXX_CODEOBJ_HEADERS code_printing.hpp disassembly.hpp segment.hpp) + +install( + FILES ${ROCPROFILER_CXX_CODEOBJ_HEADERS} + DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}/rocprofiler-sdk/cxx/codeobj + COMPONENT development) diff --git a/source/include/rocprofiler-sdk/amd_detail/rocprofiler-sdk-codeobj/code_printing.hpp b/source/include/rocprofiler-sdk/cxx/codeobj/code_printing.hpp similarity index 99% rename from source/include/rocprofiler-sdk/amd_detail/rocprofiler-sdk-codeobj/code_printing.hpp rename to source/include/rocprofiler-sdk/cxx/codeobj/code_printing.hpp index 6beead3b..575544d6 100644 --- a/source/include/rocprofiler-sdk/amd_detail/rocprofiler-sdk-codeobj/code_printing.hpp +++ b/source/include/rocprofiler-sdk/cxx/codeobj/code_printing.hpp @@ -40,6 +40,8 @@ namespace rocprofiler { +namespace sdk +{ namespace codeobj { namespace disassembly @@ -423,4 +425,5 @@ class CodeobjAddressTranslate : public CodeobjMap } // namespace disassembly } // namespace codeobj +} // namespace sdk } // namespace rocprofiler diff --git a/source/include/rocprofiler-sdk/amd_detail/rocprofiler-sdk-codeobj/disassembly.hpp b/source/include/rocprofiler-sdk/cxx/codeobj/disassembly.hpp similarity index 99% rename from source/include/rocprofiler-sdk/amd_detail/rocprofiler-sdk-codeobj/disassembly.hpp rename to source/include/rocprofiler-sdk/cxx/codeobj/disassembly.hpp index 019cc7a7..ea7f9a63 100644 --- a/source/include/rocprofiler-sdk/amd_detail/rocprofiler-sdk-codeobj/disassembly.hpp +++ b/source/include/rocprofiler-sdk/cxx/codeobj/disassembly.hpp @@ -70,6 +70,8 @@ namespace rocprofiler { +namespace sdk +{ namespace codeobj { namespace disassembly @@ -333,4 +335,5 @@ class DisassemblyInstance } // namespace disassembly } // namespace codeobj +} // namespace sdk } // namespace rocprofiler diff --git a/source/include/rocprofiler-sdk/amd_detail/rocprofiler-sdk-codeobj/segment.hpp b/source/include/rocprofiler-sdk/cxx/codeobj/segment.hpp similarity index 98% rename from source/include/rocprofiler-sdk/amd_detail/rocprofiler-sdk-codeobj/segment.hpp rename to source/include/rocprofiler-sdk/cxx/codeobj/segment.hpp index bcc188f6..5a4ef6fd 100644 --- a/source/include/rocprofiler-sdk/amd_detail/rocprofiler-sdk-codeobj/segment.hpp +++ b/source/include/rocprofiler-sdk/cxx/codeobj/segment.hpp @@ -31,6 +31,8 @@ namespace rocprofiler { +namespace sdk +{ namespace codeobj { namespace segment @@ -89,4 +91,5 @@ class CodeobjTableTranslator : public std::set } // namespace segment } // namespace codeobj +} // namespace sdk } // namespace rocprofiler diff --git a/source/lib/rocprofiler-sdk-codeobj/tests/codeobj_library_test.cpp b/source/lib/rocprofiler-sdk-codeobj/tests/codeobj_library_test.cpp index fde0f6c8..463b5e91 100644 --- a/source/lib/rocprofiler-sdk-codeobj/tests/codeobj_library_test.cpp +++ b/source/lib/rocprofiler-sdk-codeobj/tests/codeobj_library_test.cpp @@ -23,7 +23,7 @@ #include #include #include -#include +#include #include #include @@ -84,7 +84,7 @@ GetCodeobjContents() TEST(codeobj_library, segment_test) { - using CodeobjTableTranslator = rocprofiler::codeobj::segment::CodeobjTableTranslator; + using CodeobjTableTranslator = rocprofiler::sdk::codeobj::segment::CodeobjTableTranslator; CodeobjTableTranslator table; std::unordered_set used_addr{}; @@ -122,10 +122,10 @@ TEST(codeobj_library, segment_test) } } -namespace disassembly = rocprofiler::codeobj::disassembly; +namespace disassembly = rocprofiler::sdk::codeobj::disassembly; namespace codeobjhelper = rocprofiler::testing::codeobjhelper; -using CodeobjDecoderComponent = rocprofiler::codeobj::disassembly::CodeobjDecoderComponent; -using LoadedCodeobjDecoder = rocprofiler::codeobj::disassembly::LoadedCodeobjDecoder; +using CodeobjDecoderComponent = rocprofiler::sdk::codeobj::disassembly::CodeobjDecoderComponent; +using LoadedCodeobjDecoder = rocprofiler::sdk::codeobj::disassembly::LoadedCodeobjDecoder; TEST(codeobj_library, file_opens) { @@ -192,7 +192,7 @@ TEST(codeobj_library, loaded_codeobj_component) TEST(codeobj_library, codeobj_map_test) { - using marker_id_t = rocprofiler::codeobj::segment::marker_id_t; + using marker_id_t = rocprofiler::sdk::codeobj::segment::marker_id_t; const std::vector& objdata = rocprofiler::testing::codeobjhelper::GetCodeobjContents(); constexpr size_t laddr1 = 0x1000; @@ -221,7 +221,7 @@ TEST(codeobj_library, codeobj_map_test) TEST(codeobj_library, codeobj_table_test) { - using marker_id_t = rocprofiler::codeobj::segment::marker_id_t; + using marker_id_t = rocprofiler::sdk::codeobj::segment::marker_id_t; const std::vector& hiplines = codeobjhelper::GetHipccOutput(); const std::vector& objdata = codeobjhelper::GetCodeobjContents(); diff --git a/tests/pc_sampling/address_translation.hpp b/tests/pc_sampling/address_translation.hpp index 5e572f8c..30fc9b15 100644 --- a/tests/pc_sampling/address_translation.hpp +++ b/tests/pc_sampling/address_translation.hpp @@ -22,7 +22,7 @@ #pragma once -#include +#include #include #include @@ -38,9 +38,9 @@ namespace client { namespace address_translation { -using Instruction = rocprofiler::codeobj::disassembly::Instruction; -using CodeobjAddressTranslate = rocprofiler::codeobj::disassembly::CodeobjAddressTranslate; -using marker_id_t = rocprofiler::codeobj::disassembly::marker_id_t; +using Instruction = rocprofiler::sdk::codeobj::disassembly::Instruction; +using CodeobjAddressTranslate = rocprofiler::sdk::codeobj::disassembly::CodeobjAddressTranslate; +using marker_id_t = rocprofiler::sdk::codeobj::disassembly::marker_id_t; /** * @brief Pair (code_object_id, pc_addr) uniquely identifies an instruction. diff --git a/tests/thread-trace/trace_callbacks.cpp b/tests/thread-trace/trace_callbacks.cpp index 97a319e3..71812e8e 100644 --- a/tests/thread-trace/trace_callbacks.cpp +++ b/tests/thread-trace/trace_callbacks.cpp @@ -29,7 +29,7 @@ #include #include #include -#include +#include #include "common.hpp" #include @@ -50,8 +50,8 @@ namespace Callbacks { using code_obj_load_data_t = rocprofiler_callback_tracing_code_object_load_data_t; using kernel_symbol_data_t = rocprofiler_callback_tracing_code_object_kernel_symbol_register_data_t; -using CodeobjAddressTranslate = rocprofiler::codeobj::disassembly::CodeobjAddressTranslate; -using Instruction = rocprofiler::codeobj::disassembly::Instruction; +using CodeobjAddressTranslate = rocprofiler::sdk::codeobj::disassembly::CodeobjAddressTranslate; +using Instruction = rocprofiler::sdk::codeobj::disassembly::Instruction; CodeobjAddressTranslate* codeobjTranslate = nullptr;