Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

omnitrace-sample #169

Merged
merged 15 commits into from
Sep 30, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions .cmake-format.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ parse:
omnitrace_add_test:
flags:
- SKIP_BASELINE
- SKIP_PRELOAD
- SKIP_REWRITE
- SKIP_RUNTIME
- SKIP_SAMPLING
Expand All @@ -32,16 +33,21 @@ parse:
NUM_PROCS: '*'
REWRITE_TIMEOUT: '*'
RUNTIME_TIMEOUT: '*'
PRELOAD_TIMEOUT: '*'
REWRITE_ARGS: '*'
RUNTIME_ARGS: '*'
RUN_ARGS: '*'
ENVIRONMENT: '*'
LABELS: '*'
PROPERTIES: '*'
PRELOAD_PASS_REGEX: '*'
PRELOAD_FAIL_REGEX: '*'
RUNTIME_PASS_REGEX: '*'
RUNTIME_FAIL_REGEX: '*'
REWRITE_PASS_REGEX: '*'
REWRITE_FAIL_REGEX: '*'
BASELINE_PASS_REGEX: '*'
BASELINE_FAIL_REGEX: '*'
REWRITE_RUN_PASS_REGEX: '*'
REWRITE_RUN_FAIL_REGEX: '*'
omnitrace_target_compile_definitions:
Expand Down
8 changes: 4 additions & 4 deletions .github/workflows/cpack.yml
Original file line number Diff line number Diff line change
Expand Up @@ -78,15 +78,15 @@ jobs:
timeout-minutes: 10
uses: actions/upload-artifact@v2
with:
name: ubuntu-stgz-installers
name: ubuntu-${{ matrix.os }}-rocm-${{ matrix.rocm-version }}-stgz-installers
path: |
build-release/stgz/*.sh

- name: DEB Artifacts
timeout-minutes: 10
uses: actions/upload-artifact@v2
with:
name: ubuntu-deb-installers
name: ubuntu-${{ matrix.os }}-rocm-${{ matrix.rocm-version }}-deb-installers
path: |
build-release/deb/*.deb

Expand Down Expand Up @@ -187,15 +187,15 @@ jobs:
timeout-minutes: 10
uses: actions/upload-artifact@v2
with:
name: opensuse-stgz-installers
name: opensuse-${{ matrix.os }}-rocm-${{ matrix.rocm-version }}-stgz-installers
path: |
build-release/stgz/*.sh

- name: RPM Artifacts
timeout-minutes: 10
uses: actions/upload-artifact@v2
with:
name: opensuse-rpm-installers
name: opensuse-${{ matrix.os }}-rocm-${{ matrix.rocm-version }}-rpm-installers
path: |
build-release/rpm/*.rpm

Expand Down
62 changes: 38 additions & 24 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -90,8 +90,46 @@ if(DEFINED CMAKE_INSTALL_LIBDIR AND NOT DEFINED CMAKE_DEFAULT_INSTALL_LIBDIR)
CACHE STRING "Object code libraries" FORCE)
endif()

if(NOT "$ENV{OMNITRACE_CI}" STREQUAL "")
set(CI_BUILD $ENV{OMNITRACE_CI})
else()
set(CI_BUILD OFF)
endif()

include(GNUInstallDirs) # install directories
include(MacroUtilities) # various functions and macros

if(CI_BUILD)
omnitrace_add_option(OMNITRACE_BUILD_CI "Enable internal asserts, etc." ON ADVANCED
NO_FEATURE)
omnitrace_add_option(OMNITRACE_BUILD_TESTING "Enable building the testing suite" ON
ADVANCED)
omnitrace_add_option(OMNITRACE_BUILD_DEBUG
"Enable building with extensive debug symbols" OFF ADVANCED)
omnitrace_add_option(OMNITRACE_CUSTOM_DATA_SOURCE "Enable custom data source" OFF
ADVANCED)
omnitrace_add_option(
OMNITRACE_BUILD_HIDDEN_VISIBILITY
"Build with hidden visibility (disable for Debug builds)" OFF ADVANCED)
omnitrace_add_option(OMNITRACE_STRIP_LIBRARIES "Strip the libraries" OFF ADVANCED)
else()
omnitrace_add_option(OMNITRACE_BUILD_CI "Enable internal asserts, etc." OFF ADVANCED
NO_FEATURE)
omnitrace_add_option(OMNITRACE_BUILD_EXAMPLES "Enable building the examples" OFF
ADVANCED)
omnitrace_add_option(OMNITRACE_BUILD_TESTING "Enable building the testing suite" OFF
ADVANCED)
omnitrace_add_option(OMNITRACE_BUILD_DEBUG
"Enable building with extensive debug symbols" OFF ADVANCED)
omnitrace_add_option(OMNITRACE_CUSTOM_DATA_SOURCE "Enable custom data source" OFF
ADVANCED)
omnitrace_add_option(
OMNITRACE_BUILD_HIDDEN_VISIBILITY
"Build with hidden visibility (disable for Debug builds)" ON ADVANCED)
omnitrace_add_option(OMNITRACE_STRIP_LIBRARIES "Strip the libraries"
${_STRIP_LIBRARIES_DEFAULT} ADVANCED)
endif()

include(Compilers) # compiler identification
include(BuildSettings) # compiler flags

Expand Down Expand Up @@ -135,22 +173,8 @@ omnitrace_add_option(OMNITRACE_USE_OMPT "Enable OpenMP tools support" ON)
omnitrace_add_option(OMNITRACE_USE_PYTHON "Enable Python support" OFF)
omnitrace_add_option(OMNITRACE_BUILD_DYNINST "Build dyninst from submodule" OFF)
omnitrace_add_option(OMNITRACE_BUILD_LIBUNWIND "Build libunwind from submodule" ON)
omnitrace_add_option(OMNITRACE_BUILD_EXAMPLES "Enable building the examples" OFF ADVANCED)
omnitrace_add_option(OMNITRACE_BUILD_TESTING "Enable building the testing suite" OFF
ADVANCED)
omnitrace_add_option(OMNITRACE_BUILD_DEBUG "Enable building with extensive debug symbols"
OFF ADVANCED)
omnitrace_add_option(OMNITRACE_CUSTOM_DATA_SOURCE "Enable custom data source" OFF
ADVANCED)
omnitrace_add_option(
OMNITRACE_BUILD_HIDDEN_VISIBILITY
"Build with hidden visibility (disable for Debug builds)" ON ADVANCED)
omnitrace_add_option(OMNITRACE_BUILD_CI "Enable internal asserts, etc." OFF ADVANCED
NO_FEATURE)
omnitrace_add_option(OMNITRACE_INSTALL_PERFETTO_TOOLS
"Install perfetto tools (i.e. traced, perfetto, etc.)" OFF)
omnitrace_add_option(OMNITRACE_STRIP_LIBRARIES "Strip the libraries"
${_STRIP_LIBRARIES_DEFAULT} ADVANCED)

if(OMNITRACE_USE_PAPI)
omnitrace_add_option(OMNITRACE_BUILD_PAPI "Build PAPI from submodule" ON)
Expand All @@ -161,16 +185,6 @@ if(OMNITRACE_USE_PYTHON)
"Build python bindings with internal pybind11" ON)
endif()

if(NOT "$ENV{OMNITRACE_CI}" STREQUAL "")
message(
AUTHOR_WARNING
"OMNITRACE_CI environment variable ($ENV{OMNITRACE_CI}) is overridding the OMNITRACE_BUILD_CI cache value"
)
set(OMNITRACE_BUILD_CI
"$ENV{OMNITRACE_CI}"
CACHE BOOL "Enable internal asserts, etc" FORCE)
endif()

if(NOT OMNITRACE_USE_HIP)
set(OMNITRACE_USE_ROCTRACER
OFF
Expand Down
5 changes: 3 additions & 2 deletions cmake/BuildSettings.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,9 @@ include(Compilers)
include(FindPackageHandleStandardArgs)
include(MacroUtilities)

omnitrace_add_option(OMNITRACE_BUILD_DEVELOPER
"Extra build flags for development like -Werror" OFF)
omnitrace_add_option(
OMNITRACE_BUILD_DEVELOPER "Extra build flags for development like -Werror"
${OMNITRACE_BUILD_CI})
omnitrace_add_option(OMNITRACE_BUILD_EXTRA_OPTIMIZATIONS "Extra optimization flags" OFF)
omnitrace_add_option(OMNITRACE_BUILD_LTO "Build with link-time optimization" OFF)
omnitrace_add_option(OMNITRACE_USE_COMPILE_TIMING
Expand Down
1 change: 1 addition & 0 deletions source/bin/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ endif()
# executables
add_subdirectory(omnitrace-avail)
add_subdirectory(omnitrace-critical-trace)
add_subdirectory(omnitrace-sample)
add_subdirectory(omnitrace)

if(OMNITRACE_BUILD_TESTING OR "$ENV{OMNITRACE_CI}" MATCHES "[1-9]+|ON|on|y|yes")
Expand Down
22 changes: 22 additions & 0 deletions source/bin/omnitrace-sample/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
# ------------------------------------------------------------------------------#
#
# omnitrace-sample target
#
# ------------------------------------------------------------------------------#

add_executable(omnitrace-sample ${CMAKE_CURRENT_LIST_DIR}/omnitrace-sample.cpp
${CMAKE_CURRENT_LIST_DIR}/impl.cpp)

target_include_directories(omnitrace-sample PRIVATE ${CMAKE_CURRENT_LIST_DIR})
target_link_libraries(
omnitrace-sample
PRIVATE omnitrace::omnitrace-compile-definitions omnitrace::omnitrace-headers
omnitrace::omnitrace-common-library)
set_target_properties(
omnitrace-sample PROPERTIES BUILD_RPATH "\$ORIGIN:\$ORIGIN/../${CMAKE_INSTALL_LIBDIR}"
INSTALL_RPATH "${OMNITRACE_EXE_INSTALL_RPATH}")

install(
TARGETS omnitrace-sample
DESTINATION ${CMAKE_INSTALL_BINDIR}
OPTIONAL)
Loading