Resolve warnings/errors with extra warnings (#171)
This commit is contained in:
committed by
GitHub
parent
2ed818449f
commit
4e3527f0ed
@@ -187,7 +187,7 @@ setup_environ(int _verbose, const std::string& _search_paths = {},
|
||||
if(_omp_libs != nullptr &&
|
||||
std::string_view{ _omp_libs }.find(_omnilib_dl) == std::string::npos)
|
||||
_omni_omp_libs = common::join(':', _omp_libs, _omnilib_dl);
|
||||
OMNITRACE_SETUP_LOG(_verbose >= 1, "setting OMP_TOOL_LIBRARIES to '%s'\n",
|
||||
OMNITRACE_SETUP_LOG(_verbose >= 2, "setting OMP_TOOL_LIBRARIES to '%s'\n",
|
||||
_omni_omp_libs.c_str());
|
||||
setenv("OMP_TOOL_LIBRARIES", _omni_omp_libs.c_str(), 1);
|
||||
#endif
|
||||
|
||||
@@ -85,36 +85,39 @@ auto
|
||||
ensure_finalization(bool _static_init = false)
|
||||
{
|
||||
const auto& _info = thread_info::init();
|
||||
auto _tid = _info->index_data;
|
||||
OMNITRACE_CI_THROW(_tid->sequent_value != threading::get_id(),
|
||||
"Error! internal tid != %li :: %li", threading::get_id(),
|
||||
_tid->sequent_value);
|
||||
OMNITRACE_CI_THROW(_tid->system_value != threading::get_sys_tid(),
|
||||
"Error! system tid != %li :: %li", threading::get_sys_tid(),
|
||||
_tid->system_value);
|
||||
const auto& _tid = _info->index_data;
|
||||
if(_tid)
|
||||
{
|
||||
OMNITRACE_CI_THROW(_tid->sequent_value != threading::get_id(),
|
||||
"Error! internal tid != %li :: %li", threading::get_id(),
|
||||
_tid->sequent_value);
|
||||
OMNITRACE_CI_THROW(_tid->system_value != threading::get_sys_tid(),
|
||||
"Error! system tid != %li :: %li", threading::get_sys_tid(),
|
||||
_tid->system_value);
|
||||
}
|
||||
|
||||
if(!get_env("OMNITRACE_COLORIZED_LOG", true)) tim::log::colorized() = false;
|
||||
|
||||
(void) tim::manager::instance();
|
||||
(void) tim::settings::shared_instance();
|
||||
|
||||
if(!_static_init)
|
||||
if(_static_init)
|
||||
{
|
||||
OMNITRACE_DEBUG_F("\n");
|
||||
OMNITRACE_BASIC_DEBUG_F("\n");
|
||||
auto _verbose =
|
||||
get_verbose_env() + ((get_debug_env() || get_debug_init()) ? 16 : 0);
|
||||
auto _search_paths = JOIN(':', tim::get_env<std::string>("OMNITRACE_PATH", ""),
|
||||
tim::get_env<std::string>("PWD"), ".",
|
||||
tim::get_env<std::string>("LD_LIBRARY_PATH", ""),
|
||||
tim::get_env<std::string>("LIBRARY_PATH", ""),
|
||||
tim::get_env<std::string>("PATH", ""));
|
||||
common::setup_environ(_verbose, _search_paths);
|
||||
}
|
||||
else
|
||||
{
|
||||
OMNITRACE_BASIC_DEBUG_F("\n");
|
||||
OMNITRACE_DEBUG_F("\n");
|
||||
}
|
||||
|
||||
auto _verbose = get_verbose_env() + ((get_debug_env() || get_debug_init()) ? 16 : 0);
|
||||
auto _search_paths = JOIN(':', tim::get_env<std::string>("OMNITRACE_PATH", ""),
|
||||
tim::get_env<std::string>("PWD"), ".",
|
||||
tim::get_env<std::string>("LD_LIBRARY_PATH", ""),
|
||||
tim::get_env<std::string>("LIBRARY_PATH", ""),
|
||||
tim::get_env<std::string>("PATH", ""));
|
||||
common::setup_environ(_verbose, _search_paths);
|
||||
|
||||
return scope::destructor{ []() { omnitrace_finalize_hidden(); } };
|
||||
}
|
||||
|
||||
|
||||
@@ -88,6 +88,7 @@ public:
|
||||
operation::serialization<cpu_freq>{}(*this, _ar, _version);
|
||||
else
|
||||
_ar(tim::cereal::make_nvp("value", value));
|
||||
(void) _version;
|
||||
}
|
||||
|
||||
this_type& operator+=(const this_type& _rhs)
|
||||
|
||||
@@ -281,7 +281,7 @@ mpi_gotcha::audit(const gotcha_data_t& _data, audit::incoming, comm_t _comm, int
|
||||
else
|
||||
{
|
||||
OMNITRACE_BASIC_PRINT_F("%s(<comm>, %p) :: unexpected function wrapper\n",
|
||||
_data.tool_id.c_str(), _val);
|
||||
_data.tool_id.c_str(), static_cast<void*>(_val));
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -87,11 +87,6 @@ deactivate_rcclp(uint64_t id)
|
||||
void
|
||||
configure_rcclp(const std::set<std::string>& permit, const std::set<std::string>& reject)
|
||||
{
|
||||
static constexpr size_t rcclp_wrapper_count = OMNITRACE_NUM_RCCLP_WRAPPERS;
|
||||
|
||||
using rcclp_gotcha_t =
|
||||
tim::component::gotcha<rcclp_wrapper_count, rccl_toolset_t, category::rocm_rccl>;
|
||||
|
||||
static bool is_initialized = false;
|
||||
if(!is_initialized)
|
||||
{
|
||||
|
||||
@@ -94,7 +94,8 @@ rocm_event::rocm_event(uint32_t _dev, uint32_t _thr, uint32_t _queue,
|
||||
feature_values.emplace_back(rocm_feature_value{ p->data.result_int32 });
|
||||
break;
|
||||
case ROCPROFILER_DATA_KIND_FLOAT:
|
||||
feature_values.emplace_back(rocm_feature_value{ p->data.result_float });
|
||||
feature_values.emplace_back(
|
||||
rocm_feature_value{ static_cast<double>(p->data.result_float) });
|
||||
break;
|
||||
case ROCPROFILER_DATA_KIND_DOUBLE:
|
||||
feature_values.emplace_back(rocm_feature_value{ p->data.result_double });
|
||||
|
||||
@@ -53,7 +53,7 @@ namespace component
|
||||
{
|
||||
using rocm_metric_type = unsigned long long;
|
||||
using rocm_info_entry = ::tim::hardware_counters::info;
|
||||
using rocm_feature_value = std::variant<uint32_t, float, uint64_t, double>;
|
||||
using rocm_feature_value = std::variant<uint32_t, uint64_t, double>;
|
||||
|
||||
struct rocm_counter
|
||||
{
|
||||
|
||||
@@ -192,13 +192,13 @@ post_process()
|
||||
auto mitr = _cache.find(_v.address);
|
||||
if(mitr != _cache.end()) return std::make_pair(mitr->second, true);
|
||||
|
||||
for(auto itr = _tmp.begin(); itr != _tmp.end(); ++itr)
|
||||
for(auto titr = _tmp.begin(); titr != _tmp.end(); ++titr)
|
||||
{
|
||||
if(itr->source == _v.source && itr->address != _v.address &&
|
||||
itr->count == _v.count)
|
||||
if(titr->source == _v.source && titr->address != _v.address &&
|
||||
titr->count == _v.count)
|
||||
{
|
||||
_cache[_v.address] = itr;
|
||||
return std::make_pair(itr, true);
|
||||
_cache[_v.address] = titr;
|
||||
return std::make_pair(titr, true);
|
||||
}
|
||||
}
|
||||
return std::make_pair(_tmp.end(), false);
|
||||
|
||||
@@ -683,7 +683,7 @@ find(
|
||||
if(std::forward<FuncT>(_func)(_v, itr)) return &itr;
|
||||
}
|
||||
return nullptr;
|
||||
};
|
||||
}
|
||||
|
||||
template <typename FuncT = bool (*)(const entry&, const entry&)>
|
||||
inline entry*
|
||||
|
||||
@@ -196,7 +196,7 @@ get_chars(T&& _c, std::index_sequence<Idx...>)
|
||||
::omnitrace::config::get_debug_pid()) \
|
||||
{ \
|
||||
::omnitrace::debug::flush(); \
|
||||
::omnitrace::debug::lock _lk{}; \
|
||||
::omnitrace::debug::lock _debug_lk{}; \
|
||||
OMNITRACE_FPRINTF_STDERR_COLOR(info); \
|
||||
fprintf(::omnitrace::debug::get_file(), "[omnitrace][%i][%li]%s", \
|
||||
OMNITRACE_DEBUG_PROCESS_IDENTIFIER, OMNITRACE_DEBUG_THREAD_IDENTIFIER, \
|
||||
@@ -210,7 +210,7 @@ get_chars(T&& _c, std::index_sequence<Idx...>)
|
||||
::omnitrace::config::get_debug_pid()) \
|
||||
{ \
|
||||
::omnitrace::debug::flush(); \
|
||||
::omnitrace::debug::lock _lk{}; \
|
||||
::omnitrace::debug::lock _debug_lk{}; \
|
||||
OMNITRACE_FPRINTF_STDERR_COLOR(info); \
|
||||
fprintf(::omnitrace::debug::get_file(), "[omnitrace]%s", \
|
||||
::omnitrace::debug::is_bracket(__VA_ARGS__) ? "" : " "); \
|
||||
@@ -223,7 +223,7 @@ get_chars(T&& _c, std::index_sequence<Idx...>)
|
||||
::omnitrace::config::get_debug_pid()) \
|
||||
{ \
|
||||
::omnitrace::debug::flush(); \
|
||||
::omnitrace::debug::lock _lk{}; \
|
||||
::omnitrace::debug::lock _debug_lk{}; \
|
||||
OMNITRACE_FPRINTF_STDERR_COLOR(info); \
|
||||
fprintf(::omnitrace::debug::get_file(), "[omnitrace][%i][%li][%s]%s", \
|
||||
OMNITRACE_DEBUG_PROCESS_IDENTIFIER, OMNITRACE_DEBUG_THREAD_IDENTIFIER, \
|
||||
@@ -238,7 +238,7 @@ get_chars(T&& _c, std::index_sequence<Idx...>)
|
||||
::omnitrace::config::get_debug_pid()) \
|
||||
{ \
|
||||
::omnitrace::debug::flush(); \
|
||||
::omnitrace::debug::lock _lk{}; \
|
||||
::omnitrace::debug::lock _debug_lk{}; \
|
||||
OMNITRACE_FPRINTF_STDERR_COLOR(info); \
|
||||
fprintf(::omnitrace::debug::get_file(), "[omnitrace][%s]%s", OMNITRACE_FUNCTION, \
|
||||
::omnitrace::debug::is_bracket(__VA_ARGS__) ? "" : " "); \
|
||||
@@ -253,7 +253,7 @@ get_chars(T&& _c, std::index_sequence<Idx...>)
|
||||
::omnitrace::config::get_debug_pid()) \
|
||||
{ \
|
||||
::omnitrace::debug::flush(); \
|
||||
::omnitrace::debug::lock _lk{}; \
|
||||
::omnitrace::debug::lock _debug_lk{}; \
|
||||
OMNITRACE_FPRINTF_STDERR_COLOR(warning); \
|
||||
fprintf(::omnitrace::debug::get_file(), "[omnitrace][%i][%li]%s", \
|
||||
OMNITRACE_DEBUG_PROCESS_IDENTIFIER, OMNITRACE_DEBUG_THREAD_IDENTIFIER, \
|
||||
@@ -267,7 +267,7 @@ get_chars(T&& _c, std::index_sequence<Idx...>)
|
||||
::omnitrace::config::get_debug_pid()) \
|
||||
{ \
|
||||
::omnitrace::debug::flush(); \
|
||||
::omnitrace::debug::lock _lk{}; \
|
||||
::omnitrace::debug::lock _debug_lk{}; \
|
||||
OMNITRACE_FPRINTF_STDERR_COLOR(warning); \
|
||||
fprintf(::omnitrace::debug::get_file(), "[omnitrace]%s", \
|
||||
::omnitrace::debug::is_bracket(__VA_ARGS__) ? "" : " "); \
|
||||
@@ -280,7 +280,7 @@ get_chars(T&& _c, std::index_sequence<Idx...>)
|
||||
::omnitrace::config::get_debug_pid()) \
|
||||
{ \
|
||||
::omnitrace::debug::flush(); \
|
||||
::omnitrace::debug::lock _lk{}; \
|
||||
::omnitrace::debug::lock _debug_lk{}; \
|
||||
OMNITRACE_FPRINTF_STDERR_COLOR(warning); \
|
||||
fprintf(::omnitrace::debug::get_file(), "[omnitrace][%i][%li][%s]%s", \
|
||||
OMNITRACE_DEBUG_PROCESS_IDENTIFIER, OMNITRACE_DEBUG_THREAD_IDENTIFIER, \
|
||||
@@ -295,7 +295,7 @@ get_chars(T&& _c, std::index_sequence<Idx...>)
|
||||
::omnitrace::config::get_debug_pid()) \
|
||||
{ \
|
||||
::omnitrace::debug::flush(); \
|
||||
::omnitrace::debug::lock _lk{}; \
|
||||
::omnitrace::debug::lock _debug_lk{}; \
|
||||
OMNITRACE_FPRINTF_STDERR_COLOR(warning); \
|
||||
fprintf(::omnitrace::debug::get_file(), "[omnitrace][%s]%s", OMNITRACE_FUNCTION, \
|
||||
::omnitrace::debug::is_bracket(__VA_ARGS__) ? "" : " "); \
|
||||
|
||||
@@ -284,8 +284,8 @@ data::post_process(uint32_t _dev_id)
|
||||
|
||||
#if !defined(TIMEMORY_USE_MPI)
|
||||
// timemory + MPI here causes hangs for some reason. it is unclear why
|
||||
using bundle_t = tim::lightweight_tuple<sampling_gpu_busy, sampling_gpu_temp,
|
||||
sampling_gpu_power, sampling_gpu_memory>;
|
||||
using samp_bundle_t = tim::lightweight_tuple<sampling_gpu_busy, sampling_gpu_temp,
|
||||
sampling_gpu_power, sampling_gpu_memory>;
|
||||
|
||||
for(auto& itr : _rocm_smi)
|
||||
{
|
||||
@@ -297,7 +297,7 @@ data::post_process(uint32_t _dev_id)
|
||||
return _e.device == critical_trace::Device::GPU;
|
||||
});
|
||||
|
||||
std::vector<bundle_t> _tc{};
|
||||
std::vector<samp_bundle_t> _tc{};
|
||||
_tc.reserve(_entries.size());
|
||||
for(auto& eitr : _entries)
|
||||
{
|
||||
|
||||
@@ -580,9 +580,9 @@ post_process_perfetto()
|
||||
|
||||
for(size_t i = 0; i < _values.size(); ++i)
|
||||
{
|
||||
auto _trace_counter = [_dev_id, i, _ts](auto&& _v) {
|
||||
auto _trace_counter = [_dev_id, i, _ts](auto&& _val) {
|
||||
TRACE_COUNTER("kernel_hardware_counter",
|
||||
counter_track::at(_dev_id, i), _ts, _v);
|
||||
counter_track::at(_dev_id, i), _ts, _val);
|
||||
};
|
||||
std::visit(_trace_counter, _values.at(i));
|
||||
}
|
||||
|
||||
@@ -179,9 +179,9 @@ get_clock_skew()
|
||||
|
||||
static auto _gpu_now = []() {
|
||||
cpu::fence();
|
||||
uint64_t _v = 0;
|
||||
ROCTRACER_CALL(roctracer_get_timestamp(&_v));
|
||||
return _v;
|
||||
uint64_t _ts = 0;
|
||||
ROCTRACER_CALL(roctracer_get_timestamp(&_ts));
|
||||
return _ts;
|
||||
};
|
||||
|
||||
do
|
||||
@@ -741,8 +741,8 @@ hip_api_callback(uint32_t domain, uint32_t cid, const void* callback_data, void*
|
||||
}
|
||||
if(get_use_timemory())
|
||||
{
|
||||
auto _stop = [&_corr_id](int64_t _tid) {
|
||||
auto& _data = get_roctracer_hip_data(_tid);
|
||||
auto _stop = [&_corr_id](int64_t _tid_v) {
|
||||
auto& _data = get_roctracer_hip_data(_tid_v);
|
||||
auto itr = _data->find(_corr_id);
|
||||
if(itr != get_roctracer_hip_data()->end())
|
||||
{
|
||||
|
||||
@@ -588,7 +588,7 @@ post_process_perfetto(int64_t _tid, const bundle_t* _init,
|
||||
}
|
||||
|
||||
auto _process_perfetto = [_tid,
|
||||
_init](const std::vector<sampling::bundle_t*>& _data) {
|
||||
_init](const std::vector<sampling::bundle_t*>& _data_v) {
|
||||
thread_info::init(true);
|
||||
OMNITRACE_VERBOSE(3 || get_debug_sampling(),
|
||||
"[%li] Post-processing backtraces for perfetto...\n", _tid);
|
||||
@@ -608,7 +608,7 @@ post_process_perfetto(int64_t _tid, const bundle_t* _init,
|
||||
|
||||
auto _as_hex = [](auto _v) { return JOIN("", "0x", std::hex, _v); };
|
||||
|
||||
for(const auto& itr : _data)
|
||||
for(const auto& itr : _data_v)
|
||||
{
|
||||
const auto* _bt_ts = itr->get<backtrace_timestamp>();
|
||||
const auto* _bt_cs = itr->get<backtrace>();
|
||||
@@ -617,9 +617,9 @@ post_process_perfetto(int64_t _tid, const bundle_t* _init,
|
||||
if(_bt_ts->get_tid() != _tid) continue;
|
||||
|
||||
static std::set<std::string> _static_strings{};
|
||||
for(const auto& itr : backtrace::filter_and_patch(_bt_cs->get()))
|
||||
for(const auto& iitr : backtrace::filter_and_patch(_bt_cs->get()))
|
||||
{
|
||||
const auto* _name = _static_strings.emplace(itr.name).first->c_str();
|
||||
const auto* _name = _static_strings.emplace(iitr.name).first->c_str();
|
||||
uint64_t _beg = _last_ts;
|
||||
uint64_t _end = _bt_ts->get_timestamp();
|
||||
if(!_thread_info->is_valid_lifetime({ _beg, _end })) continue;
|
||||
@@ -627,14 +627,15 @@ post_process_perfetto(int64_t _tid, const bundle_t* _init,
|
||||
tracing::push_perfetto_ts(
|
||||
category::sampling{}, _name, _beg, [&](perfetto::EventContext ctx) {
|
||||
tracing::add_perfetto_annotation(ctx, "begin_ns", _beg);
|
||||
tracing::add_perfetto_annotation(ctx, "file", itr.location);
|
||||
tracing::add_perfetto_annotation(ctx, "pc", _as_hex(itr.address));
|
||||
tracing::add_perfetto_annotation(ctx, "file", iitr.location);
|
||||
tracing::add_perfetto_annotation(ctx, "pc",
|
||||
_as_hex(iitr.address));
|
||||
tracing::add_perfetto_annotation(ctx, "line_address",
|
||||
_as_hex(itr.line_address));
|
||||
if(itr.lineinfo)
|
||||
_as_hex(iitr.line_address));
|
||||
if(iitr.lineinfo)
|
||||
{
|
||||
size_t _n = 0;
|
||||
for(const auto& litr : itr.lineinfo.lines)
|
||||
for(const auto& litr : iitr.lineinfo.lines)
|
||||
{
|
||||
auto _label = JOIN('-', "lineinfo", _n++);
|
||||
tracing::add_perfetto_annotation(
|
||||
@@ -706,9 +707,9 @@ post_process_timemory(int64_t _tid, const bundle_t* _init,
|
||||
_tc.reserve(_bt_data->size());
|
||||
|
||||
// generate the instances of the tuple of components and start them
|
||||
for(const auto& itr : backtrace::filter_and_patch(_bt_data->get()))
|
||||
for(const auto& iitr : backtrace::filter_and_patch(_bt_data->get()))
|
||||
{
|
||||
_tc.emplace_back(tim::string_view_t{ itr.name });
|
||||
_tc.emplace_back(tim::string_view_t{ iitr.name });
|
||||
_tc.back().push(_bt_time->get_tid());
|
||||
_tc.back().start();
|
||||
}
|
||||
@@ -716,13 +717,13 @@ post_process_timemory(int64_t _tid, const bundle_t* _init,
|
||||
// stop the instances and update the values as needed
|
||||
for(size_t i = 0; i < _tc.size(); ++i)
|
||||
{
|
||||
auto& itr = _tc.at(_tc.size() - i - 1);
|
||||
auto& iitr = _tc.at(_tc.size() - i - 1);
|
||||
size_t _depth = 0;
|
||||
_depth_sum[_bt_time->get_tid()][_depth] += 1;
|
||||
itr.stop();
|
||||
iitr.stop();
|
||||
if constexpr(tim::trait::is_available<sampling_wall_clock>::value)
|
||||
{
|
||||
auto* _sc = itr.get<sampling_wall_clock>();
|
||||
auto* _sc = iitr.get<sampling_wall_clock>();
|
||||
if(_sc)
|
||||
{
|
||||
auto _value = _elapsed_wc / sampling_wall_clock::get_unit();
|
||||
@@ -732,7 +733,7 @@ post_process_timemory(int64_t _tid, const bundle_t* _init,
|
||||
}
|
||||
if constexpr(tim::trait::is_available<sampling_cpu_clock>::value)
|
||||
{
|
||||
auto* _cc = itr.get<sampling_cpu_clock>();
|
||||
auto* _cc = iitr.get<sampling_cpu_clock>();
|
||||
if(_cc)
|
||||
{
|
||||
_cc->set_value(_elapsed_cc / sampling_cpu_clock::get_unit());
|
||||
@@ -753,14 +754,14 @@ post_process_timemory(int64_t _tid, const bundle_t* _init,
|
||||
_last->get<backtrace_metrics>()->get_hw_counters()[k];
|
||||
}
|
||||
}
|
||||
auto* _hw_counter = itr.get<hw_counters>();
|
||||
auto* _hw_counter = iitr.get<hw_counters>();
|
||||
if(_hw_counter)
|
||||
{
|
||||
_hw_counter->set_value(_hw_cnt_vals);
|
||||
_hw_counter->set_accum(_hw_cnt_vals);
|
||||
}
|
||||
}
|
||||
itr.pop();
|
||||
iitr.pop();
|
||||
}
|
||||
_last = itr;
|
||||
}
|
||||
@@ -780,9 +781,9 @@ post_process_timemory(int64_t _tid, const bundle_t* _init,
|
||||
_tc.reserve(_bt_data->size());
|
||||
|
||||
// generate the instances of the tuple of components and start them
|
||||
for(const auto& itr : backtrace::filter_and_patch(_bt_data->get()))
|
||||
for(const auto& iitr : backtrace::filter_and_patch(_bt_data->get()))
|
||||
{
|
||||
_tc.emplace_back(tim::string_view_t{ itr.name });
|
||||
_tc.emplace_back(tim::string_view_t{ iitr.name });
|
||||
_tc.back().push(_bt_time->get_tid());
|
||||
_tc.back().start();
|
||||
}
|
||||
@@ -790,12 +791,12 @@ post_process_timemory(int64_t _tid, const bundle_t* _init,
|
||||
// stop the instances and update the values as needed
|
||||
for(size_t i = 0; i < _tc.size(); ++i)
|
||||
{
|
||||
auto& itr = _tc.at(_tc.size() - i - 1);
|
||||
auto& iitr = _tc.at(_tc.size() - i - 1);
|
||||
size_t _depth = 0;
|
||||
double _value = (1.0 / _depth_sum[_bt_time->get_tid()][_depth]) * 100.0;
|
||||
itr.store(std::plus<double>{}, _value);
|
||||
itr.stop();
|
||||
itr.pop();
|
||||
iitr.store(std::plus<double>{}, _value);
|
||||
iitr.stop();
|
||||
iitr.pop();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user