Skip to content

Commit

Permalink
Merge branch 'main' into omnitrace-refactor-main
Browse files Browse the repository at this point in the history
  • Loading branch information
jrmadsen committed Jul 2, 2024
2 parents 1dc1285 + 18833a0 commit 097bc96
Show file tree
Hide file tree
Showing 69 changed files with 7,759 additions and 124 deletions.
1 change: 1 addition & 0 deletions .clang-tidy
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ performance-*,\
readability-*,\
-readability-function-size,\
-readability-identifier-naming,\
-readability-identifier-length,\
-readability-implicit-bool-cast,\
-readability-inconsistent-declaration-parameter-name,\
-readability-named-parameter,\
Expand Down
24 changes: 24 additions & 0 deletions .github/workflows/cpack.yml
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,9 @@ jobs:
- os-distro: "ubuntu"
os-version: "20.04"
rocm-version: "6.0"
- os-distro: "ubuntu"
os-version: "20.04"
rocm-version: "6.1"
# ubuntu 22.04
- os-distro: "ubuntu"
os-version: "22.04"
Expand All @@ -73,6 +76,9 @@ jobs:
- os-distro: "ubuntu"
os-version: "22.04"
rocm-version: "6.0"
- os-distro: "ubuntu"
os-version: "22.04"
rocm-version: "6.1"
# opensuse 15.3
- os-distro: "opensuse"
os-version: "15.3"
Expand Down Expand Up @@ -114,13 +120,19 @@ jobs:
- os-distro: "opensuse"
os-version: "15.4"
rocm-version: "6.0"
- os-distro: "opensuse"
os-version: "15.4"
rocm-version: "6.1"
# opensuse 15.5
- os-distro: "opensuse"
os-version: "15.5"
rocm-version: "0.0"
- os-distro: "opensuse"
os-version: "15.5"
rocm-version: "6.0"
- os-distro: "opensuse"
os-version: "15.5"
rocm-version: "6.1"
# RHEL 8.7
- os-distro: "rhel"
os-version: "8.7"
Expand Down Expand Up @@ -153,13 +165,19 @@ jobs:
- os-distro: "rhel"
os-version: "8.8"
rocm-version: "6.0"
- os-distro: "rhel"
os-version: "8.8"
rocm-version: "6.1"
# RHEL 8.9
- os-distro: "rhel"
os-version: "8.9"
rocm-version: "0.0"
- os-distro: "rhel"
os-version: "8.9"
rocm-version: "6.0"
- os-distro: "rhel"
os-version: "8.9"
rocm-version: "6.1"
# RHEL 9.1
- os-distro: "rhel"
os-version: "9.1"
Expand All @@ -183,13 +201,19 @@ jobs:
- os-distro: "rhel"
os-version: "9.2"
rocm-version: "6.0"
- os-distro: "rhel"
os-version: "9.2"
rocm-version: "6.1"
# RHEL 9.3
- os-distro: "rhel"
os-version: "9.3"
rocm-version: "0.0"
- os-distro: "rhel"
os-version: "9.3"
rocm-version: "6.0"
- os-distro: "rhel"
os-version: "9.3"
rocm-version: "6.1"

steps:
- name: Free Disk Space
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/docs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ jobs:
conda activate omnitrace-docs
./update-docs.sh
- name: Upload artifact
uses: actions/upload-pages-artifact@v1
uses: actions/upload-pages-artifact@v3
with:
path: ./docs

Expand All @@ -67,4 +67,4 @@ jobs:
steps:
- name: Deploy to GitHub Pages
id: deployment
uses: actions/deploy-pages@v1
uses: actions/deploy-pages@v4
2 changes: 1 addition & 1 deletion VERSION
Original file line number Diff line number Diff line change
@@ -1 +1 @@
1.11.2
1.11.3
41 changes: 1 addition & 40 deletions cmake/Packages.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -291,6 +291,7 @@ if(OMNITRACE_BUILD_DYNINST)

set(DYNINST_OPTION_PREFIX ON)
set(DYNINST_BUILD_DOCS OFF)
set(DYNINST_BUILD_RTLIB OFF)
set(DYNINST_QUIET_CONFIG
ON
CACHE BOOL "Suppress dyninst cmake messages")
Expand Down Expand Up @@ -344,7 +345,6 @@ if(OMNITRACE_BUILD_DYNINST)
dynDwarf
dynElf
dyninstAPI
dyninstAPI_RT
instructionAPI
parseAPI
patchAPI
Expand All @@ -360,9 +360,6 @@ if(OMNITRACE_BUILD_DYNINST)
endif()
endforeach()

