Fix finalization segfaults (#174)
- update timemory submodule with fixes to papi components and signals
update
[ROCm/rocprofiler-systems commit: 2a387f9099]
Этот коммит содержится в:
коммит произвёл
GitHub
родитель
e1de27dde7
Коммит
45e5450bf2
поставляемый
+1
-1
Submodule projects/rocprofiler-systems/external/timemory updated: a3f0a917ab...46f25fbb46
@@ -29,8 +29,8 @@
|
||||
#include <timemory/hash.hpp>
|
||||
#include <timemory/log/macros.hpp>
|
||||
#include <timemory/manager.hpp>
|
||||
#include <timemory/sampling/signals.hpp>
|
||||
#include <timemory/settings.hpp>
|
||||
#include <timemory/signals/signal_mask.hpp>
|
||||
#include <timemory/utility/console.hpp>
|
||||
#include <timemory/utility/demangle.hpp>
|
||||
#include <timemory/utility/signals.hpp>
|
||||
@@ -202,8 +202,8 @@ int
|
||||
main(int argc, char** argv)
|
||||
{
|
||||
{
|
||||
using signal_settings = tim::signal_settings;
|
||||
using sys_signal = tim::sys_signal;
|
||||
using signal_settings = tim::signals::signal_settings;
|
||||
using sys_signal = tim::signals::sys_signal;
|
||||
|
||||
// default signals to catch
|
||||
for(const auto& itr :
|
||||
@@ -239,7 +239,7 @@ main(int argc, char** argv)
|
||||
|
||||
signal_settings::set_exit_action(_exit_action);
|
||||
signal_settings::check_environment();
|
||||
tim::enable_signal_detection(signal_settings::get_enabled());
|
||||
tim::signals::enable_signal_detection(signal_settings::get_enabled());
|
||||
}
|
||||
|
||||
argv0 = argv[0];
|
||||
|
||||
@@ -54,7 +54,7 @@
|
||||
#include <timemory/hash/types.hpp>
|
||||
#include <timemory/manager/manager.hpp>
|
||||
#include <timemory/operations/types/file_output_message.hpp>
|
||||
#include <timemory/sampling/signals.hpp>
|
||||
#include <timemory/signals/signal_mask.hpp>
|
||||
#include <timemory/settings/types.hpp>
|
||||
#include <timemory/utility/backtrace.hpp>
|
||||
#include <timemory/utility/procfs/maps.hpp>
|
||||
@@ -585,8 +585,8 @@ omnitrace_finalize_hidden(void)
|
||||
|
||||
thread_info::set_stop(comp::wall_clock::record());
|
||||
|
||||
tim::sampling::block_signals(get_sampling_signals(),
|
||||
tim::sampling::sigmask_scope::process);
|
||||
tim::signals::block_signals(get_sampling_signals(),
|
||||
tim::signals::sigmask_scope::process);
|
||||
|
||||
// some functions called during finalization may alter the push/pop count so we need
|
||||
// to save them here
|
||||
|
||||
+3
-3
@@ -32,7 +32,7 @@
|
||||
#include <timemory/backends/mpi.hpp>
|
||||
#include <timemory/backends/process.hpp>
|
||||
#include <timemory/mpl/types.hpp>
|
||||
#include <timemory/sampling/signals.hpp>
|
||||
#include <timemory/signals/signal_mask.hpp>
|
||||
#include <timemory/utility/locking.hpp>
|
||||
|
||||
#include <cstdint>
|
||||
@@ -114,7 +114,7 @@ omnitrace_mpi_set_attr()
|
||||
OMNITRACE_DEBUG("MPI Comm attribute finalize\n");
|
||||
auto _blocked = get_sampling_signals();
|
||||
if(!_blocked.empty())
|
||||
tim::sampling::block_signals(_blocked, tim::sampling::sigmask_scope::process);
|
||||
tim::signals::block_signals(_blocked, tim::signals::sigmask_scope::process);
|
||||
if(mpip_index != std::numeric_limits<uint64_t>::max())
|
||||
comp::deactivate_mpip<mpip_bundle_t, project::omnitrace>(mpip_index);
|
||||
omnitrace_finalize_hidden();
|
||||
@@ -249,7 +249,7 @@ mpi_gotcha::audit(const gotcha_data_t& _data, audit::incoming)
|
||||
|
||||
auto _blocked = get_sampling_signals();
|
||||
if(!_blocked.empty())
|
||||
tim::sampling::block_signals(_blocked, tim::sampling::sigmask_scope::process);
|
||||
tim::signals::block_signals(_blocked, tim::signals::sigmask_scope::process);
|
||||
|
||||
if(mpip_index != std::numeric_limits<uint64_t>::max())
|
||||
comp::deactivate_mpip<mpip_bundle_t, project::omnitrace>(mpip_index);
|
||||
|
||||
+2
-2
@@ -400,7 +400,7 @@ pthread_create_gotcha::operator()(pthread_t* thread, const pthread_attr_t* attr,
|
||||
if(_enable_sampling && !_blocked.empty())
|
||||
{
|
||||
OMNITRACE_DEBUG("blocking signals...\n");
|
||||
tim::sampling::block_signals(_blocked, tim::sampling::sigmask_scope::process);
|
||||
tim::signals::block_signals(_blocked, tim::signals::sigmask_scope::process);
|
||||
}
|
||||
|
||||
if(_use_bundle)
|
||||
@@ -425,7 +425,7 @@ pthread_create_gotcha::operator()(pthread_t* thread, const pthread_attr_t* attr,
|
||||
if(_enable_sampling && !_blocked.empty())
|
||||
{
|
||||
OMNITRACE_DEBUG("unblocking signals...\n");
|
||||
tim::sampling::unblock_signals(_blocked, tim::sampling::sigmask_scope::process);
|
||||
tim::signals::unblock_signals(_blocked, tim::signals::sigmask_scope::process);
|
||||
}
|
||||
|
||||
OMNITRACE_DEBUG("returning success...\n");
|
||||
|
||||
+8
-6
@@ -171,7 +171,7 @@ pthread_mutex_gotcha::operator()(uintptr_t&& _id, int (*_callee)(Args...),
|
||||
{
|
||||
using bundle_t = category_region<category::pthread>;
|
||||
|
||||
if(is_disabled())
|
||||
if(is_disabled() || m_protect)
|
||||
{
|
||||
if(!_callee)
|
||||
{
|
||||
@@ -225,7 +225,7 @@ int
|
||||
pthread_mutex_gotcha::operator()(int (*_callee)(pthread_mutex_t*),
|
||||
pthread_mutex_t* _mutex) const
|
||||
{
|
||||
if(m_protect) return (*_callee)(_mutex);
|
||||
if(get_state() != ::omnitrace::State::Active || m_protect) return (*_callee)(_mutex);
|
||||
return (*this)(reinterpret_cast<uintptr_t>(_mutex), _callee, _mutex);
|
||||
}
|
||||
|
||||
@@ -233,7 +233,7 @@ int
|
||||
pthread_mutex_gotcha::operator()(int (*_callee)(pthread_spinlock_t*),
|
||||
pthread_spinlock_t* _lock) const
|
||||
{
|
||||
if(m_protect) return (*_callee)(_lock);
|
||||
if(get_state() != ::omnitrace::State::Active || m_protect) return (*_callee)(_lock);
|
||||
return (*this)(reinterpret_cast<uintptr_t>(_lock), _callee, _lock);
|
||||
}
|
||||
|
||||
@@ -241,7 +241,7 @@ int
|
||||
pthread_mutex_gotcha::operator()(int (*_callee)(pthread_rwlock_t*),
|
||||
pthread_rwlock_t* _lock) const
|
||||
{
|
||||
if(m_protect) return (*_callee)(_lock);
|
||||
if(get_state() != ::omnitrace::State::Active || m_protect) return (*_callee)(_lock);
|
||||
return (*this)(reinterpret_cast<uintptr_t>(_lock), _callee, _lock);
|
||||
}
|
||||
|
||||
@@ -249,7 +249,8 @@ int
|
||||
pthread_mutex_gotcha::operator()(int (*_callee)(pthread_barrier_t*),
|
||||
pthread_barrier_t* _barrier) const
|
||||
{
|
||||
if(m_protect) return (*_callee)(_barrier);
|
||||
if(get_state() != ::omnitrace::State::Active || m_protect)
|
||||
return (*_callee)(_barrier);
|
||||
return (*this)(reinterpret_cast<uintptr_t>(_barrier), _callee, _barrier);
|
||||
}
|
||||
|
||||
@@ -257,7 +258,8 @@ int
|
||||
pthread_mutex_gotcha::operator()(int (*_callee)(pthread_t, void**), pthread_t _thr,
|
||||
void** _tinfo) const
|
||||
{
|
||||
if(m_protect) return (*_callee)(_thr, _tinfo);
|
||||
if(get_state() != ::omnitrace::State::Active || m_protect)
|
||||
return (*_callee)(_thr, _tinfo);
|
||||
return (*this)(static_cast<uintptr_t>(threading::get_id()), _callee, _thr, _tinfo);
|
||||
}
|
||||
|
||||
|
||||
+11
-11
@@ -137,7 +137,7 @@ roctracer::setup()
|
||||
};
|
||||
#endif
|
||||
|
||||
ROCTRACER_CALL(roctracer_set_properties(ACTIVITY_DOMAIN_HIP_API, nullptr));
|
||||
OMNITRACE_ROCTRACER_CALL(roctracer_set_properties(ACTIVITY_DOMAIN_HIP_API, nullptr));
|
||||
|
||||
// Allocating tracing pool
|
||||
roctracer_properties_t properties{};
|
||||
@@ -145,7 +145,7 @@ roctracer::setup()
|
||||
// properties.mode = 0x1000;
|
||||
properties.buffer_size = 0x100;
|
||||
properties.buffer_callback_fun = hip_activity_callback;
|
||||
ROCTRACER_CALL(roctracer_open_pool(&properties));
|
||||
OMNITRACE_ROCTRACER_CALL(roctracer_open_pool(&properties));
|
||||
|
||||
#if OMNITRACE_HIP_VERSION_MAJOR == 4 && OMNITRACE_HIP_VERSION_MINOR >= 4
|
||||
// HIP 4.5.0 has an invalid warning
|
||||
@@ -155,15 +155,15 @@ roctracer::setup()
|
||||
"invalid domain ID(4) in: roctracer_enable_activity()" };
|
||||
#endif
|
||||
|
||||
ROCTRACER_CALL(roctracer_enable_domain_callback(ACTIVITY_DOMAIN_HIP_API,
|
||||
hip_api_callback, nullptr));
|
||||
OMNITRACE_ROCTRACER_CALL(roctracer_enable_domain_callback(ACTIVITY_DOMAIN_HIP_API,
|
||||
hip_api_callback, nullptr));
|
||||
if(get_use_roctx())
|
||||
{
|
||||
ROCTRACER_CALL(roctracer_enable_domain_callback(ACTIVITY_DOMAIN_ROCTX,
|
||||
roctx_api_callback, nullptr));
|
||||
OMNITRACE_ROCTRACER_CALL(roctracer_enable_domain_callback(
|
||||
ACTIVITY_DOMAIN_ROCTX, roctx_api_callback, nullptr));
|
||||
}
|
||||
// Enable HIP activity tracing
|
||||
ROCTRACER_CALL(roctracer_enable_domain_activity(ACTIVITY_DOMAIN_HIP_OPS));
|
||||
OMNITRACE_ROCTRACER_CALL(roctracer_enable_domain_activity(ACTIVITY_DOMAIN_HIP_OPS));
|
||||
|
||||
// callback for HSA
|
||||
for(auto& itr : roctracer_setup_routines())
|
||||
@@ -212,19 +212,19 @@ roctracer::shutdown()
|
||||
};
|
||||
#endif
|
||||
|
||||
// ROCTRACER_CALL(roctracer_disable_domain_callback(ACTIVITY_DOMAIN_ROCTX));
|
||||
// OMNITRACE_ROCTRACER_CALL(roctracer_disable_domain_callback(ACTIVITY_DOMAIN_ROCTX));
|
||||
OMNITRACE_VERBOSE_F(
|
||||
2, "executing roctracer_disable_domain_callback(ACTIVITY_DOMAIN_HIP_API)...\n");
|
||||
ROCTRACER_CALL(roctracer_disable_domain_callback(ACTIVITY_DOMAIN_HIP_API));
|
||||
OMNITRACE_ROCTRACER_CALL(roctracer_disable_domain_callback(ACTIVITY_DOMAIN_HIP_API));
|
||||
|
||||
OMNITRACE_VERBOSE_F(
|
||||
2, "executing roctracer_disable_domain_activity(ACTIVITY_DOMAIN_HIP_OPS)...\n");
|
||||
ROCTRACER_CALL(roctracer_disable_domain_activity(ACTIVITY_DOMAIN_HIP_OPS));
|
||||
OMNITRACE_ROCTRACER_CALL(roctracer_disable_domain_activity(ACTIVITY_DOMAIN_HIP_OPS));
|
||||
|
||||
if(roctracer_activity_count() == 0)
|
||||
{
|
||||
OMNITRACE_VERBOSE_F(2, "executing roctracer_flush_activity()...\n");
|
||||
ROCTRACER_CALL(roctracer_flush_activity());
|
||||
OMNITRACE_ROCTRACER_CALL(roctracer_flush_activity());
|
||||
}
|
||||
else
|
||||
{
|
||||
|
||||
@@ -189,7 +189,7 @@ void
|
||||
finalize()
|
||||
{
|
||||
OMNITRACE_DEBUG("[omnitrace_finalize] Disabling signal handling...\n");
|
||||
tim::disable_signal_detection();
|
||||
tim::signals::disable_signal_detection();
|
||||
_settings_are_configured() = false;
|
||||
}
|
||||
|
||||
@@ -930,12 +930,12 @@ configure_signal_handler()
|
||||
|
||||
if(_config->get_enable_signal_handler())
|
||||
{
|
||||
using signal_settings = tim::signal_settings;
|
||||
using sys_signal = tim::sys_signal;
|
||||
tim::disable_signal_detection();
|
||||
using signal_settings = tim::signals::signal_settings;
|
||||
using sys_signal = tim::signals::sys_signal;
|
||||
tim::signals::disable_signal_detection();
|
||||
auto _exit_action = [](int nsig) {
|
||||
tim::sampling::block_signals(get_sampling_signals(),
|
||||
tim::sampling::sigmask_scope::process);
|
||||
tim::signals::block_signals(get_sampling_signals(),
|
||||
tim::signals::sigmask_scope::process);
|
||||
OMNITRACE_BASIC_PRINT(
|
||||
"Finalizing afer signal %i :: %s\n", nsig,
|
||||
signal_settings::str(static_cast<sys_signal>(nsig)).c_str());
|
||||
@@ -950,29 +950,27 @@ configure_signal_handler()
|
||||
if(_ignore_dyninst_trampoline)
|
||||
signal_settings::disable(static_cast<sys_signal>(_dyninst_trampoline_signal));
|
||||
auto enabled_signals = signal_settings::get_enabled();
|
||||
tim::enable_signal_detection(enabled_signals);
|
||||
tim::signals::enable_signal_detection(enabled_signals);
|
||||
}
|
||||
|
||||
if(_ignore_dyninst_trampoline)
|
||||
{
|
||||
using signal_handler_t = void (*)(int);
|
||||
static signal_handler_t _old_handler = nullptr;
|
||||
static auto _trampoline_handler = [](int _v) {
|
||||
if(_v == _dyninst_trampoline_signal)
|
||||
using signal_handler_t = void (*)(int);
|
||||
static auto _trampoline_handler = [](int _v) {
|
||||
if(get_verbose_env() >= 2)
|
||||
{
|
||||
auto _info =
|
||||
::tim::signal_settings::get_info(static_cast<tim::sys_signal>(_v));
|
||||
OMNITRACE_VERBOSE(
|
||||
2,
|
||||
"signal %s (%i) ignored (OMNITRACE_IGNORE_DYNINST_TRAMPOLINE=ON)\n",
|
||||
std::get<0>(_info).c_str(), _v);
|
||||
if(get_verbose_env() > 1 || get_debug_env())
|
||||
timemory_print_demangled_backtrace<64>();
|
||||
if(_old_handler) _old_handler(_v);
|
||||
::omnitrace::debug::flush();
|
||||
::omnitrace::debug::lock _debug_lk{};
|
||||
OMNITRACE_FPRINTF_STDERR_COLOR(warning);
|
||||
fprintf(::omnitrace::debug::get_file(),
|
||||
"signal %i ignored (OMNITRACE_IGNORE_DYNINST_TRAMPOLINE=ON)\n",
|
||||
_v);
|
||||
::omnitrace::debug::flush();
|
||||
timemory_print_demangled_backtrace<64>();
|
||||
}
|
||||
};
|
||||
_old_handler = signal(_dyninst_trampoline_signal,
|
||||
static_cast<signal_handler_t>(_trampoline_handler));
|
||||
::signal(_dyninst_trampoline_signal,
|
||||
static_cast<signal_handler_t>(_trampoline_handler));
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -353,7 +353,7 @@ get_chars(T&& _c, std::index_sequence<Idx...>)
|
||||
fprintf(::omnitrace::debug::get_file(), __VA_ARGS__); \
|
||||
::omnitrace::debug::flush(); \
|
||||
::omnitrace::set_state(::omnitrace::State::Finalized); \
|
||||
::tim::disable_signal_detection(); \
|
||||
::tim::signals::disable_signal_detection(); \
|
||||
timemory_print_demangled_backtrace<64>(); \
|
||||
METHOD; \
|
||||
}
|
||||
@@ -368,7 +368,7 @@ get_chars(T&& _c, std::index_sequence<Idx...>)
|
||||
fprintf(::omnitrace::debug::get_file(), __VA_ARGS__); \
|
||||
::omnitrace::debug::flush(); \
|
||||
::omnitrace::set_state(::omnitrace::State::Finalized); \
|
||||
::tim::disable_signal_detection(); \
|
||||
::tim::signals::disable_signal_detection(); \
|
||||
timemory_print_demangled_backtrace<64>(); \
|
||||
METHOD; \
|
||||
}
|
||||
@@ -385,7 +385,7 @@ get_chars(T&& _c, std::index_sequence<Idx...>)
|
||||
fprintf(::omnitrace::debug::get_file(), __VA_ARGS__); \
|
||||
::omnitrace::debug::flush(); \
|
||||
::omnitrace::set_state(::omnitrace::State::Finalized); \
|
||||
::tim::disable_signal_detection(); \
|
||||
::tim::signals::disable_signal_detection(); \
|
||||
timemory_print_demangled_backtrace<64>(); \
|
||||
METHOD; \
|
||||
}
|
||||
@@ -400,7 +400,7 @@ get_chars(T&& _c, std::index_sequence<Idx...>)
|
||||
fprintf(::omnitrace::debug::get_file(), __VA_ARGS__); \
|
||||
::omnitrace::debug::flush(); \
|
||||
::omnitrace::set_state(::omnitrace::State::Finalized); \
|
||||
::tim::disable_signal_detection(); \
|
||||
::tim::signals::disable_signal_detection(); \
|
||||
timemory_print_demangled_backtrace<64>(); \
|
||||
METHOD; \
|
||||
}
|
||||
|
||||
@@ -126,13 +126,7 @@ ompt_start_tool(unsigned int omp_version, const char* runtime_version)
|
||||
return 1; // success
|
||||
};
|
||||
|
||||
static auto ompt_finalize = [](ompt_data_t* tool_data) {
|
||||
if(_use_ompt)
|
||||
{
|
||||
TIMEMORY_PRINTF(stderr, "OpenMP-tools finalized\n\n");
|
||||
tim::consume_parameters(tool_data);
|
||||
}
|
||||
};
|
||||
static auto ompt_finalize = [](ompt_data_t*) {};
|
||||
|
||||
static auto data = ompt_start_tool_result_t{ ompt_initialize, ompt_finalize, { 0 } };
|
||||
return (ompt_start_tool_result_t*) &data;
|
||||
|
||||
@@ -49,9 +49,12 @@
|
||||
#define HIP_PROF_HIP_API_STRING 1
|
||||
|
||||
#include <roctracer_ext.h>
|
||||
#include <roctracer_hcc.h>
|
||||
#include <roctracer_hip.h>
|
||||
|
||||
#if OMNITRACE_HIP_VERSION < 50300
|
||||
# include <roctracer_hcc.h>
|
||||
#endif
|
||||
|
||||
#define AMD_INTERNAL_BUILD 1
|
||||
#include <roctracer_hsa.h>
|
||||
|
||||
@@ -186,9 +189,6 @@ extern "C"
|
||||
OMNITRACE_VERBOSE(1 || rocm::on_load_trace,
|
||||
"[OnLoad] setting up HSA...\n");
|
||||
|
||||
// const char* output_prefix = getenv("ROCP_OUTPUT_DIR");
|
||||
const char* output_prefix = nullptr;
|
||||
|
||||
bool trace_hsa_api = get_trace_hsa_api();
|
||||
|
||||
// Enable HSA API callbacks/activity
|
||||
@@ -206,9 +206,9 @@ extern "C"
|
||||
{
|
||||
uint32_t cid = HSA_API_ID_NUMBER;
|
||||
const char* api = itr.c_str();
|
||||
ROCTRACER_CALL(roctracer_op_code(ACTIVITY_DOMAIN_HSA_API, api,
|
||||
&cid, nullptr));
|
||||
ROCTRACER_CALL(roctracer_enable_op_callback(
|
||||
OMNITRACE_ROCTRACER_CALL(roctracer_op_code(
|
||||
ACTIVITY_DOMAIN_HSA_API, api, &cid, nullptr));
|
||||
OMNITRACE_ROCTRACER_CALL(roctracer_enable_op_callback(
|
||||
ACTIVITY_DOMAIN_HSA_API, cid, hsa_api_callback, nullptr));
|
||||
|
||||
OMNITRACE_VERBOSE(1 || rocm::on_load_trace,
|
||||
@@ -218,7 +218,7 @@ extern "C"
|
||||
else
|
||||
{
|
||||
OMNITRACE_VERBOSE(1 || rocm::on_load_trace, " HSA-trace()\n");
|
||||
ROCTRACER_CALL(roctracer_enable_domain_callback(
|
||||
OMNITRACE_ROCTRACER_CALL(roctracer_enable_domain_callback(
|
||||
ACTIVITY_DOMAIN_HSA_API, hsa_api_callback, nullptr));
|
||||
}
|
||||
}
|
||||
@@ -227,19 +227,30 @@ extern "C"
|
||||
// Enable HSA GPU activity
|
||||
if(trace_hsa_activity)
|
||||
{
|
||||
#if OMNITRACE_HIP_VERSION < 50300
|
||||
using namespace roctracer;
|
||||
// initialize HSA tracing
|
||||
::roctracer::hsa_ops_properties_t ops_properties{
|
||||
const char* output_prefix = nullptr;
|
||||
hsa_ops_properties_t ops_properties{
|
||||
table,
|
||||
reinterpret_cast<activity_async_callback_t>(
|
||||
hsa_activity_callback),
|
||||
nullptr, output_prefix
|
||||
};
|
||||
#else
|
||||
hsa_ops_properties_t ops_properties;
|
||||
ops_properties.table = table;
|
||||
ops_properties.reserved1[0] =
|
||||
reinterpret_cast<void*>(&hsa_activity_callback);
|
||||
ops_properties.reserved1[1] = nullptr;
|
||||
ops_properties.reserved1[2] = nullptr;
|
||||
#endif
|
||||
roctracer_set_properties(ACTIVITY_DOMAIN_HSA_OPS, &ops_properties);
|
||||
|
||||
OMNITRACE_VERBOSE(1 || rocm::on_load_trace,
|
||||
" HSA-activity-trace()\n");
|
||||
ROCTRACER_CALL(roctracer_enable_op_activity(ACTIVITY_DOMAIN_HSA_OPS,
|
||||
HSA_OP_ID_COPY));
|
||||
OMNITRACE_ROCTRACER_CALL(roctracer_enable_op_activity(
|
||||
ACTIVITY_DOMAIN_HSA_OPS, HSA_OP_ID_COPY));
|
||||
}
|
||||
} catch(std::exception& _e)
|
||||
{
|
||||
@@ -250,16 +261,19 @@ extern "C"
|
||||
|
||||
static auto _shutdown = []() {
|
||||
OMNITRACE_DEBUG_F("roctracer_disable_domain_callback\n");
|
||||
ROCTRACER_CALL(roctracer_disable_domain_callback(ACTIVITY_DOMAIN_HSA_API));
|
||||
OMNITRACE_ROCTRACER_CALL(
|
||||
roctracer_disable_domain_callback(ACTIVITY_DOMAIN_HSA_API));
|
||||
|
||||
OMNITRACE_DEBUG_F("roctracer_disable_op_activity\n");
|
||||
ROCTRACER_CALL(
|
||||
OMNITRACE_ROCTRACER_CALL(
|
||||
roctracer_disable_op_activity(ACTIVITY_DOMAIN_HSA_OPS, HSA_OP_ID_COPY));
|
||||
};
|
||||
|
||||
#if OMNITRACE_HIP_VERSION < 50300
|
||||
OMNITRACE_VERBOSE_F(1 || rocm::on_load_trace,
|
||||
"Computing the roctracer clock skew...\n");
|
||||
(void) omnitrace::get_clock_skew();
|
||||
#endif
|
||||
|
||||
comp::roctracer::add_setup("hsa", _setup);
|
||||
comp::roctracer::add_shutdown("hsa", _shutdown);
|
||||
|
||||
@@ -42,10 +42,13 @@
|
||||
#define HIP_PROF_HIP_API_STRING 1
|
||||
|
||||
#include <roctracer_ext.h>
|
||||
#include <roctracer_hcc.h>
|
||||
#include <roctracer_hip.h>
|
||||
#include <roctracer_roctx.h>
|
||||
|
||||
#if OMNITRACE_HIP_VERSION < 50300
|
||||
# include <roctracer_hcc.h>
|
||||
#endif
|
||||
|
||||
#define AMD_INTERNAL_BUILD 1
|
||||
#include <roctracer_hsa.h>
|
||||
|
||||
@@ -59,7 +62,6 @@
|
||||
TIMEMORY_DEFINE_API(roctracer)
|
||||
namespace omnitrace
|
||||
{
|
||||
namespace api = tim::api;
|
||||
namespace
|
||||
{
|
||||
std::string
|
||||
@@ -180,7 +182,7 @@ get_clock_skew()
|
||||
static auto _gpu_now = []() {
|
||||
cpu::fence();
|
||||
uint64_t _ts = 0;
|
||||
ROCTRACER_CALL(roctracer_get_timestamp(&_ts));
|
||||
OMNITRACE_ROCTRACER_CALL(roctracer_get_timestamp(&_ts));
|
||||
return _ts;
|
||||
};
|
||||
|
||||
@@ -400,7 +402,7 @@ hsa_activity_callback(uint32_t op, activity_record_t* record, void* arg)
|
||||
void
|
||||
hip_exec_activity_callbacks(int64_t _tid)
|
||||
{
|
||||
// ROCTRACER_CALL(roctracer_flush_activity());
|
||||
// OMNITRACE_ROCTRACER_CALL(roctracer_flush_activity());
|
||||
tim::auto_lock_t _lk{ get_hip_activity_mutex(_tid) };
|
||||
auto& _async_ops = get_hip_activity_callbacks(_tid);
|
||||
if(!_async_ops) return;
|
||||
@@ -804,7 +806,7 @@ hip_activity_callback(const char* begin, const char* end, void*)
|
||||
reinterpret_cast<const roctracer_record_t*>(end);
|
||||
|
||||
auto&& _advance_record = [&record]() {
|
||||
ROCTRACER_CALL(roctracer_next_record(record, &record));
|
||||
OMNITRACE_ROCTRACER_CALL(roctracer_next_record(record, &record));
|
||||
};
|
||||
|
||||
while(record < end_record)
|
||||
|
||||
@@ -34,7 +34,7 @@
|
||||
#include <memory>
|
||||
|
||||
// Macro to check ROC-tracer calls status
|
||||
#define ROCTRACER_CALL(call) \
|
||||
#define OMNITRACE_ROCTRACER_CALL(call) \
|
||||
{ \
|
||||
OMNITRACE_DEBUG_F(#call); \
|
||||
int err = call; \
|
||||
|
||||
@@ -137,8 +137,8 @@ get_signal_names(Tp&& _v)
|
||||
{
|
||||
std::string _sig_names{};
|
||||
for(auto&& itr : _v)
|
||||
_sig_names += std::get<0>(tim::signal_settings::get_info(
|
||||
static_cast<tim::sys_signal>(itr))) +
|
||||
_sig_names += std::get<0>(tim::signals::signal_settings::get_info(
|
||||
static_cast<tim::signals::sys_signal>(itr))) +
|
||||
" ";
|
||||
return (_sig_names.empty()) ? _sig_names
|
||||
: _sig_names.substr(0, _sig_names.length() - 1);
|
||||
|
||||
Ссылка в новой задаче
Block a user