Resolve warnings/errors with extra warnings (#171)
[ROCm/rocprofiler-systems commit: 4e3527f0ed]
This commit is contained in:
کامیت شده توسط
GitHub
والد
6c8570f610
کامیت
07e3cf256a
@@ -218,10 +218,9 @@ endif()
|
||||
# ----------------------------------------------------------------------------------------#
|
||||
# developer build flags
|
||||
#
|
||||
omnitrace_add_interface_library(omnitrace-develop-options "Adds developer compiler flags")
|
||||
if(OMNITRACE_BUILD_DEVELOPER)
|
||||
add_target_flag_if_avail(omnitrace-develop-options "-Werror" "-Wdouble-promotion"
|
||||
"-Wshadow" "-Wextra" "-Wpedantic" "-Werror" "/showIncludes")
|
||||
add_target_flag_if_avail(omnitrace-compile-options "-Werror" "-Wdouble-promotion"
|
||||
"-Wshadow" "-Wextra" "-Wpedantic" "/showIncludes")
|
||||
endif()
|
||||
|
||||
# ----------------------------------------------------------------------------------------#
|
||||
|
||||
@@ -52,7 +52,7 @@ get_values_str(const Tp& _data)
|
||||
for(auto&& itr : _data)
|
||||
_ss << ", " << std::setw(6) << std::setprecision(2) << std::fixed << itr;
|
||||
return _ss.str().substr(1);
|
||||
};
|
||||
}
|
||||
|
||||
template <typename Tp, size_t N>
|
||||
auto
|
||||
@@ -289,8 +289,8 @@ run_main(int argc, char** argv)
|
||||
|
||||
int n = 0;
|
||||
const int ranks[7] = { 1, 2, 3, 5, 7, 11, 13 };
|
||||
for(int rank : ranks)
|
||||
if(rank < size) ++n;
|
||||
for(int r : ranks)
|
||||
if(r < size) ++n;
|
||||
|
||||
// Construct a group containing all of the prime ranks in world_group
|
||||
MPI_Group prime_group;
|
||||
|
||||
+1
-1
Submodule projects/rocprofiler-systems/external/timemory updated: f95f257a7f...a781a21695
@@ -9,7 +9,7 @@ build-backend = 'setuptools.build_meta'
|
||||
[tool.black]
|
||||
line-length = 90
|
||||
target-version = ['py38']
|
||||
include = '\.py'
|
||||
include = '\.py$'
|
||||
exclude = '''
|
||||
(
|
||||
/(
|
||||
|
||||
@@ -975,13 +975,10 @@ write_hw_counter_info(std::ostream& os, const array_t<bool, N>& options,
|
||||
auto _rocm_events =
|
||||
(gpu_count > 0) ? omnitrace::rocprofiler::rocm_metrics() : hwcounter_info_t{};
|
||||
|
||||
auto _process_counters = [](auto& _events, int32_t _offset) {
|
||||
for(auto& itr : _events)
|
||||
{
|
||||
itr.offset() += _offset;
|
||||
itr.python_symbol() = "timemory.hardware_counters." + itr.python_symbol();
|
||||
}
|
||||
return static_cast<int32_t>(_events.size());
|
||||
auto _process_counters = [](auto& _events_v, int32_t _offset_v) {
|
||||
for(auto& iitr : _events_v)
|
||||
iitr.offset() += _offset_v;
|
||||
return static_cast<int32_t>(_events_v.size());
|
||||
};
|
||||
|
||||
int32_t _offset = 0;
|
||||
|
||||
@@ -87,18 +87,18 @@ get_regex_pattern()
|
||||
for(const auto& itr : regex_keys)
|
||||
{
|
||||
if(itr.empty()) continue;
|
||||
std::string _pattern = {};
|
||||
std::string _local_pattern = {};
|
||||
if(itr.at(0) == '~')
|
||||
{
|
||||
_pattern = itr.substr(1);
|
||||
_v.at(1) += "|" + _pattern;
|
||||
_local_pattern = itr.substr(1);
|
||||
_v.at(1) += "|" + _local_pattern;
|
||||
}
|
||||
else
|
||||
{
|
||||
_pattern = itr;
|
||||
_v.at(0) += "|" + _pattern;
|
||||
_local_pattern = itr;
|
||||
_v.at(0) += "|" + _local_pattern;
|
||||
}
|
||||
lerr << "Adding regex key: '" << _pattern << "'...\n";
|
||||
lerr << "Adding regex key: '" << _local_pattern << "'...\n";
|
||||
}
|
||||
for(auto& itr : _v)
|
||||
if(!itr.empty()) itr = itr.substr(1);
|
||||
@@ -188,18 +188,18 @@ get_category_regex_pattern()
|
||||
for(const auto& itr : category_regex_keys)
|
||||
{
|
||||
if(itr.empty()) continue;
|
||||
std::string _pattern = {};
|
||||
std::string _local_pattern = {};
|
||||
if(itr.at(0) == '~')
|
||||
{
|
||||
_pattern = itr.substr(1);
|
||||
_v.at(1) += "|" + _pattern;
|
||||
_local_pattern = itr.substr(1);
|
||||
_v.at(1) += "|" + _local_pattern;
|
||||
}
|
||||
else
|
||||
{
|
||||
_pattern = itr;
|
||||
_v.at(0) += "|" + _pattern;
|
||||
_local_pattern = itr;
|
||||
_v.at(0) += "|" + _local_pattern;
|
||||
}
|
||||
lerr << "Adding category regex key: '" << _pattern << "'...\n";
|
||||
lerr << "Adding category regex key: '" << _local_pattern << "'...\n";
|
||||
}
|
||||
for(auto& itr : _v)
|
||||
if(!itr.empty()) itr = itr.substr(1);
|
||||
|
||||
@@ -393,22 +393,22 @@ generate_config(std::string _config_file, const std::set<std::string>& _config_f
|
||||
}
|
||||
_line << " " << _str;
|
||||
};
|
||||
for(auto& itr : _desc)
|
||||
_write(itr);
|
||||
for(auto& iitr : _desc)
|
||||
_write(iitr);
|
||||
_ss << _line.str() << "\n#\n";
|
||||
}
|
||||
if(_options[CATEGORY] || all_info)
|
||||
{
|
||||
_ss << "# categories:\n";
|
||||
for(const auto& itr : itr->get_categories())
|
||||
_ss << "# " << itr << "\n";
|
||||
for(const auto& iitr : itr->get_categories())
|
||||
_ss << "# " << iitr << "\n";
|
||||
_ss << "#\n";
|
||||
}
|
||||
if((_options[VAL] || all_info) && !itr->get_choices().empty())
|
||||
{
|
||||
_ss << "# choices:\n";
|
||||
for(const auto& itr : itr->get_choices())
|
||||
_ss << "# " << itr << "\n";
|
||||
for(const auto& iitr : itr->get_choices())
|
||||
_ss << "# " << iitr << "\n";
|
||||
_ss << "#\n";
|
||||
}
|
||||
if(_has_info) _ss << "\n";
|
||||
|
||||
+5
-5
@@ -780,7 +780,7 @@ find(
|
||||
if(std::forward<FuncT>(_func)(_v, itr)) return &itr;
|
||||
}
|
||||
return nullptr;
|
||||
};
|
||||
}
|
||||
|
||||
template <typename FuncT = bool (*)(const entry&, const entry&)>
|
||||
inline entry*
|
||||
@@ -845,13 +845,13 @@ compute_critical_trace()
|
||||
perfstats_t _ct_perf{};
|
||||
_ct_perf.start();
|
||||
|
||||
auto _report_perf = [](auto& _perf, const char* _func, const std::string& _label) {
|
||||
_perf.stop().rekey(_label);
|
||||
auto _str = JOIN("", _perf);
|
||||
auto _report_perf = [](auto& _perf_v, const char* _func, const std::string& _label) {
|
||||
_perf_v.stop().rekey(_label);
|
||||
auto _str = JOIN("", _perf_v);
|
||||
if(_str.length() > 5) _str = _str.substr(5);
|
||||
OMNITRACE_BASIC_PRINT("[%s] %s\n", _func, _str.c_str());
|
||||
OMNITRACE_BASIC_PRINT("\n");
|
||||
_perf.reset().start();
|
||||
_perf_v.reset().start();
|
||||
};
|
||||
|
||||
OMNITRACE_BASIC_PRINT("\n");
|
||||
|
||||
@@ -708,10 +708,10 @@ module_function::operator()(address_space_t* _addr_space, procedure_t* _entr_tra
|
||||
|
||||
auto* itr = loop_blocks.at(i);
|
||||
auto _is_constrained = [this](bool _v, const std::string& _label,
|
||||
const std::string& _name) {
|
||||
const std::string& _mname) {
|
||||
if(_v)
|
||||
{
|
||||
messages.emplace_back(3, "Skipping", "function-loop", _label, _name);
|
||||
messages.emplace_back(3, "Skipping", "function-loop", _label, _mname);
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
|
||||
@@ -854,26 +854,26 @@ main(int argc, char** argv)
|
||||
for(auto&& itr : _configs)
|
||||
{
|
||||
auto _settings = tim::settings::push<omnitrace_env_config_s>();
|
||||
for(auto&& itr : *_settings)
|
||||
for(auto&& iitr : *_settings)
|
||||
{
|
||||
itr.second->set_config_updated(false);
|
||||
itr.second->set_environ_updated(false);
|
||||
iitr.second->set_config_updated(false);
|
||||
iitr.second->set_environ_updated(false);
|
||||
}
|
||||
_settings->read(itr);
|
||||
for(auto&& itr : *_settings)
|
||||
for(auto&& iitr : *_settings)
|
||||
{
|
||||
if(itr.second && itr.second->get_config_updated())
|
||||
if(iitr.second && iitr.second->get_config_updated())
|
||||
{
|
||||
env_config_variables.emplace_back(TIMEMORY_JOIN(
|
||||
'=', itr.second->get_env_name(), itr.second->as_string()));
|
||||
'=', iitr.second->get_env_name(), iitr.second->as_string()));
|
||||
verbprintf(1, "Exporting known config value :: %s\n",
|
||||
env_config_variables.back().c_str());
|
||||
}
|
||||
}
|
||||
for(auto&& itr : _settings->get_unknown_configs())
|
||||
for(auto&& iitr : _settings->get_unknown_configs())
|
||||
{
|
||||
env_config_variables.emplace_back(
|
||||
TIMEMORY_JOIN('=', itr.first, itr.second));
|
||||
TIMEMORY_JOIN('=', iitr.first, iitr.second));
|
||||
verbprintf(1, "Exporting unknown config value :: %s\n",
|
||||
env_config_variables.back().c_str());
|
||||
}
|
||||
@@ -2508,7 +2508,7 @@ find_dyn_api_rt()
|
||||
_dyn_api_rt_paths.insert(_dyn_api_rt_paths.begin(), _dyn_api_rt_abs);
|
||||
else
|
||||
{
|
||||
auto _dyn_api_rt_abs = get_absolute_lib_filepath(
|
||||
_dyn_api_rt_abs = get_absolute_lib_filepath(
|
||||
_dyn_api_rt_base + ".a", "LIBRARY_PATH", _suffixes, _fallbacks);
|
||||
if(_dyn_api_rt_abs != _dyn_api_rt_base + ".a")
|
||||
_dyn_api_rt_paths.insert(_dyn_api_rt_paths.begin(), _dyn_api_rt_abs);
|
||||
|
||||
@@ -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)
|
||||
|
||||
+1
-1
@@ -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)
|
||||
{
|
||||
|
||||
+2
-1
@@ -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 });
|
||||
|
||||
+1
-1
@@ -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();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -356,28 +356,28 @@ profiler_function(py::object pframe, const char* swhat, py::object arg)
|
||||
};
|
||||
|
||||
// get the final label
|
||||
auto _get_label = [&](auto& _func, auto& _filename, auto& _fullpath) {
|
||||
auto _get_label = [&](auto& _funcname, auto& _filename, auto& _fullpath) {
|
||||
auto _bracket = _config.include_filename;
|
||||
if(_bracket) _func.insert(0, "[");
|
||||
if(_bracket) _funcname.insert(0, "[");
|
||||
// append the arguments
|
||||
if(_config.include_args) _func.append(_get_args());
|
||||
if(_bracket) _func.append("]");
|
||||
if(_config.include_args) _funcname.append(_get_args());
|
||||
if(_bracket) _funcname.append("]");
|
||||
// append the filename
|
||||
if(_config.include_filename)
|
||||
{
|
||||
if(_config.full_filepath)
|
||||
_func.append(TIMEMORY_JOIN("", '[', std::move(_fullpath)));
|
||||
_funcname.append(TIMEMORY_JOIN("", '[', std::move(_fullpath)));
|
||||
else
|
||||
_func.append(TIMEMORY_JOIN("", '[', std::move(_filename)));
|
||||
_funcname.append(TIMEMORY_JOIN("", '[', std::move(_filename)));
|
||||
}
|
||||
// append the line number
|
||||
if(_config.include_line && _config.include_filename)
|
||||
_func.append(TIMEMORY_JOIN("", ':', frame->f_lineno, ']'));
|
||||
_funcname.append(TIMEMORY_JOIN("", ':', frame->f_lineno, ']'));
|
||||
else if(_config.include_line)
|
||||
_func.append(TIMEMORY_JOIN("", ':', frame->f_lineno));
|
||||
_funcname.append(TIMEMORY_JOIN("", ':', frame->f_lineno));
|
||||
else if(_config.include_filename)
|
||||
_func += "]";
|
||||
return _func;
|
||||
_funcname += "]";
|
||||
return _funcname;
|
||||
};
|
||||
|
||||
auto _find_matching = [](const strset_t& _expr, const std::string& _name) {
|
||||
@@ -783,9 +783,9 @@ generate(py::module& _pymod)
|
||||
std::sort(_rhs->begin(), _rhs->end(), std::greater<coverage::coverage_data>{});
|
||||
|
||||
auto _find = [_lhs](const auto& _v) {
|
||||
for(auto itr = _lhs->begin(); itr != _lhs->end(); ++itr)
|
||||
for(auto iitr = _lhs->begin(); iitr != _lhs->end(); ++iitr)
|
||||
{
|
||||
if(*itr == _v) return std::make_pair(itr, true);
|
||||
if(*iitr == _v) return std::make_pair(iitr, true);
|
||||
}
|
||||
return std::make_pair(_lhs->end(), false);
|
||||
};
|
||||
|
||||
مرجع در شماره جدید
Block a user