omnitrace_install_tpl(dyninstAPI_RT omnitrace-rt
"${PROJECT_BINARY_DIR}/${CMAKE_INSTALL_LIBDIR}" core)

# for packaging
install(
DIRECTORY ${DYNINST_TPL_STAGING_PREFIX}/lib/
Expand All @@ -373,35 +370,11 @@ if(OMNITRACE_BUILD_DYNINST)

target_link_libraries(omnitrace-dyninst INTERFACE Dyninst::Dyninst)

set(OMNITRACE_DYNINST_API_RT
${PROJECT_BINARY_DIR}/external/dyninst/dyninstAPI_RT/libdyninstAPI_RT${CMAKE_SHARED_LIBRARY_SUFFIX}
)

if(OMNITRACE_DYNINST_API_RT)
omnitrace_target_compile_definitions(
omnitrace-dyninst
INTERFACE
DYNINST_API_RT="${CMAKE_INSTALL_PREFIX}/${CMAKE_INSTALL_LIBDIR}:$<TARGET_FILE_DIR:Dyninst::dyninstAPI_RT>:${CMAKE_INSTALL_PREFIX}/${CMAKE_INSTALL_LIBDIR}/$<TARGET_FILE_NAME:Dyninst::dyninstAPI_RT>:$<TARGET_FILE:Dyninst::dyninstAPI_RT>"
)
endif()

else()
find_package(Dyninst ${omnitrace_FIND_QUIETLY} REQUIRED
COMPONENTS dyninstAPI parseAPI instructionAPI symtabAPI)

if(TARGET Dyninst::Dyninst) # updated Dyninst CMake system was found
# useful for defining the location of the runtime API
find_library(
OMNITRACE_DYNINST_API_RT dyninstAPI_RT
HINTS ${Dyninst_ROOT_DIR} ${Dyninst_DIR}
PATHS ${Dyninst_ROOT_DIR} ${Dyninst_DIR}
PATH_SUFFIXES lib NO_CACHE)

if(OMNITRACE_DYNINST_API_RT)
omnitrace_target_compile_definitions(
omnitrace-dyninst INTERFACE DYNINST_API_RT="${OMNITRACE_DYNINST_API_RT}")
endif()

target_link_libraries(omnitrace-dyninst INTERFACE Dyninst::Dyninst)
else() # updated Dyninst CMake system was not found
set(_BOOST_COMPONENTS atomic system thread date_time)
Expand All @@ -424,13 +397,6 @@ else()
PATH_SUFFIXES include)
endif()

# useful for defining the location of the runtime API
find_library(
OMNITRACE_DYNINST_API_RT dyninstAPI_RT
HINTS ${Dyninst_ROOT_DIR} ${Dyninst_DIR}
PATHS ${Dyninst_ROOT_DIR} ${Dyninst_DIR}
PATH_SUFFIXES lib)

# try to find TBB
find_package(TBB QUIET)

Expand All @@ -447,11 +413,6 @@ else()
PATH_SUFFIXES include)
endif()

if(OMNITRACE_DYNINST_API_RT)
omnitrace_target_compile_definitions(
omnitrace-dyninst INTERFACE DYNINST_API_RT="${OMNITRACE_DYNINST_API_RT}")
endif()

target_link_libraries(omnitrace-dyninst INTERFACE ${DYNINST_LIBRARIES}
${Boost_LIBRARIES})
foreach(
Expand Down
6 changes: 3 additions & 3 deletions docker/build-docker.sh
Original file line number Diff line number Diff line change
Expand Up @@ -177,7 +177,7 @@ do
4.1* | 4.0*)
ROCM_REPO_DIST="xenial"
;;
5.3 | 5.3.* | 5.4 | 5.4.* | 5.5 | 5.5.* | 5.6 | 5.6.* | 5.7 | 5.7.* | 6.0 | 6.0.*)
5.3 | 5.3.* | 5.4 | 5.4.* | 5.5 | 5.5.* | 5.6 | 5.6.* | 5.7 | 5.7.* | 6.*)
case "${VERSION}" in
22.04)
ROCM_REPO_DIST="ubuntu"
Expand Down Expand Up @@ -208,7 +208,7 @@ do

