56030018dc
* Support ROCPROFILER_CALLBACK_TRACING_KERNEL_DISPATCH * Fix doxygen * Update callback tracing - temporary hacks for kind operation name and iterate kind operations * Update source/include/rocprofiler-sdk - introduce sequence id for kernel dispatches * Update lib/rocprofiler-sdk (seq id) - support sequence id passing * Update tests (seq id) - testing for sequence ids * Cleanup include/rocprofiler-sdk/fwd.h * Misc cleanup * External Correlation ID Request Service (#699) * External correlation ID request service - callback requesting an external correlation ID instead of fetching from top of pushed external correlation ID stack * Update external correlation id request support - pass internal correlation ID in callback - async copy generates a correlation ID if none already exists - added external correlation ID request support for scratch memory tracing - updated scratch memory tracing to use tracing:: functions * Update hsa/queue.hpp - new line at EOF * Misc tweaks - remove unnecessary logging in agent.cpp - correlation_id::add_ref_count check for retirement - finalization check in HSA queue AsyncSignalHandler * Improve assertion failure logging in misc tests * Update include/rocprofiler-sdk/fwd.h - remove rocprofiler_record_counter_header_t * Move lib/rocprofiler-sdk/tracing.hpp into lib/rocprofiler-sdk/tracing/ folder * Update lib/rocprofiler-sdk/hsa/* - hsa::get_hsa_status_string - queue_info_session.hpp header - rocprofiler_packet.hpp * Update lib/rocprofiler-sdk/{counters,hip,marker} - execute_phase_exit_callbacks tweaks - queue_info_session tweaks * Move rocprofiler_kernel_dispatch_operation_t to include/rocprofiler-sdk/fwd.h * Update rocprofiler_buffer_tracing_kernel_dispatch_record_t - add operation field and thread_id field * Add lib/rocprofiler-sdk/kernel_dispatch - enum <-> string mapping for kernel dispatch - tracing implementations * Update lib/rocprofiler-sdk/CMakeLists.txt - tracing and kernel dispatch sub-directories * Update lib/rocprofiler-sdk/{buffer,callback}_tracing.cpp - invoke rocprofiler::kernel_tracing functions * Update tests/common/serialization.hpp - support operation and thread_id fields for rocprofiler_buffer_tracing_kernel_dispatch_record_t * Update tests/tools/json-tool.cpp - use external correlation id request service * Rename sequence_id to dispatch_id
140 lines
5.0 KiB
CMake
140 lines
5.0 KiB
CMake
#
|
|
#
|
|
#
|
|
rocprofiler_activate_clang_tidy()
|
|
|
|
set(ROCPROFILER_LIB_HEADERS agent.hpp allocator.hpp buffer.hpp external_correlation.hpp
|
|
intercept_table.hpp internal_threading.hpp registration.hpp)
|
|
set(ROCPROFILER_LIB_SOURCES
|
|
agent.cpp
|
|
allocator.cpp
|
|
buffer.cpp
|
|
buffer_tracing.cpp
|
|
callback_tracing.cpp
|
|
context.cpp
|
|
counters.cpp
|
|
dispatch_profile.cpp
|
|
external_correlation.cpp
|
|
intercept_table.cpp
|
|
internal_threading.cpp
|
|
pc_sampling.cpp
|
|
profile_config.cpp
|
|
rocprofiler.cpp
|
|
registration.cpp)
|
|
|
|
# ----------------------------------------------------------------------------------------#
|
|
#
|
|
# object library allows us to compile rocprofiler code once and generate both a shared and
|
|
# static library
|
|
#
|
|
# ----------------------------------------------------------------------------------------#
|
|
|
|
add_library(rocprofiler-object-library OBJECT)
|
|
add_library(rocprofiler::rocprofiler-object-library ALIAS rocprofiler-object-library)
|
|
|
|
target_sources(rocprofiler-object-library PRIVATE ${ROCPROFILER_LIB_SOURCES}
|
|
${ROCPROFILER_LIB_HEADERS})
|
|
|
|
add_subdirectory(hsa)
|
|
add_subdirectory(hip)
|
|
add_subdirectory(context)
|
|
add_subdirectory(counters)
|
|
add_subdirectory(aql)
|
|
add_subdirectory(pc_sampling)
|
|
add_subdirectory(marker)
|
|
add_subdirectory(thread_trace)
|
|
add_subdirectory(tracing)
|
|
add_subdirectory(kernel_dispatch)
|
|
|
|
target_link_libraries(
|
|
rocprofiler-object-library
|
|
PUBLIC rocprofiler::rocprofiler-headers rocprofiler::rocprofiler-hip-nolink
|
|
rocprofiler::rocprofiler-hsa-runtime-nolink
|
|
PRIVATE rocprofiler::rocprofiler-build-flags
|
|
rocprofiler::rocprofiler-memcheck
|
|
rocprofiler::rocprofiler-common-library
|
|
rocprofiler::rocprofiler-amd-comgr
|
|
rocprofiler::rocprofiler-hsa-aql
|
|
rocprofiler::rocprofiler-drm
|
|
rocprofiler::rocprofiler-hsakmt-nolink)
|
|
|
|
target_compile_definitions(rocprofiler-object-library PRIVATE rocprofiler_EXPORTS=1)
|
|
|
|
set_target_properties(rocprofiler-object-library PROPERTIES POSITION_INDEPENDENT_CODE ON)
|
|
|
|
# ----------------------------------------------------------------------------------------#
|
|
#
|
|
# shared library
|
|
#
|
|
# ----------------------------------------------------------------------------------------#
|
|
|
|
add_library(rocprofiler-shared-library SHARED)
|
|
add_library(rocprofiler::rocprofiler-shared-library ALIAS rocprofiler-shared-library)
|
|
|
|
target_sources(
|
|
rocprofiler-shared-library
|
|
PRIVATE $<TARGET_OBJECTS:rocprofiler::rocprofiler-object-library> shared_library.cpp)
|
|
target_link_libraries(
|
|
rocprofiler-shared-library
|
|
INTERFACE rocprofiler::rocprofiler-headers
|
|
$<BUILD_INTERFACE:rocprofiler::rocprofiler-hsa-runtime-nolink>
|
|
$<BUILD_INTERFACE:rocprofiler::rocprofiler-hip-nolink>
|
|
PRIVATE rocprofiler::rocprofiler-hsa-runtime-nolink
|
|
rocprofiler::rocprofiler-hip-nolink
|
|
rocprofiler::rocprofiler-build-flags
|
|
rocprofiler::rocprofiler-memcheck
|
|
rocprofiler::rocprofiler-common-library
|
|
rocprofiler::rocprofiler-cxx-filesystem
|
|
rocprofiler::rocprofiler-dl
|
|
rocprofiler::rocprofiler-amd-comgr
|
|
rocprofiler::rocprofiler-object-library)
|
|
|
|
set_target_properties(
|
|
rocprofiler-shared-library
|
|
PROPERTIES OUTPUT_NAME rocprofiler-sdk
|
|
SOVERSION ${PROJECT_VERSION_MAJOR}
|
|
VERSION ${PROJECT_VERSION}
|
|
BUILD_RPATH "\$ORIGIN"
|
|
INSTALL_RPATH "\$ORIGIN"
|
|
DEFINE_SYMBOL rocprofiler_EXPORTS)
|
|
|
|
add_library(rocprofiler::rocprofiler-library ALIAS rocprofiler-shared-library)
|
|
|
|
install(
|
|
TARGETS rocprofiler-shared-library
|
|
DESTINATION ${CMAKE_INSTALL_LIBDIR}
|
|
COMPONENT core
|
|
EXPORT rocprofiler-sdk-targets)
|
|
|
|
# ----------------------------------------------------------------------------------------#
|
|
#
|
|
# static library (only built if another target links to it)
|
|
#
|
|
# ----------------------------------------------------------------------------------------#
|
|
|
|
add_library(rocprofiler-static-library EXCLUDE_FROM_ALL STATIC)
|
|
add_library(rocprofiler::rocprofiler-static-library ALIAS rocprofiler-static-library)
|
|
|
|
target_sources(rocprofiler-static-library
|
|
PRIVATE $<TARGET_OBJECTS:rocprofiler::rocprofiler-object-library>)
|
|
target_link_libraries(
|
|
rocprofiler-static-library
|
|
PUBLIC rocprofiler::rocprofiler-headers rocprofiler::rocprofiler-hsa-runtime-nolink
|
|
rocprofiler::rocprofiler-hip-nolink
|
|
PRIVATE rocprofiler::rocprofiler-common-library
|
|
rocprofiler::rocprofiler-object-library)
|
|
|
|
set_target_properties(
|
|
rocprofiler-static-library PROPERTIES OUTPUT_NAME rocprofiler-sdk DEFINE_SYMBOL
|
|
rocprofiler_EXPORTS)
|
|
|
|
# ----------------------------------------------------------------------------------------#
|
|
#
|
|
# testing
|
|
#
|
|
# ----------------------------------------------------------------------------------------#
|
|
|
|
if(ROCPROFILER_BUILD_TESTS)
|
|
add_subdirectory(tests)
|
|
endif()
|