Support for building PAPI via a submodule (#41)
* Enable building PAPI via submodule * Miscellaneous fixes - Use TIMEMORY_PAPI_ARRAY_SIZE in backtrace - remove pthread_gotcha init from fork_gotcha::configure - fix HSA OnLoad called during before tooling init * PAPI array size + PAPI.cmake updates - updated timemory submodule with PAPI updates - fix for backtrace _hw_cnt_labels * Disable OMPT for focal * format
This commit is contained in:
committed by
GitHub
parent
e24c24dc56
commit
d98e60a17f
@@ -30,6 +30,7 @@
|
||||
|
||||
#include <timemory/components/base.hpp>
|
||||
#include <timemory/components/papi/papi_array.hpp>
|
||||
#include <timemory/components/papi/types.hpp>
|
||||
#include <timemory/macros/language.hpp>
|
||||
#include <timemory/mpl/concepts.hpp>
|
||||
#include <timemory/sampling/sampler.hpp>
|
||||
@@ -50,7 +51,7 @@ struct backtrace
|
||||
: tim::component::empty_base
|
||||
, tim::concepts::component
|
||||
{
|
||||
static constexpr size_t num_hw_counters = 8;
|
||||
static constexpr size_t num_hw_counters = TIMEMORY_PAPI_ARRAY_SIZE;
|
||||
|
||||
using data_t = std::array<char[512], 128>;
|
||||
using clock_type = std::chrono::steady_clock;
|
||||
|
||||
@@ -478,9 +478,10 @@ omnitrace_init_library_hidden()
|
||||
}
|
||||
|
||||
tim::trait::runtime_enabled<comp::roctracer>::set(get_use_roctracer());
|
||||
tim::trait::runtime_enabled<comp::roctracer_data>::set(get_use_roctracer());
|
||||
tim::trait::runtime_enabled<comp::roctracer_data>::set(get_use_roctracer() &&
|
||||
get_use_timemory());
|
||||
|
||||
if(get_instrumentation_interval() < 1) get_instrumentation_interval() = 1;
|
||||
get_instrumentation_interval() = std::max<size_t>(get_instrumentation_interval(), 1);
|
||||
|
||||
if(get_use_kokkosp())
|
||||
{
|
||||
@@ -1146,25 +1147,25 @@ omnitrace_finalize_hidden(void)
|
||||
OMNITRACE_DEBUG_F("Finalizing timemory...\n");
|
||||
tim::timemory_finalize();
|
||||
|
||||
OMNITRACE_DEBUG_F("Disabling signal handling...\n");
|
||||
tim::disable_signal_detection();
|
||||
|
||||
OMNITRACE_DEBUG_F("Finalized\n");
|
||||
|
||||
if(_perfetto_output_error)
|
||||
{
|
||||
OMNITRACE_THROW("Error opening perfetto output file: %s",
|
||||
get_perfetto_output_filename().c_str());
|
||||
}
|
||||
|
||||
OMNITRACE_CONDITIONAL_THROW(
|
||||
get_is_continuous_integration() && _push_count > _pop_count, "%s",
|
||||
OMNITRACE_CI_THROW(
|
||||
_push_count > _pop_count, "%s",
|
||||
TIMEMORY_JOIN(" ",
|
||||
"omnitrace_push_trace was called more times than "
|
||||
"omnitrace_pop_trace. The inverse is fine but the current state "
|
||||
"means not every measurement was ended :: pushed:",
|
||||
_push_count, "vs. popped:", _pop_count)
|
||||
.c_str());
|
||||
|
||||
OMNITRACE_DEBUG_F("Disabling signal handling...\n");
|
||||
tim::disable_signal_detection();
|
||||
|
||||
OMNITRACE_PRINT_F("Finalized\n");
|
||||
}
|
||||
|
||||
//======================================================================================//
|
||||
|
||||
@@ -472,7 +472,7 @@ backtrace::post_process(int64_t _tid)
|
||||
using common_type_t = typename hw_counters::common_type;
|
||||
auto _hw_cnt_labels = (get_papi_vector(_tid))
|
||||
? comp::papi_common::get_events<common_type_t>()
|
||||
: std::vector<int>{};
|
||||
: std::vector<std::string>{};
|
||||
|
||||
auto _process_perfetto_counters = [&](const std::vector<sampling::bundle_t*>& _data) {
|
||||
if(!perfetto_counter_track<comp::peak_rss>::exists(_tid))
|
||||
|
||||
@@ -32,10 +32,6 @@ fork_gotcha::configure()
|
||||
fork_gotcha_t::get_initializer() = []() {
|
||||
TIMEMORY_C_GOTCHA(fork_gotcha_t, 0, fork);
|
||||
};
|
||||
|
||||
pthread_gotcha_t::get_initializer() = []() {
|
||||
TIMEMORY_C_GOTCHA(pthread_gotcha_t, 0, pthread_create);
|
||||
};
|
||||
}
|
||||
|
||||
void
|
||||
|
||||
@@ -103,8 +103,6 @@ roctracer::remove_shutdown(const std::string& _lbl)
|
||||
void
|
||||
roctracer::setup()
|
||||
{
|
||||
trait::runtime_enabled<roctracer_data>::set(get_use_timemory());
|
||||
|
||||
if(!get_use_roctracer()) return;
|
||||
|
||||
auto_lock_t _lk{ type_mutex<roctracer>() };
|
||||
|
||||
@@ -674,6 +674,9 @@ roctracer_shutdown_routines()
|
||||
|
||||
using namespace omnitrace;
|
||||
|
||||
extern "C" bool
|
||||
omnitrace_init_tooling_hidden() OMNITRACE_HIDDEN_API;
|
||||
|
||||
// HSA-runtime tool on-load method
|
||||
extern "C"
|
||||
{
|
||||
@@ -690,6 +693,8 @@ extern "C"
|
||||
tim::consume_parameters(table, runtime_version, failed_tool_count,
|
||||
failed_tool_names);
|
||||
|
||||
if(get_state() < State::Active) omnitrace_init_tooling_hidden();
|
||||
|
||||
auto _setup = [=]() {
|
||||
try
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user