fix omnitrace print-* with libraries (#94)

* fix omnitrace print-* with libraries

* timemory submodule update

* Update workflows to use ./bin/omnitrace instead of ./omnitrace

* cmake format

* update timemory submodule

- fix ODR violations in utility/procfs

* cmake updates

- uniform find_package for all ROCm-based libraries

* tweak transpose example

- throw exception instead of std::exit

* Inspect cmdv name before assuming not exe

- some ELF execs "think" they are libraries so only assume rewrite + simulate + all-functions if filename looks like library
- adds some test for --print-available -- <library>

* Fix _has_lib_prefix when command is < 3

* Updates and reverts to omnitrace exe

- update module_function operator< and operator==
- add function_signature operator<
- refactor module_function ctor
- revert some previous changes w.r.t. simulate and include_unninstr

* Fix source/bin/tests to use same output dir as tests

* cmake format

* Segfault mitigation + refactor + modify function iteration

- refactor module_function ctor to avoid segfaults
- string_t -> std::string
- replace std::string with std::string_view in some places
- get_name(module_t*)
- get_name(procedure_t*)
- disable using both app_modules and app_functions
- new option: --parse-all-modules to iterate over app_modules
- removed some unused code w.r.t. debug info

* Disable module_function address range for uninstrumentable functions

* Disable module_function address range for uninstrumentable functions

* Refactored getting file/line info and init/fini

- use dyninst insertInitCallback and insertFiniCallback if main not found
- fixed all issues with segmentation faults in --simulate --all-functions

* revert changes to Findrocprofiler.cmake
This commit is contained in:
Jonathan R. Madsen
2022-07-21 01:15:41 -05:00
committed by GitHub
orang tua 6bc86d1111
melakukan d04cbe862e
29 mengubah file dengan 781 tambahan dan 531 penghapusan
+2 -2
Melihat File
@@ -12,8 +12,8 @@ option(BUILD_SHARED_LIBS "Build dynamic libraries" ON)
if(CMAKE_PROJECT_NAME STREQUAL "omnitrace")
set(CMAKE_RUNTIME_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR})
set(CMAKE_LIBRARY_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR})
set(CMAKE_ARCHIVE_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR})
set(CMAKE_LIBRARY_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/${CMAKE_INSTALL_LIBDIR})
set(CMAKE_ARCHIVE_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/${CMAKE_INSTALL_LIBDIR})
omnitrace_add_option(OMNITRACE_INSTALL_EXAMPLES "Install omnitrace examples" OFF)
else()
option(OMNITRACE_INSTALL_EXAMPLES "Install omnitrace examples" ON)
+3 -3
Melihat File
@@ -13,13 +13,13 @@ if(LULESH_BUILD_KOKKOS)
kokkos_compilation(PROJECT)
elseif(LULESH_USE_HIP AND NOT "${CMAKE_CXX_COMPILER}" MATCHES "hipcc")
if(NOT HIPCC_EXECUTABLE)
find_package(hip QUIET)
find_package(hip QUIET HINTS ${ROCmVersion_DIR} PATHS ${ROCmVersion_DIR})
find_program(
HIPCC_EXECUTABLE
NAMES hipcc
HINTS ${ROCM_PATH} ENV ROCM_PATH /opt/rocm
PATHS ${ROCM_PATH} ENV ROCM_PATH /opt/rocm)
HINTS ${ROCmVersion_DIR} ${ROCM_PATH} ENV ROCM_PATH /opt/rocm
PATHS ${ROCmVersion_DIR} ${ROCM_PATH} ENV ROCM_PATH /opt/rocm)
mark_as_advanced(HIPCC_EXECUTABLE)
endif()
kokkos_compilation(PROJECT COMPILER ${HIPCC_EXECUTABLE})
+3 -3
Melihat File
@@ -2,13 +2,13 @@ cmake_minimum_required(VERSION 3.16 FATAL_ERROR)
project(omnitrace-transpose LANGUAGES CXX)
find_package(hip QUIET)
find_package(hip QUIET HINTS ${ROCmVersion_DIR} PATHS ${ROCmVersion_DIR})
find_program(
HIPCC_EXECUTABLE
NAMES hipcc
HINTS ${ROCM_PATH} ENV ROCM_PATH /opt/rocm
PATHS ${ROCM_PATH} ENV ROCM_PATH /opt/rocm)
HINTS ${ROCmVersion_DIR} ${ROCM_PATH} ENV ROCM_PATH /opt/rocm
PATHS ${ROCmVersion_DIR} ${ROCM_PATH} ENV ROCM_PATH /opt/rocm NO_CACHE)
mark_as_advanced(HIPCC_EXECUTABLE)
if(NOT HIPCC_EXECUTABLE)
+3 -2
Melihat File
@@ -32,6 +32,7 @@ THE SOFTWARE.
#include <iostream>
#include <mutex>
#include <random>
#include <stdexcept>
#include <thread>
#include <vector>
@@ -46,7 +47,7 @@ using auto_lock_t = std::unique_lock<std::mutex>;
auto_lock_t _lk{ print_lock }; \
fprintf(stderr, "%s:%d :: HIP error : %s\n", __FILE__, __LINE__, \
hipGetErrorString(error_)); \
exit(EXIT_FAILURE); \
throw std::runtime_error("hip_api_call"); \
} \
}
@@ -58,7 +59,7 @@ check_hip_error(void)
{
auto_lock_t _lk{ print_lock };
std::cerr << "Error: " << hipGetErrorString(err) << std::endl;
exit(err);
throw std::runtime_error("hip_api_call");
}
}