# set the sub-URL in https://repo.radeon.com/amdgpu-install/<sub-URL>
case "${ROCM_VERSION}" in
5.3 | 5.3.* | 5.4 | 5.4.* | 5.5 | 5.5.* | 5.6 | 5.6.* | 5.7 | 5.7.* | 6.0 | 6.0.*)
5.3 | 5.3.* | 5.4 | 5.4.* | 5.5 | 5.5.* | 5.6 | 5.6.* | 5.7 | 5.7.* | 6.*)
ROCM_RPM=${ROCM_VERSION}/rhel/${RPM_PATH}/amdgpu-install-${ROCM_MAJOR}.${ROCM_MINOR}.${ROCM_VERSN}-1${RPM_TAG}.noarch.rpm
;;
5.2 | 5.2.* | 5.1 | 5.1.* | 5.0 | 5.0.* | 4.*)
Expand Down Expand Up @@ -236,7 +236,7 @@ do
;;
esac
case "${ROCM_VERSION}" in
5.3 | 5.3.* | 5.4 | 5.4.* | 5.5 | 5.5.* | 5.6 | 5.6.* | 5.7 | 5.7.* | 6.0 | 6.0.*)
5.3 | 5.3.* | 5.4 | 5.4.* | 5.5 | 5.5.* | 5.6 | 5.6.* | 5.7 | 5.7.* | 6.*)
ROCM_RPM=${ROCM_VERSION}/sle/${VERSION}/amdgpu-install-${ROCM_MAJOR}.${ROCM_MINOR}.${ROCM_VERSN}-1.noarch.rpm
;;
5.2 | 5.2.*)
Expand Down
2 changes: 1 addition & 1 deletion examples/lulesh/external/kokkos
Submodule kokkos updated 695 files
2 changes: 1 addition & 1 deletion external/dyninst
2 changes: 2 additions & 0 deletions source/bin/omnitrace-instrument/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,8 @@ if(OMNITRACE_BUILD_DYNINST)
target_compile_definitions(omnitrace-instrument PRIVATE OMNITRACE_BUILD_DYNINST=1)
endif()

add_target_flag_if_avail(omnitrace-instrument "-Wno-deprecated-declarations")

omnitrace_strip_target(omnitrace-instrument)

if(CMAKE_BUILD_TYPE MATCHES "^(DEBUG|Debug)")
Expand Down
29 changes: 19 additions & 10 deletions source/bin/omnitrace-instrument/omnitrace-instrument.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@

#include "omnitrace-instrument.hpp"
#include "common/defines.h"
#include "common/join.hpp"
#include "dl/dl.hpp"
#include "fwd.hpp"
#include "internal_libs.hpp"
Expand Down Expand Up @@ -187,18 +188,26 @@ strset_t print_formats = { "txt", "json
std::string modfunc_dump_dir = {};
auto regex_opts = std::regex_constants::egrep | std::regex_constants::optimize;

strvec_t lib_search_paths =
tim::delimit(JOIN(':', tim::get_env<std::string>("DYNINSTAPI_RT_LIB"),
tim::get_env<std::string>("DYNINST_REWRITER_PATHS"),
tim::get_env<std::string>("LD_LIBRARY_PATH")),
":");
std::string
get_internal_libpath()
{
auto _exe = std::string_view{ ::realpath("/proc/self/exe", nullptr) };
auto _pos = _exe.find_last_of('/');
auto _dir = std::string{ "./" };
if(_pos != std::string_view::npos) _dir = _exe.substr(0, _pos);
return omnitrace::common::join("/", _dir, "..", "lib");
}

strvec_t lib_search_paths = tim::delimit(
JOIN(':', get_internal_libpath(), tim::get_env<std::string>("DYNINSTAPI_RT_LIB"),
tim::get_env<std::string>("DYNINST_REWRITER_PATHS"),
tim::get_env<std::string>("LD_LIBRARY_PATH")),
":");
strvec_t bin_search_paths = tim::delimit(tim::get_env<std::string>("PATH"), ":");

#if defined(DYNINST_API_RT)
auto _dyn_api_rt_paths = tim::delimit(DYNINST_API_RT, ":");
#else
auto _dyn_api_rt_paths = std::vector<std::string>{};
#endif
auto _dyn_api_rt_paths = tim::delimit(
JOIN(":", get_internal_libpath(), JOIN("/", get_internal_libpath(), "omnitrace")),
":");

std::string
get_absolute_filepath(std::string _name, const strvec_t& _paths);
Expand Down
1 change: 1 addition & 0 deletions source/bin/omnitrace-run/impl.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -191,6 +191,7 @@ prepare_environment_for_run(parser_data_t& _data)
if(_data.launcher.empty())
{
omnitrace::argparse::add_ld_preload(_data);
omnitrace::argparse::add_ld_library_path(_data);
}
}

Expand Down
Loading

0 comments on commit 097bc96

Please sign in to comment.