Skip to content

Commit

Permalink
Rename the omnitrace-dl library - Part 1
Browse files Browse the repository at this point in the history
Signed-off-by: David Galiffi <[email protected]>
  • Loading branch information
dgaliffiAMD committed Sep 11, 2024
1 parent a9face6 commit a508d81
Show file tree
Hide file tree
Showing 9 changed files with 18 additions and 18 deletions.
2 changes: 1 addition & 1 deletion source/lib/binary/analysis.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -240,7 +240,7 @@ lookup_ipaddr_entry(uintptr_t _addr, unw_context_t* _context_p,
for(const auto& itr : binary::get_link_map("libomnitrace.so", "", ""))
_insert_exclude_range(itr.real());

for(const auto& itr : binary::get_link_map("libomnitrace-dl.so", "", ""))
for(const auto& itr : binary::get_link_map("librocsys.so", "", ""))
_insert_exclude_range(itr.real());

return _exclude_range_v;
Expand Down
4 changes: 2 additions & 2 deletions source/lib/common/setup.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,7 @@ inline namespace common
inline std::vector<env_config>
get_environ(int _verbose, std::string _search_paths = {},
std::string _omnilib = "libomnitrace.so",
std::string _omnilib_dl = "libomnitrace-dl.so")
std::string _omnilib_dl = "librocsys.so")
{
auto _data = std::vector<env_config>{};
auto _omnilib_path = path::get_origin(_omnilib);
Expand Down Expand Up @@ -275,7 +275,7 @@ get_environ(int _verbose, std::string _search_paths = {},
inline void
setup_environ(int _verbose, const std::string& _search_paths = {},
std::string _omnilib = "libomnitrace.so",
std::string _omnilib_dl = "libomnitrace-dl.so")
std::string _omnilib_dl = "librocsys-dl.so")
{
auto _data =
get_environ(_verbose, _search_paths, std::move(_omnilib), std::move(_omnilib_dl));
Expand Down
2 changes: 1 addition & 1 deletion source/lib/core/argparse.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -219,7 +219,7 @@ init_parser(parser_data& _data)
}
}

_data.dl_libpath = get_realpath(get_internal_libpath("libomnitrace-dl.so").c_str());
_data.dl_libpath = get_realpath(get_internal_libpath("librocsys-dl.so").c_str());
_data.omni_libpath = get_realpath(get_internal_libpath("libomnitrace.so").c_str());

#if defined(OMNITRACE_USE_ROCTRACER) || defined(OMNITRACE_USE_ROCPROFILER)
Expand Down
4 changes: 2 additions & 2 deletions source/lib/core/config.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -255,7 +255,7 @@ configure_settings(bool _init)

OMNITRACE_CONFIG_EXT_SETTING(int, "OMNITRACE_DL_VERBOSE",
"Verbosity within the omnitrace-dl library", 0,
"debugging", "libomnitrace-dl", "advanced");
"debugging", "librocsys-dl", "advanced");

