diff --git a/cmake/BuildSettings.cmake b/cmake/BuildSettings.cmake index e7d1a06aa1..d5dc9f0166 100644 --- a/cmake/BuildSettings.cmake +++ b/cmake/BuildSettings.cmake @@ -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() # ----------------------------------------------------------------------------------------# diff --git a/examples/mpi/mpi.cpp b/examples/mpi/mpi.cpp index a51787da63..29c3d21588 100644 --- a/examples/mpi/mpi.cpp +++ b/examples/mpi/mpi.cpp @@ -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 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; diff --git a/external/timemory b/external/timemory index f95f257a7f..a781a21695 160000 --- a/external/timemory +++ b/external/timemory @@ -1 +1 @@ -Subproject commit f95f257a7f8e4979002a28d1c3094d4186243ecb +Subproject commit a781a2169589e375db220f6e615d26714d8b5ba7 diff --git a/pyproject.toml b/pyproject.toml index 76f616ea06..a5106dd84c 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -9,7 +9,7 @@ build-backend = 'setuptools.build_meta' [tool.black] line-length = 90 target-version = ['py38'] -include = '\.py' +include = '\.py$' exclude = ''' ( /( diff --git a/source/bin/omnitrace-avail/avail.cpp b/source/bin/omnitrace-avail/avail.cpp index 0922e39c23..5cea3e1279 100644 --- a/source/bin/omnitrace-avail/avail.cpp +++ b/source/bin/omnitrace-avail/avail.cpp @@ -975,13 +975,10 @@ write_hw_counter_info(std::ostream& os, const array_t& 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(_events.size()); + auto _process_counters = [](auto& _events_v, int32_t _offset_v) { + for(auto& iitr : _events_v) + iitr.offset() += _offset_v; + return static_cast(_events_v.size()); }; int32_t _offset = 0; diff --git a/source/bin/omnitrace-avail/common.cpp b/source/bin/omnitrace-avail/common.cpp index 45b343113e..4c7ea56e55 100644 --- a/source/bin/omnitrace-avail/common.cpp +++ b/source/bin/omnitrace-avail/common.cpp @@ -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); diff --git a/source/bin/omnitrace-avail/generate_config.cpp b/source/bin/omnitrace-avail/generate_config.cpp index 40746c1662..68d015882e 100644 --- a/source/bin/omnitrace-avail/generate_config.cpp +++ b/source/bin/omnitrace-avail/generate_config.cpp @@ -393,22 +393,22 @@ generate_config(std::string _config_file, const std::set& _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"; diff --git a/source/bin/omnitrace-critical-trace/critical-trace.cpp b/source/bin/omnitrace-critical-trace/critical-trace.cpp index 2d2a0b94e2..546005cee8 100644 --- a/source/bin/omnitrace-critical-trace/critical-trace.cpp +++ b/source/bin/omnitrace-critical-trace/critical-trace.cpp @@ -780,7 +780,7 @@ find( if(std::forward(_func)(_v, itr)) return &itr; } return nullptr; -}; +} template 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"); diff --git a/source/bin/omnitrace/module_function.cpp b/source/bin/omnitrace/module_function.cpp index e456e9cefa..2620891d95 100644 --- a/source/bin/omnitrace/module_function.cpp +++ b/source/bin/omnitrace/module_function.cpp @@ -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; diff --git a/source/bin/omnitrace/omnitrace.cpp b/source/bin/omnitrace/omnitrace.cpp index 22e0fbf5bc..0890fa3096 100644 --- a/source/bin/omnitrace/omnitrace.cpp +++ b/source/bin/omnitrace/omnitrace.cpp @@ -854,26 +854,26 @@ main(int argc, char** argv) for(auto&& itr : _configs) { auto _settings = tim::settings::push(); - 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); diff --git a/source/lib/common/setup.hpp b/source/lib/common/setup.hpp index fe40466b30..f1f2848ce8 100644 --- a/source/lib/common/setup.hpp +++ b/source/lib/common/setup.hpp @@ -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 diff --git a/source/lib/omnitrace/library.cpp b/source/lib/omnitrace/library.cpp index b8e3536e9a..149721dd42 100644 --- a/source/lib/omnitrace/library.cpp +++ b/source/lib/omnitrace/library.cpp @@ -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("OMNITRACE_PATH", ""), + tim::get_env("PWD"), ".", + tim::get_env("LD_LIBRARY_PATH", ""), + tim::get_env("LIBRARY_PATH", ""), + tim::get_env("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("OMNITRACE_PATH", ""), - tim::get_env("PWD"), ".", - tim::get_env("LD_LIBRARY_PATH", ""), - tim::get_env("LIBRARY_PATH", ""), - tim::get_env("PATH", "")); - common::setup_environ(_verbose, _search_paths); - return scope::destructor{ []() { omnitrace_finalize_hidden(); } }; } diff --git a/source/lib/omnitrace/library/components/cpu_freq.hpp b/source/lib/omnitrace/library/components/cpu_freq.hpp index e128fca17b..7e80e53694 100644 --- a/source/lib/omnitrace/library/components/cpu_freq.hpp +++ b/source/lib/omnitrace/library/components/cpu_freq.hpp @@ -88,6 +88,7 @@ public: operation::serialization{}(*this, _ar, _version); else _ar(tim::cereal::make_nvp("value", value)); + (void) _version; } this_type& operator+=(const this_type& _rhs) diff --git a/source/lib/omnitrace/library/components/mpi_gotcha.cpp b/source/lib/omnitrace/library/components/mpi_gotcha.cpp index 2deb204715..da17e9ecab 100644 --- a/source/lib/omnitrace/library/components/mpi_gotcha.cpp +++ b/source/lib/omnitrace/library/components/mpi_gotcha.cpp @@ -281,7 +281,7 @@ mpi_gotcha::audit(const gotcha_data_t& _data, audit::incoming, comm_t _comm, int else { OMNITRACE_BASIC_PRINT_F("%s(, %p) :: unexpected function wrapper\n", - _data.tool_id.c_str(), _val); + _data.tool_id.c_str(), static_cast(_val)); } } diff --git a/source/lib/omnitrace/library/components/rcclp.cpp b/source/lib/omnitrace/library/components/rcclp.cpp index 13936f2db4..fb4a611e06 100644 --- a/source/lib/omnitrace/library/components/rcclp.cpp +++ b/source/lib/omnitrace/library/components/rcclp.cpp @@ -87,11 +87,6 @@ deactivate_rcclp(uint64_t id) void configure_rcclp(const std::set& permit, const std::set& reject) { - static constexpr size_t rcclp_wrapper_count = OMNITRACE_NUM_RCCLP_WRAPPERS; - - using rcclp_gotcha_t = - tim::component::gotcha; - static bool is_initialized = false; if(!is_initialized) { diff --git a/source/lib/omnitrace/library/components/rocprofiler.cpp b/source/lib/omnitrace/library/components/rocprofiler.cpp index cf3d542359..96fba60857 100644 --- a/source/lib/omnitrace/library/components/rocprofiler.cpp +++ b/source/lib/omnitrace/library/components/rocprofiler.cpp @@ -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(p->data.result_float) }); break; case ROCPROFILER_DATA_KIND_DOUBLE: feature_values.emplace_back(rocm_feature_value{ p->data.result_double }); diff --git a/source/lib/omnitrace/library/components/rocprofiler.hpp b/source/lib/omnitrace/library/components/rocprofiler.hpp index bb3ed6f1f3..b6afaacf96 100644 --- a/source/lib/omnitrace/library/components/rocprofiler.hpp +++ b/source/lib/omnitrace/library/components/rocprofiler.hpp @@ -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; +using rocm_feature_value = std::variant; struct rocm_counter { diff --git a/source/lib/omnitrace/library/coverage.cpp b/source/lib/omnitrace/library/coverage.cpp index c8dd9e998a..ce16314527 100644 --- a/source/lib/omnitrace/library/coverage.cpp +++ b/source/lib/omnitrace/library/coverage.cpp @@ -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); diff --git a/source/lib/omnitrace/library/critical_trace.cpp b/source/lib/omnitrace/library/critical_trace.cpp index fbb929ddee..926d2a687c 100644 --- a/source/lib/omnitrace/library/critical_trace.cpp +++ b/source/lib/omnitrace/library/critical_trace.cpp @@ -683,7 +683,7 @@ find( if(std::forward(_func)(_v, itr)) return &itr; } return nullptr; -}; +} template inline entry* diff --git a/source/lib/omnitrace/library/debug.hpp b/source/lib/omnitrace/library/debug.hpp index c005dca91e..fa3fc4280b 100644 --- a/source/lib/omnitrace/library/debug.hpp +++ b/source/lib/omnitrace/library/debug.hpp @@ -196,7 +196,7 @@ get_chars(T&& _c, std::index_sequence) ::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) ::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) ::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) ::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) ::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) ::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) ::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) ::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__) ? "" : " "); \ diff --git a/source/lib/omnitrace/library/rocm_smi.cpp b/source/lib/omnitrace/library/rocm_smi.cpp index 733e0c3bbf..d8f5f408ee 100644 --- a/source/lib/omnitrace/library/rocm_smi.cpp +++ b/source/lib/omnitrace/library/rocm_smi.cpp @@ -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; + using samp_bundle_t = tim::lightweight_tuple; 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 _tc{}; + std::vector _tc{}; _tc.reserve(_entries.size()); for(auto& eitr : _entries) { diff --git a/source/lib/omnitrace/library/rocprofiler.cpp b/source/lib/omnitrace/library/rocprofiler.cpp index b19473859a..f4a31d2fb1 100644 --- a/source/lib/omnitrace/library/rocprofiler.cpp +++ b/source/lib/omnitrace/library/rocprofiler.cpp @@ -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)); } diff --git a/source/lib/omnitrace/library/roctracer.cpp b/source/lib/omnitrace/library/roctracer.cpp index cd4de5bf9f..534da1fc90 100644 --- a/source/lib/omnitrace/library/roctracer.cpp +++ b/source/lib/omnitrace/library/roctracer.cpp @@ -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()) { diff --git a/source/lib/omnitrace/library/sampling.cpp b/source/lib/omnitrace/library/sampling.cpp index b27eaf5a82..9c71e4cd07 100644 --- a/source/lib/omnitrace/library/sampling.cpp +++ b/source/lib/omnitrace/library/sampling.cpp @@ -588,7 +588,7 @@ post_process_perfetto(int64_t _tid, const bundle_t* _init, } auto _process_perfetto = [_tid, - _init](const std::vector& _data) { + _init](const std::vector& _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(); const auto* _bt_cs = itr->get(); @@ -617,9 +617,9 @@ post_process_perfetto(int64_t _tid, const bundle_t* _init, if(_bt_ts->get_tid() != _tid) continue; static std::set _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::value) { - auto* _sc = itr.get(); + auto* _sc = iitr.get(); 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::value) { - auto* _cc = itr.get(); + auto* _cc = iitr.get(); 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()->get_hw_counters()[k]; } } - auto* _hw_counter = itr.get(); + auto* _hw_counter = iitr.get(); 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{}, _value); - itr.stop(); - itr.pop(); + iitr.store(std::plus{}, _value); + iitr.stop(); + iitr.pop(); } } } diff --git a/source/python/libpyomnitrace.cpp b/source/python/libpyomnitrace.cpp index 2a986a3ea9..f179e4e400 100644 --- a/source/python/libpyomnitrace.cpp +++ b/source/python/libpyomnitrace.cpp @@ -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{}); 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); };