OMNITRACE_CONFIG_SETTING(
size_t, "OMNITRACE_NUM_THREADS_HINT",
Expand Down Expand Up @@ -1163,7 +1163,7 @@ configure_mode_settings(const std::shared_ptr<settings>& _config)
if(_config->get<bool>("OMNITRACE_USE_KOKKOSP"))
{
auto _current_kokkosp_lib = tim::get_env<std::string>("KOKKOS_PROFILE_LIBRARY");
if(_current_kokkosp_lib.find("libomnitrace-dl.so") == std::string::npos &&
if(_current_kokkosp_lib.find("librocsys-dl.so") == std::string::npos &&
_current_kokkosp_lib.find("libomnitrace.so") == std::string::npos)
{
auto _force = 0;
Expand Down
2 changes: 1 addition & 1 deletion source/lib/omnitrace-dl/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ add_target_cxx_flag_if_avail(omnitrace-dl-library "-g3")

set_target_properties(
omnitrace-dl-library
PROPERTIES OUTPUT_NAME omnitrace-dl
PROPERTIES OUTPUT_NAME rocsys-dl
VERSION ${PROJECT_VERSION}
SOVERSION ${PROJECT_VERSION_MAJOR}.${PROJECT_VERSION_MINOR}
BUILD_RPATH "\$ORIGIN"
Expand Down
8 changes: 4 additions & 4 deletions source/lib/omnitrace-dl/dl.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -113,7 +113,7 @@ get_omnitrace_is_preloaded()
{
static bool _v = []() {
auto&& _preload_libs = get_env("LD_PRELOAD", std::string{});
return (_preload_libs.find("libomnitrace-dl.so") != std::string::npos);
return (_preload_libs.find("librocsys-dl.so") != std::string::npos);
}();
return _v;
}
Expand All @@ -125,7 +125,7 @@ get_omnitrace_preload()
auto&& _preload = get_env("OMNITRACE_PRELOAD", true);
auto&& _preload_libs = get_env("LD_PRELOAD", std::string{});
return (_preload &&
_preload_libs.find("libomnitrace-dl.so") != std::string::npos);
_preload_libs.find("librocsys-dl.so") != std::string::npos);
}();
return _v;
}
Expand All @@ -134,7 +134,7 @@ inline void
reset_omnitrace_preload()
{
auto&& _preload_libs = get_env("LD_PRELOAD", std::string{});
if(_preload_libs.find("libomnitrace-dl.so") != std::string::npos)
if(_preload_libs.find("librocsys-dl.so") != std::string::npos)
{
(void) get_omnitrace_is_preloaded();
(void) get_omnitrace_preload();
Expand Down Expand Up @@ -494,7 +494,7 @@ get_indirect()

static auto _libomni = get_env("OMNITRACE_LIBRARY", "libomnitrace.so");
static auto _libuser = get_env("OMNITRACE_USER_LIBRARY", "libomnitrace-user.so");
static auto _libdlib = get_env("OMNITRACE_DL_LIBRARY", "libomnitrace-dl.so");
static auto _libdlib = get_env("OMNITRACE_DL_LIBRARY", "librocsys-dl.so");
static auto* _v = new indirect{ _libomni, _libuser, _libdlib };
return *_v;
}
Expand Down
4 changes: 2 additions & 2 deletions source/lib/omnitrace/library/kokkosp.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -229,15 +229,15 @@ extern "C"
}
for(const auto& itr : _libs)
{
if(itr.find("libomnitrace-dl.so") != std::string::npos)
if(itr.find("librocsys-dl.so") != std::string::npos)
{
std::stringstream _libs_str{};
for(const auto& litr : _libs)
_libs_str << " " << litr << "\n";
OMNITRACE_ABORT(
"%s was invoked with libomnitrace.so as the "
"KOKKOS_PROFILE_LIBRARY.\n"
"However, libomnitrace-dl.so has already been loaded by the "
"However, librocsys-dl.so has already been loaded by the "
"process.\nTo avoid duplicate collections culminating is an "
"error, please set KOKKOS_PROFILE_LIBRARY=%s.\nLoaded "
"libraries:\n%s",
Expand Down
4 changes: 2 additions & 2 deletions source/python/libpyomnitrace.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -157,12 +157,12 @@ PYBIND11_MODULE(libpyomnitrace, omni)
pyuser::generate(omni);

auto _python_path = tim::get_env("OMNITRACE_PATH", std::string{}, false);
auto _libpath = std::string{ "libomnitrace-dl.so" };
auto _libpath = std::string{ "librocsys-dl.so" };
if(!_python_path.empty()) _libpath = TIMEMORY_JOIN("/", _python_path, _libpath);
// permit env override if default path fails/is wrong
_libpath = tim::get_env("OMNITRACE_DL_LIBRARY", _libpath);
// this is necessary when building with -static-libstdc++
// without it, loading libomnitrace.so within libomnitrace-dl.so segfaults
// without it, loading libomnitrace.so within librocsys-dl.so segfaults
if(!dlopen(_libpath.c_str(), RTLD_NOW | RTLD_GLOBAL))
{
auto _msg =
Expand Down
6 changes: 3 additions & 3 deletions tests/omnitrace-kokkos-tests.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ omnitrace_add_test(
LABELS "kokkos;kokkos-profile-library"
RUN_ARGS -i 25 -s 20 -p
ENVIRONMENT
"${_base_environment};OMNITRACE_USE_KOKKOSP=ON;OMNITRACE_COUT_OUTPUT=ON;OMNITRACE_SAMPLING_FREQ=50;OMNITRACE_KOKKOSP_PREFIX=[kokkos];KOKKOS_PROFILE_LIBRARY=libomnitrace-dl.so"
"${_base_environment};OMNITRACE_USE_KOKKOSP=ON;OMNITRACE_COUT_OUTPUT=ON;OMNITRACE_SAMPLING_FREQ=50;OMNITRACE_KOKKOSP_PREFIX=[kokkos];KOKKOS_PROFILE_LIBRARY=librocsys-dl.so"
REWRITE_RUN_PASS_REGEX "\\|_\\[kokkos\\] [a-zA-Z]"
RUNTIME_PASS_REGEX "\\|_\\[kokkos\\] [a-zA-Z]")

Expand All @@ -45,15 +45,15 @@ omnitrace_add_test(

omnitrace_add_test(
SKIP_RUNTIME SKIP_REWRITE
NAME lulesh-baseline-kokkosp-libomnitrace-dl
NAME lulesh-baseline-kokkosp-librocsys-dl
TARGET lulesh
MPI ${LULESH_USE_MPI}
GPU ${LULESH_USE_GPU}
NUM_PROCS 8
LABELS "kokkos;kokkos-profile-library"
RUN_ARGS -i 10 -s 20 -p
ENVIRONMENT
"${_base_environment};OMNITRACE_USE_KOKKOSP=ON;OMNITRACE_COUT_OUTPUT=ON;OMNITRACE_SAMPLING_FREQ=50;OMNITRACE_KOKKOSP_PREFIX=[kokkos];KOKKOS_PROFILE_LIBRARY=libomnitrace-dl.so"
"${_base_environment};OMNITRACE_USE_KOKKOSP=ON;OMNITRACE_COUT_OUTPUT=ON;OMNITRACE_SAMPLING_FREQ=50;OMNITRACE_KOKKOSP_PREFIX=[kokkos];KOKKOS_PROFILE_LIBRARY=librocsys-dl.so"
BASELINE_PASS_REGEX "\\|_\\[kokkos\\] [a-zA-Z]")

omnitrace_add_test(
Expand Down

0 comments on commit a508d81

Please sign in to comment.