From 0403aaa97f78938fa90d79aff71b353a103564d9 Mon Sep 17 00:00:00 2001 From: David Galiffi Date: Sun, 22 Jun 2025 08:48:08 -0400 Subject: [PATCH] Use `clang-format-18` for source formatting (#256) * Updating clang-format to v18 - Updates the pre-commit-config - Formats source files according to the utility Signed-off-by: David Galiffi * Update format source workflow Signed-off-by: David Galiffi * Update CONTRIBUTING * Update comment in .clang-format * Update CONTRIBUTING.md * Update helper script --------- Signed-off-by: David Galiffi [ROCm/rocprofiler-systems commit: 1e13b590e74e56466b45245c0b9bb9348de67318] --- projects/rocprofiler-systems/.clang-format | 2 +- .../.github/workflows/formatting.yml | 8 ++-- .../.pre-commit-config.yaml | 2 +- projects/rocprofiler-systems/CONTRIBUTING.md | 4 +- .../cmake/Formatting.cmake | 3 +- .../examples/fork/fork.cpp | 3 +- .../jpegdecode/rocjpeg_samples_utils.h | 24 +++++------ .../examples/lulesh/lulesh.cc | 6 +-- .../examples/openmp/CG/cg.cpp | 2 +- .../examples/openmp/target/library.cpp | 2 +- .../examples/videodecode/roc_video_dec.h | 9 +--- .../examples/videodecode/video_demuxer.h | 4 +- .../source/bin/rocprof-sys-avail/avail.cpp | 9 ++-- .../source/bin/rocprof-sys-avail/avail.hpp | 4 +- .../bin/rocprof-sys-avail/enumerated_list.hpp | 4 +- .../bin/rocprof-sys-avail/generate_config.cpp | 6 ++- .../bin/rocprof-sys-avail/get_categories.hpp | 3 +- .../source/bin/rocprof-sys-causal/impl.cpp | 2 +- .../module_function.cpp | 18 ++++---- .../rocprof-sys-instrument.cpp | 11 +++-- .../source/bin/rocprof-sys-run/impl.cpp | 4 +- .../source/lib/binary/symbol.hpp | 2 +- .../source/lib/common/delimit.hpp | 8 ++-- .../source/lib/common/path.hpp | 8 ++-- .../source/lib/common/static_object.hpp | 10 ++--- .../source/lib/common/synchronized.hpp | 2 +- .../source/lib/core/binary/address_range.cpp | 3 +- .../source/lib/core/concepts.hpp | 5 ++- .../source/lib/core/config.cpp | 8 ++-- .../source/lib/core/constraint.cpp | 6 ++- .../core/containers/aligned_static_vector.hpp | 8 ++-- .../source/lib/core/containers/c_array.hpp | 6 +-- .../lib/core/containers/static_vector.hpp | 8 ++-- .../source/lib/core/debug.cpp | 2 +- .../source/lib/core/defines.hpp.in | 14 +++---- .../source/lib/core/dynamic_library.hpp | 8 ++-- .../source/lib/core/exception.cpp | 2 +- .../source/lib/core/exception.hpp | 2 +- .../source/lib/core/mpi.hpp | 20 +++++---- .../source/lib/core/perf.hpp | 42 +++++++++---------- .../source/lib/core/rocprofiler-sdk.cpp | 9 ++-- .../source/lib/core/utility.cpp | 8 ++-- .../source/lib/rocprof-sys-rt/h/Types.h | 8 ++-- .../source/lib/rocprof-sys-rt/h/dyntypes.h | 8 ++-- .../source/lib/rocprof-sys-rt/src/RTcommon.c | 6 +-- .../lib/rocprof-sys-rt/src/RTheap-win.c | 2 +- .../source/lib/rocprof-sys-rt/src/RTlinux.c | 4 +- .../lib/rocprof-sys-rt/src/RTmemEmulator.c | 2 +- .../src/RTstatic_ctors_dtors-aarch64.c | 20 ++++----- .../src/RTstatic_ctors_dtors-x86.c | 2 +- .../source/lib/rocprof-sys-rt/src/RTthread.h | 2 +- .../source/lib/rocprof-sys-rt/src/RTwinnt.c | 8 ++-- .../rocprofiler-systems/causal.h | 2 +- .../lib/rocprof-sys/library/amd_smi.hpp | 4 +- .../library/causal/components/backtrace.hpp | 2 +- .../lib/rocprof-sys/library/causal/data.cpp | 8 ++-- .../rocprof-sys/library/causal/sampling.cpp | 6 ++- .../library/components/backtrace.hpp | 2 +- .../library/components/backtrace_metrics.cpp | 3 +- .../library/components/backtrace_metrics.hpp | 8 ++-- .../components/backtrace_timestamp.hpp | 2 +- .../library/components/callchain.hpp | 2 +- .../lib/rocprof-sys/library/cpu_freq.cpp | 3 +- .../source/lib/rocprof-sys/library/ompt.cpp | 2 +- .../source/lib/rocprof-sys/library/perf.cpp | 4 +- .../source/lib/rocprof-sys/library/perf.hpp | 14 +++---- .../rocprof-sys/library/rocprofiler-sdk.cpp | 18 ++++---- .../library/rocprofiler-sdk/counters.hpp | 8 ++-- .../library/rocprofiler-sdk/fwd.hpp | 2 +- .../lib/rocprof-sys/library/thread_data.hpp | 4 +- .../lib/rocprof-sys/library/thread_info.hpp | 2 +- .../lib/rocprof-sys/library/tpls/mpi/mpi.h | 12 +++--- .../library/tpls/mpi/mpi_portable_platform.h | 8 ++-- .../library/tracing/annotation.hpp | 4 +- .../source/lib/rocprof-sys/timeout.cpp | 2 +- .../source/python/libpyrocprofsys.cpp | 18 ++++---- 76 files changed, 258 insertions(+), 255 deletions(-) diff --git a/projects/rocprofiler-systems/.clang-format b/projects/rocprofiler-systems/.clang-format index 203eeeef07..d026af09ed 100644 --- a/projects/rocprofiler-systems/.clang-format +++ b/projects/rocprofiler-systems/.clang-format @@ -1,4 +1,4 @@ -# clang-format v11 +# clang-format v18 --- Language: Cpp AccessModifierOffset: -4 diff --git a/projects/rocprofiler-systems/.github/workflows/formatting.yml b/projects/rocprofiler-systems/.github/workflows/formatting.yml index 610615d2de..5d6bf1d9fd 100644 --- a/projects/rocprofiler-systems/.github/workflows/formatting.yml +++ b/projects/rocprofiler-systems/.github/workflows/formatting.yml @@ -63,7 +63,7 @@ jobs: fi source: - runs-on: ubuntu-22.04 + runs-on: ubuntu-latest steps: - uses: actions/checkout@v4 @@ -71,16 +71,16 @@ jobs: run: | DISTRIB_CODENAME=$(cat /etc/lsb-release | grep DISTRIB_CODENAME | awk -F '=' '{print $NF}') sudo apt-get update - sudo apt-get install -y software-properties-common wget curl clang-format-11 + sudo apt-get install -y software-properties-common wget curl clang-format-18 - name: clang-format run: | set +e FILES=$(find source examples tests -type f | egrep '\.(h|hpp|c|cpp)(|\.in)$') - FORMAT_OUT=$(clang-format-11 -output-replacements-xml ${FILES}) + FORMAT_OUT=$(clang-format-18 -output-replacements-xml ${FILES}) RET=$(echo ${FORMAT_OUT} | grep -c ' void vmul(T* a, T* b, T* c, int N) { -#pragma omp target map(to : a [0:N], b [0:N]) map(from : c [0:N]) +#pragma omp target map(to : a[0 : N], b[0 : N]) map(from : c[0 : N]) #pragma omp teams distribute parallel for for(int i = 0; i < N; i++) { diff --git a/projects/rocprofiler-systems/examples/videodecode/roc_video_dec.h b/projects/rocprofiler-systems/examples/videodecode/roc_video_dec.h index fba609c764..78432a798a 100644 --- a/projects/rocprofiler-systems/examples/videodecode/roc_video_dec.h +++ b/projects/rocprofiler-systems/examples/videodecode/roc_video_dec.h @@ -84,16 +84,11 @@ typedef enum OutputSurfaceMemoryType_enum #if DBGINFO # define INFO(X) \ - std::clog << "[INF] " \ - << " {" << __func__ << "} " \ - << " " << X << std::endl; + std::clog << "[INF] " << " {" << __func__ << "} " << " " << X << std::endl; #else # define INFO(X) ; #endif -#define ERR(X) \ - std::cerr << "[ERR] " \ - << " {" << __func__ << "} " \ - << " " << X << std::endl; +#define ERR(X) std::cerr << "[ERR] " << " {" << __func__ << "} " << " " << X << std::endl; class RocVideoDecodeException : public std::exception { diff --git a/projects/rocprofiler-systems/examples/videodecode/video_demuxer.h b/projects/rocprofiler-systems/examples/videodecode/video_demuxer.h index 5d02dc9a82..5aba9c9c4e 100644 --- a/projects/rocprofiler-systems/examples/videodecode/video_demuxer.h +++ b/projects/rocprofiler-systems/examples/videodecode/video_demuxer.h @@ -234,7 +234,7 @@ public: if(pts) { *pts = - (int64_t)(packet_filtered_->pts * default_time_scale_ * time_base_); + (int64_t) (packet_filtered_->pts * default_time_scale_ * time_base_); pkt_duration_ = packet_filtered_->duration; } } @@ -277,7 +277,7 @@ public: } if(pts) { - *pts = (int64_t)(packet_->pts * default_time_scale_ * time_base_); + *pts = (int64_t) (packet_->pts * default_time_scale_ * time_base_); pkt_duration_ = packet_->duration; } } diff --git a/projects/rocprofiler-systems/source/bin/rocprof-sys-avail/avail.cpp b/projects/rocprofiler-systems/source/bin/rocprof-sys-avail/avail.cpp index 2629e2b396..93128f8651 100644 --- a/projects/rocprofiler-systems/source/bin/rocprof-sys-avail/avail.cpp +++ b/projects/rocprofiler-systems/source/bin/rocprof-sys-avail/avail.cpp @@ -293,8 +293,7 @@ main(int argc, char** argv) { _msg << "| " << std::setw(std::get<0>(_w) + 2) << "String"; if(_show) _msg << " | " << std::setw(std::get<1>(_w)) << "Value"; - _msg << " | " << std::setw(std::get<2>(_w)) << "Encoding" - << " |\n"; + _msg << " | " << std::setw(std::get<2>(_w)) << "Encoding" << " |\n"; auto _dashes = [](int64_t _n) { std::stringstream _dss{}; @@ -965,9 +964,9 @@ write_settings_info(std::ostream& os, const array_t& opts, "C++ MEMBER ACCESSOR", "Python ACCESSOR", "DESCRIPTION", "CATEGORIES", }; array_t _keys = { "environ", "value", - "data_type", "static_accessor", - "member_accessor", "python_accessor", - "description", "categories" }; + "data_type", "static_accessor", + "member_accessor", "python_accessor", + "description", "categories" }; array_t _center = { false, true, true, false, false, false, false, false }; diff --git a/projects/rocprofiler-systems/source/bin/rocprof-sys-avail/avail.hpp b/projects/rocprofiler-systems/source/bin/rocprof-sys-avail/avail.hpp index 8b8fb30c31..4c43f60fe0 100644 --- a/projects/rocprofiler-systems/source/bin/rocprof-sys-avail/avail.hpp +++ b/projects/rocprofiler-systems/source/bin/rocprof-sys-avail/avail.hpp @@ -162,8 +162,8 @@ private: unique_set exclude_stream = {}; int_stack name_counter; unique_set value_keys = { "name", "value", "description", "count", - "environ", "max_count", "cmdline", "data_type", - "initial", "categories" }; + "environ", "max_count", "cmdline", "data_type", + "initial", "categories" }; }; //======================================================================================// diff --git a/projects/rocprofiler-systems/source/bin/rocprof-sys-avail/enumerated_list.hpp b/projects/rocprofiler-systems/source/bin/rocprof-sys-avail/enumerated_list.hpp index c6f87ab8bd..ad84fe9660 100644 --- a/projects/rocprofiler-systems/source/bin/rocprof-sys-avail/enumerated_list.hpp +++ b/projects/rocprofiler-systems/source/bin/rocprof-sys-avail/enumerated_list.hpp @@ -48,6 +48,6 @@ struct enumerated_list, std::index_sequence> using Tp = tim::component::enumerator_t; static constexpr bool is_nothing = tim::concepts::is_placeholder::value; using type = typename enumerated_list< - std::conditional_t, type_list>, - std::index_sequence>::type; + std::conditional_t, type_list>, + std::index_sequence>::type; }; diff --git a/projects/rocprofiler-systems/source/bin/rocprof-sys-avail/generate_config.cpp b/projects/rocprofiler-systems/source/bin/rocprof-sys-avail/generate_config.cpp index 38c127fc8d..14d68fbbe4 100644 --- a/projects/rocprofiler-systems/source/bin/rocprof-sys-avail/generate_config.cpp +++ b/projects/rocprofiler-systems/source/bin/rocprof-sys-avail/generate_config.cpp @@ -161,7 +161,8 @@ struct setting_serialization, custom_setting_serializer> } // namespace tim template -void push(type_list) +void +push(type_list) { ROCPROFSYS_FOLD_EXPRESSION( settings::push_serialize_map_callback()); @@ -171,7 +172,8 @@ void push(type_list) } template -void pop(type_list) +void +pop(type_list) { ROCPROFSYS_FOLD_EXPRESSION( settings::pop_serialize_map_callback()); diff --git a/projects/rocprofiler-systems/source/bin/rocprof-sys-avail/get_categories.hpp b/projects/rocprofiler-systems/source/bin/rocprof-sys-avail/get_categories.hpp index 1f9c6427ff..d02bd2b1e1 100644 --- a/projects/rocprofiler-systems/source/bin/rocprof-sys-avail/get_categories.hpp +++ b/projects/rocprofiler-systems/source/bin/rocprof-sys-avail/get_categories.hpp @@ -32,7 +32,8 @@ #include template -auto get_categories(type_list) +auto +get_categories(type_list) { auto _cleanup = [](std::string _type, const std::string& _pattern) { auto _pos = std::string::npos; diff --git a/projects/rocprofiler-systems/source/bin/rocprof-sys-causal/impl.cpp b/projects/rocprofiler-systems/source/bin/rocprof-sys-causal/impl.cpp index 91b7bceb0d..5d8ba62667 100644 --- a/projects/rocprofiler-systems/source/bin/rocprof-sys-causal/impl.cpp +++ b/projects/rocprofiler-systems/source/bin/rocprof-sys-causal/impl.cpp @@ -122,7 +122,7 @@ int get_verbose() { verbose = get_env("ROCPROFSYS_CAUSAL_VERBOSE", - get_env("ROCPROFSYS_VERBOSE", verbose, false)); + get_env("ROCPROFSYS_VERBOSE", verbose, false)); auto _debug = get_env("ROCPROFSYS_CAUSAL_DEBUG", get_env("ROCPROFSYS_DEBUG", false, false)); if(_debug) verbose += 8; diff --git a/projects/rocprofiler-systems/source/bin/rocprof-sys-instrument/module_function.cpp b/projects/rocprofiler-systems/source/bin/rocprof-sys-instrument/module_function.cpp index 4f97500a7a..1b1ee444eb 100644 --- a/projects/rocprofiler-systems/source/bin/rocprof-sys-instrument/module_function.cpp +++ b/projects/rocprofiler-systems/source/bin/rocprof-sys-instrument/module_function.cpp @@ -146,16 +146,12 @@ module_function::write_header(std::ostream& os) auto w2 = std::min(get_width()[2], absolute_max_width); std::stringstream ss; - ss << std::setw(14) << "StartAddress" - << " " << std::setw(14) << "AddressRange" - << " " << std::setw(14) << "#Instructions" - << " " << std::setw(6) << "Ratio" - << " " << std::setw(7) << "Linkage" - << " " << std::setw(10) << "Visibility" - << " " << std::setw(w0 + 8) << std::left << "Module" - << " " << std::setw(w1 + 8) << std::left << "Function" - << " " << std::setw(w2 + 8) << std::left << "FunctionSignature" - << "\n"; + ss << std::setw(14) << "StartAddress" << " " << std::setw(14) << "AddressRange" << " " + << std::setw(14) << "#Instructions" << " " << std::setw(6) << "Ratio" << " " + << std::setw(7) << "Linkage" << " " << std::setw(10) << "Visibility" << " " + << std::setw(w0 + 8) << std::left << "Module" << " " << std::setw(w1 + 8) + << std::left << "Function" << " " << std::setw(w2 + 8) << std::left + << "FunctionSignature" << "\n"; os << ss.str(); } @@ -1015,7 +1011,7 @@ module_function::register_coverage(address_space_t* _addr_space, auto _start_addr = itr.second.start_address; auto& _signature = itr.second.signature; auto _trace_entr = rocprofsys_call_expr(_signature.m_file, - _signature.m_name, _start_addr); + _signature.m_name, _start_addr); auto _entr = _trace_entr.get(_entr_trace); if(insert_instr(_addr_space, _entr, BPatch_entry, itr.first)) diff --git a/projects/rocprofiler-systems/source/bin/rocprof-sys-instrument/rocprof-sys-instrument.cpp b/projects/rocprofiler-systems/source/bin/rocprof-sys-instrument/rocprof-sys-instrument.cpp index 77a11cedbc..3c0f9877fd 100644 --- a/projects/rocprofiler-systems/source/bin/rocprof-sys-instrument/rocprof-sys-instrument.cpp +++ b/projects/rocprofiler-systems/source/bin/rocprof-sys-instrument/rocprof-sys-instrument.cpp @@ -147,7 +147,7 @@ symtab_data_s symtab_data = {}; std::set enabled_linkage = {}; std::set enabled_visibility = {}; const std::set default_enabled_linkage = { SL_GLOBAL, SL_LOCAL, - SL_UNIQUE }; + SL_UNIQUE }; const std::set default_enabled_visibility = { SV_DEFAULT, SV_HIDDEN, SV_INTERNAL, SV_PROTECTED }; @@ -272,8 +272,8 @@ activate_signal_handlers(const std::vector& _signals) TIMEMORY_PRINTF_FATAL( stderr, "These were the last %i log entries from rocprof-sys. You can control the " - "number of log entries via the '--log ' option or ROCPROFSYS_LOG_COUNT " - "env variable.\n", + "number of log entries via the '--log ' option or ROCPROFSYS_LOG_COUNT " + "env variable.\n", num_log_entries); if(log_ofs) log_ofs->close(); @@ -1207,8 +1207,7 @@ main(int argc, char** argv) std::min(std::get<0>(tim::utility::console::get_columns()) - 20, strlen(_cmdv[0]) + 32); _separator.fill('='); - _separator << "#" << std::setw(_width - 2) << "" - << "#"; + _separator << "#" << std::setw(_width - 2) << "" << "#"; verbprintf(0, "%s\n", _separator.str().c_str()); verbprintf(0, "\n"); verbprintf(0, "Warning! '%s' is not executable!\n", _cmdv[0]); @@ -1708,7 +1707,7 @@ main(int argc, char** argv) auto* user_start_func = find_function(app_image, "rocprofsys_user_start_trace", { "rocprofsys_user_start_thread_trace" }); auto* user_stop_func = find_function(app_image, "rocprofsys_user_stop_trace", - { "rocprofsys_user_stop_thread_trace" }); + { "rocprofsys_user_stop_thread_trace" }); #if ROCPROFSYS_USE_MPI > 0 || ROCPROFSYS_USE_MPI_HEADERS > 0 // if any of the below MPI functions are found, enable MPI support for(const auto* itr : diff --git a/projects/rocprofiler-systems/source/bin/rocprof-sys-run/impl.cpp b/projects/rocprofiler-systems/source/bin/rocprof-sys-run/impl.cpp index 51d8f8cb96..5ef98ff450 100644 --- a/projects/rocprofiler-systems/source/bin/rocprof-sys-run/impl.cpp +++ b/projects/rocprofiler-systems/source/bin/rocprof-sys-run/impl.cpp @@ -114,9 +114,9 @@ get_verbose(parser_data_t& _data) { auto& verbose = _data.verbose; verbose = get_env("ROCPROFSYS_CAUSAL_VERBOSE", - get_env("ROCPROFSYS_VERBOSE", verbose, false)); + get_env("ROCPROFSYS_VERBOSE", verbose, false)); auto _debug = get_env("ROCPROFSYS_CAUSAL_DEBUG", - get_env("ROCPROFSYS_DEBUG", false, false)); + get_env("ROCPROFSYS_DEBUG", false, false)); if(_debug) verbose += 8; return verbose; } diff --git a/projects/rocprofiler-systems/source/lib/binary/symbol.hpp b/projects/rocprofiler-systems/source/lib/binary/symbol.hpp index d8d7711a46..b1ee314349 100644 --- a/projects/rocprofiler-systems/source/lib/binary/symbol.hpp +++ b/projects/rocprofiler-systems/source/lib/binary/symbol.hpp @@ -57,7 +57,7 @@ struct symbol : private tim::unwind::bfd_file::symbol symbol(const symbol&) = default; symbol(symbol&&) noexcept = default; - symbol& operator=(const symbol&) = default; + symbol& operator=(const symbol&) = default; symbol& operator=(symbol&&) noexcept = default; bool operator==(const symbol&) const; diff --git a/projects/rocprofiler-systems/source/lib/common/delimit.hpp b/projects/rocprofiler-systems/source/lib/common/delimit.hpp index 3cd749b51d..17903a72fa 100644 --- a/projects/rocprofiler-systems/source/lib/common/delimit.hpp +++ b/projects/rocprofiler-systems/source/lib/common/delimit.hpp @@ -34,16 +34,16 @@ namespace { template inline auto -emplace_impl(ContainerT& _c, int, Args&&... _args) - -> decltype(_c.emplace_back(std::forward(_args)...)) +emplace_impl(ContainerT& _c, int, + Args&&... _args) -> decltype(_c.emplace_back(std::forward(_args)...)) { return _c.emplace_back(std::forward(_args)...); } template inline auto -emplace_impl(ContainerT& _c, long, Args&&... _args) - -> decltype(_c.emplace(std::forward(_args)...)) +emplace_impl(ContainerT& _c, long, + Args&&... _args) -> decltype(_c.emplace(std::forward(_args)...)) { return _c.emplace(std::forward(_args)...); } diff --git a/projects/rocprofiler-systems/source/lib/common/path.hpp b/projects/rocprofiler-systems/source/lib/common/path.hpp index d92f3b3189..f9034c7e7b 100644 --- a/projects/rocprofiler-systems/source/lib/common/path.hpp +++ b/projects/rocprofiler-systems/source/lib/common/path.hpp @@ -135,11 +135,11 @@ struct ROCPROFSYS_INTERNAL_API path_type }; inline path_type(const std::string&); - ~path_type() = default; - path_type(const path_type&) = default; - path_type(path_type&&) = default; + ~path_type() = default; + path_type(const path_type&) = default; + path_type(path_type&&) = default; path_type& operator=(const path_type&) = default; - path_type& operator=(path_type&&) = default; + path_type& operator=(path_type&&) = default; bool exists() const { return m_type < unknown; } explicit operator bool() const { return exists(); } diff --git a/projects/rocprofiler-systems/source/lib/common/static_object.hpp b/projects/rocprofiler-systems/source/lib/common/static_object.hpp index 7760da4187..54b30ab182 100644 --- a/projects/rocprofiler-systems/source/lib/common/static_object.hpp +++ b/projects/rocprofiler-systems/source/lib/common/static_object.hpp @@ -76,11 +76,11 @@ static_buffer_size() template struct static_object { - static_object() = delete; - ~static_object() = delete; - static_object(const static_object&) = delete; - static_object(static_object&&) noexcept = delete; - static_object& operator=(const static_object&) = delete; + static_object() = delete; + ~static_object() = delete; + static_object(const static_object&) = delete; + static_object(static_object&&) noexcept = delete; + static_object& operator=(const static_object&) = delete; static_object& operator=(static_object&&) noexcept = delete; template diff --git a/projects/rocprofiler-systems/source/lib/common/synchronized.hpp b/projects/rocprofiler-systems/source/lib/common/synchronized.hpp index 6c4cd7e186..4bb18b699b 100644 --- a/projects/rocprofiler-systems/source/lib/common/synchronized.hpp +++ b/projects/rocprofiler-systems/source/lib/common/synchronized.hpp @@ -67,7 +67,7 @@ public: : m_data{ std::move(data) } {} - synchronized(synchronized&& data) noexcept = default; + synchronized(synchronized&& data) noexcept = default; synchronized& operator=(synchronized&& data) noexcept = default; // Do not allow this data structure to be copied, std::move only. diff --git a/projects/rocprofiler-systems/source/lib/core/binary/address_range.cpp b/projects/rocprofiler-systems/source/lib/core/binary/address_range.cpp index 477e94b0f0..a968b826df 100644 --- a/projects/rocprofiler-systems/source/lib/core/binary/address_range.cpp +++ b/projects/rocprofiler-systems/source/lib/core/binary/address_range.cpp @@ -54,8 +54,7 @@ address_range::as_string(int _depth) const _ss << std::hex; _ss << std::setw(2 * _depth) << ""; _ss.fill('0'); - _ss << "0x" << std::setw(16) << low << "-" - << "0x" << std::setw(16) << high; + _ss << "0x" << std::setw(16) << low << "-" << "0x" << std::setw(16) << high; return _ss.str(); } diff --git a/projects/rocprofiler-systems/source/lib/core/concepts.hpp b/projects/rocprofiler-systems/source/lib/core/concepts.hpp index b503c89444..1cc562454a 100644 --- a/projects/rocprofiler-systems/source/lib/core/concepts.hpp +++ b/projects/rocprofiler-systems/source/lib/core/concepts.hpp @@ -89,8 +89,9 @@ template struct can_stringify { private: - static constexpr auto sfinae(int) - -> decltype(std::declval() << std::declval(), bool()) + static constexpr auto sfinae(int) -> decltype(std::declval() + << std::declval(), + bool()) { return true; } diff --git a/projects/rocprofiler-systems/source/lib/core/config.cpp b/projects/rocprofiler-systems/source/lib/core/config.cpp index 4eabcd0157..6f57706f2f 100644 --- a/projects/rocprofiler-systems/source/lib/core/config.cpp +++ b/projects/rocprofiler-systems/source/lib/core/config.cpp @@ -1292,7 +1292,8 @@ get_use_sampling_cputime() return static_cast&>(*_v->second).get(); } -std::set get_sampling_signals(int64_t) +std::set +get_sampling_signals(int64_t) { auto _v = std::set{}; if(get_use_causal()) @@ -1561,7 +1562,7 @@ print_settings( { size_t _wextra = (_md && i < 2) ? 2 : 0; _widths.at(i) = std::max(_widths.at(i), - _data.back().at(i).length() + _wextra); + _data.back().at(i).length() + _wextra); } } } @@ -1593,8 +1594,7 @@ print_settings( _spacer_extra -= 1; std::stringstream _spacer{}; _spacer.fill('-'); - _spacer << "#" << std::setw(tot_width + _spacer_extra) << "" - << "#"; + _spacer << "#" << std::setw(tot_width + _spacer_extra) << "" << "#"; _os << _spacer.str() << "\n"; for(const auto& itr : _data) { diff --git a/projects/rocprofiler-systems/source/lib/core/constraint.cpp b/projects/rocprofiler-systems/source/lib/core/constraint.cpp index 15905b0a8b..f28c2f004b 100644 --- a/projects/rocprofiler-systems/source/lib/core/constraint.cpp +++ b/projects/rocprofiler-systems/source/lib/core/constraint.cpp @@ -262,7 +262,8 @@ spec::operator()(const stages& _stages) const auto _del = (_dur * units::sec); auto _end = _now + _del; while(get_clock_now(_spec.clock_id.value) < _end && (_ret = _func(_spec))) - {} + { + } return _ret; }; @@ -275,7 +276,8 @@ spec::operator()(const stages& _stages) const if(_stages.init(_spec) && _wait(_stages.wait, _spec.delay) && _stages.start(_spec) && _wait(_stages.collect, _spec.duration) && _stages.stop(_spec)) - {} + { + } else { break; diff --git a/projects/rocprofiler-systems/source/lib/core/containers/aligned_static_vector.hpp b/projects/rocprofiler-systems/source/lib/core/containers/aligned_static_vector.hpp index 0dd1eb65c6..da9e203129 100644 --- a/projects/rocprofiler-systems/source/lib/core/containers/aligned_static_vector.hpp +++ b/projects/rocprofiler-systems/source/lib/core/containers/aligned_static_vector.hpp @@ -69,10 +69,10 @@ struct aligned_static_vector using size_type = size_t; using difference_type = std::ptrdiff_t; - aligned_static_vector() = default; - aligned_static_vector(const aligned_static_vector&) = default; - aligned_static_vector(aligned_static_vector&&) noexcept = default; - aligned_static_vector& operator=(const aligned_static_vector&) = default; + aligned_static_vector() = default; + aligned_static_vector(const aligned_static_vector&) = default; + aligned_static_vector(aligned_static_vector&&) noexcept = default; + aligned_static_vector& operator=(const aligned_static_vector&) = default; aligned_static_vector& operator=(aligned_static_vector&&) noexcept = default; aligned_static_vector(size_t _n, Tp _v = {}); diff --git a/projects/rocprofiler-systems/source/lib/core/containers/c_array.hpp b/projects/rocprofiler-systems/source/lib/core/containers/c_array.hpp index 2b423fcaaf..f9b1f0e217 100644 --- a/projects/rocprofiler-systems/source/lib/core/containers/c_array.hpp +++ b/projects/rocprofiler-systems/source/lib/core/containers/c_array.hpp @@ -44,9 +44,9 @@ struct c_array , m_size{ _size } {} - ~c_array() = default; - c_array(const c_array&) = default; - c_array& operator=(const c_array&) = default; + ~c_array() = default; + c_array(const c_array&) = default; + c_array& operator=(const c_array&) = default; c_array& operator=(c_array&&) noexcept = default; // Get the size of the wrapped array diff --git a/projects/rocprofiler-systems/source/lib/core/containers/static_vector.hpp b/projects/rocprofiler-systems/source/lib/core/containers/static_vector.hpp index 4fa41d8a95..304bbc0f02 100644 --- a/projects/rocprofiler-systems/source/lib/core/containers/static_vector.hpp +++ b/projects/rocprofiler-systems/source/lib/core/containers/static_vector.hpp @@ -51,10 +51,10 @@ struct static_vector using size_type = size_t; using difference_type = std::ptrdiff_t; - static_vector() = default; - static_vector(const static_vector&) = default; - static_vector(static_vector&&) noexcept = default; - static_vector& operator=(const static_vector&) = default; + static_vector() = default; + static_vector(const static_vector&) = default; + static_vector(static_vector&&) noexcept = default; + static_vector& operator=(const static_vector&) = default; static_vector& operator=(static_vector&&) noexcept = default; static_vector(size_t _n, Tp _v = {}); diff --git a/projects/rocprofiler-systems/source/lib/core/debug.cpp b/projects/rocprofiler-systems/source/lib/core/debug.cpp index a4d130e678..a380c90170 100644 --- a/projects/rocprofiler-systems/source/lib/core/debug.cpp +++ b/projects/rocprofiler-systems/source/lib/core/debug.cpp @@ -56,7 +56,7 @@ std::atomic& get_file_pointer() { static auto _v = std::atomic{ []() { - const auto&_fname= get_file_name(); + const auto& _fname = get_file_name(); if(!_fname.empty()) tim::log::monochrome() = true; return (_fname.empty()) ? stderr diff --git a/projects/rocprofiler-systems/source/lib/core/defines.hpp.in b/projects/rocprofiler-systems/source/lib/core/defines.hpp.in index 0545bb179e..77e4c7ba7b 100644 --- a/projects/rocprofiler-systems/source/lib/core/defines.hpp.in +++ b/projects/rocprofiler-systems/source/lib/core/defines.hpp.in @@ -28,17 +28,17 @@ #if !defined(ROCPROFSYS_DEFAULT_OBJECT) # define ROCPROFSYS_DEFAULT_OBJECT(NAME) \ - NAME() = default; \ - NAME(const NAME&) = default; \ - NAME(NAME&&) noexcept = default; \ - NAME& operator=(const NAME&) = default; \ + NAME() = default; \ + NAME(const NAME&) = default; \ + NAME(NAME&&) noexcept = default; \ + NAME& operator=(const NAME&) = default; \ NAME& operator=(NAME&&) noexcept = default; #endif #if !defined(ROCPROFSYS_DEFAULT_COPY_MOVE) # define ROCPROFSYS_DEFAULT_COPY_MOVE(NAME) \ - NAME(const NAME&) = default; \ - NAME(NAME&&) noexcept = default; \ - NAME& operator=(const NAME&) = default; \ + NAME(const NAME&) = default; \ + NAME(NAME&&) noexcept = default; \ + NAME& operator=(const NAME&) = default; \ NAME& operator=(NAME&&) noexcept = default; #endif diff --git a/projects/rocprofiler-systems/source/lib/core/dynamic_library.hpp b/projects/rocprofiler-systems/source/lib/core/dynamic_library.hpp index 15ca1d36b8..355db48835 100644 --- a/projects/rocprofiler-systems/source/lib/core/dynamic_library.hpp +++ b/projects/rocprofiler-systems/source/lib/core/dynamic_library.hpp @@ -38,10 +38,10 @@ find_library_path(const std::string& _name, const std::vector& _env struct dynamic_library { - dynamic_library() = delete; - dynamic_library(const dynamic_library&) = delete; - dynamic_library(dynamic_library&&) noexcept = default; - dynamic_library& operator=(const dynamic_library&) = delete; + dynamic_library() = delete; + dynamic_library(const dynamic_library&) = delete; + dynamic_library(dynamic_library&&) noexcept = default; + dynamic_library& operator=(const dynamic_library&) = delete; dynamic_library& operator=(dynamic_library&&) noexcept = default; dynamic_library(std::string _env, std::string _fname, diff --git a/projects/rocprofiler-systems/source/lib/core/exception.cpp b/projects/rocprofiler-systems/source/lib/core/exception.cpp index 570c1305e9..3d66d947c8 100644 --- a/projects/rocprofiler-systems/source/lib/core/exception.cpp +++ b/projects/rocprofiler-systems/source/lib/core/exception.cpp @@ -92,7 +92,7 @@ exception::operator=(const exception& _rhs) if(this != &_rhs) { Tp::operator=(_rhs); - m_what = strdup(_rhs.m_what); + m_what = strdup(_rhs.m_what); } return *this; } diff --git a/projects/rocprofiler-systems/source/lib/core/exception.hpp b/projects/rocprofiler-systems/source/lib/core/exception.hpp index 073b7a281e..d95436e57b 100644 --- a/projects/rocprofiler-systems/source/lib/core/exception.hpp +++ b/projects/rocprofiler-systems/source/lib/core/exception.hpp @@ -39,7 +39,7 @@ public: ~exception() override; - exception(exception&&) noexcept = default; + exception(exception&&) noexcept = default; exception& operator=(exception&&) noexcept = default; exception(const exception&); diff --git a/projects/rocprofiler-systems/source/lib/core/mpi.hpp b/projects/rocprofiler-systems/source/lib/core/mpi.hpp index 9814586553..ad7864938f 100644 --- a/projects/rocprofiler-systems/source/lib/core/mpi.hpp +++ b/projects/rocprofiler-systems/source/lib/core/mpi.hpp @@ -92,12 +92,12 @@ struct dummy_data_type # if defined(MPICH) && (MPICH > 0) static constexpr bool is_mpich = true; # else -static constexpr bool is_mpich = false; +static constexpr bool is_mpich = false; # endif # if defined(OPEN_MPI) && (OPEN_MPI > 0) static constexpr bool is_openmpi = true; # else -static constexpr bool is_openmpi = false; +static constexpr bool is_openmpi = false; # endif #endif @@ -116,9 +116,9 @@ static const comm_t comm_world_v = nullptr; static const comm_t comm_self_v = nullptr; static const info_t info_null_v = nullptr; # else -static const comm_t comm_world_v = MPI_COMM_WORLD; -static const comm_t comm_self_v = MPI_COMM_SELF; -static const info_t info_null_v = MPI_INFO_NULL; +static const comm_t comm_world_v = MPI_COMM_WORLD; +static const comm_t comm_self_v = MPI_COMM_SELF; +static const info_t info_null_v = MPI_INFO_NULL; # endif static const int success_v = MPI_SUCCESS; static const int comm_type_shared_v = MPI_COMM_TYPE_SHARED; @@ -236,7 +236,7 @@ quiet() //--------------------------------------------------------------------------------------// #if !defined(ROCPROFSYS_MPI_ERROR_FUNCTION) -# define ROCPROFSYS_MPI_ERROR_FUNCTION(FUNC, ...) # FUNC +# define ROCPROFSYS_MPI_ERROR_FUNCTION(FUNC, ...) #FUNC #endif #if !defined(ROCPROFSYS_MPI_ERROR_CHECK) @@ -454,8 +454,12 @@ size(comm_t comm) return std::max(_size, (int32_t) 1); } -void set_rank(int32_t, comm_t) {} -void set_size(int32_t, comm_t) {} +void +set_rank(int32_t, comm_t) +{} +void +set_size(int32_t, comm_t) +{} #else diff --git a/projects/rocprofiler-systems/source/lib/core/perf.hpp b/projects/rocprofiler-systems/source/lib/core/perf.hpp index 86492f0624..d57e4e2244 100644 --- a/projects/rocprofiler-systems/source/lib/core/perf.hpp +++ b/projects/rocprofiler-systems/source/lib/core/perf.hpp @@ -61,7 +61,7 @@ enum class sample : uint64_t #if defined(PERF_SAMPLE_READ) read = PERF_SAMPLE_READ, #else - read = 0, + read = 0, #endif callchain = PERF_SAMPLE_CALLCHAIN, @@ -70,61 +70,61 @@ enum class sample : uint64_t #if defined(PERF_SAMPLE_BRANCH_STACK) branch_stack = PERF_SAMPLE_BRANCH_STACK, #else - branch_stack = 0, + branch_stack = 0, #endif #if defined(PERF_SAMPLE_REGS_USER) regs = PERF_SAMPLE_REGS_USER, #else - regs = 0, + regs = 0, #endif #if defined(PERF_SAMPLE_STACK_USER) stack = PERF_SAMPLE_STACK_USER, #else - stack = 0, + stack = 0, #endif #if defined(PERF_SAMPLE_WEIGHT) weight = PERF_SAMPLE_WEIGHT, #else - weight = 0, + weight = 0, #endif #if defined(PERF_SAMPLE_DATA_SRC) data_src = PERF_SAMPLE_DATA_SRC, #else - data_src = 0, + data_src = 0, #endif #if defined(PERF_SAMPLE_IDENTIFIER) identifier = PERF_SAMPLE_IDENTIFIER, #else - identifier = 0, + identifier = 0, #endif #if defined(PERF_SAMPLE_TRANSACTION) transaction = PERF_SAMPLE_TRANSACTION, #else - transaction = 0, + transaction = 0, #endif #if defined(PERF_SAMPLE_REGS_INTR) regs_intr = PERF_SAMPLE_REGS_INTR, #else - regs_intr = 0, + regs_intr = 0, #endif #if defined(PERF_SAMPLE_PHYS_ADDR) phys_addr = PERF_SAMPLE_PHYS_ADDR, #else - phys_addr = 0, + phys_addr = 0, #endif #if defined(PERF_SAMPLE_CGROUP) cgroup = PERF_SAMPLE_CGROUP, #else - cgroup = 0, + cgroup = 0, #endif last = PERF_SAMPLE_MAX @@ -213,31 +213,31 @@ enum class record_type #if defined(PERF_RECORD_MMAP2) mmap2 = PERF_RECORD_MMAP2, #else - mmap2 = 0, + mmap2 = 0, #endif #if defined(PERF_RECORD_AUX) aux = PERF_RECORD_AUX, #else - aux = 0, + aux = 0, #endif #if defined(PERF_RECORD_ITRACE_START) itrace_start = PERF_RECORD_ITRACE_START, #else - itrace_start = 0, + itrace_start = 0, #endif #if defined(PERF_RECORD_LOST_SAMPLES) lost_samples = PERF_RECORD_LOST_SAMPLES, #else - lost_samples = 0, + lost_samples = 0, #endif #if defined(PERF_RECORD_SWITCH) switch_record = PERF_RECORD_SWITCH, #else - switch_record = 0, + switch_record = 0, #endif #if defined(PERF_RECORD_SWITCH_CPU_WIDE) @@ -249,31 +249,31 @@ enum class record_type #if defined(PERF_RECORD_NAMESPACES) namespaces = PERF_RECORD_NAMESPACES, #else - namespaces = 0, + namespaces = 0, #endif #if defined(PERF_RECORD_KSYMBOL) ksymbol = PERF_RECORD_KSYMBOL, #else - ksymbol = 0, + ksymbol = 0, #endif #if defined(PERF_RECORD_BPF_EVENT) bpf_event = PERF_RECORD_BPF_EVENT, #else - bpf_event = 0, + bpf_event = 0, #endif #if defined(PERF_RECORD_CGROUP) cgroup = PERF_RECORD_CGROUP, #else - cgroup = 0, + cgroup = 0, #endif #if defined(PERF_RECORD_TEXT_POKE) text_poke = PERF_RECORD_TEXT_POKE, #else - text_poke = 0, + text_poke = 0, #endif }; diff --git a/projects/rocprofiler-systems/source/lib/core/rocprofiler-sdk.cpp b/projects/rocprofiler-systems/source/lib/core/rocprofiler-sdk.cpp index e39ca29023..917efaf0fc 100644 --- a/projects/rocprofiler-systems/source/lib/core/rocprofiler-sdk.cpp +++ b/projects/rocprofiler-systems/source/lib/core/rocprofiler-sdk.cpp @@ -476,14 +476,13 @@ std::unordered_set get_buffered_domains() { const auto buffer_tracing_info = rocprofiler::sdk::get_buffer_tracing_names(); - const auto supported = std::unordered_set - { + const auto supported = std::unordered_set{ ROCPROFILER_BUFFER_TRACING_KERNEL_DISPATCH, - ROCPROFILER_BUFFER_TRACING_MEMORY_COPY, + ROCPROFILER_BUFFER_TRACING_MEMORY_COPY, # if(ROCPROFILER_VERSION < 10000) - ROCPROFILER_BUFFER_TRACING_PAGE_MIGRATION, + ROCPROFILER_BUFFER_TRACING_PAGE_MIGRATION, # endif - ROCPROFILER_BUFFER_TRACING_SCRATCH_MEMORY, + ROCPROFILER_BUFFER_TRACING_SCRATCH_MEMORY, }; auto _data = std::unordered_set{}; diff --git a/projects/rocprofiler-systems/source/lib/core/utility.cpp b/projects/rocprofiler-systems/source/lib/core/utility.cpp index 528d6f20dd..6f98c65183 100644 --- a/projects/rocprofiler-systems/source/lib/core/utility.cpp +++ b/projects/rocprofiler-systems/source/lib/core/utility.cpp @@ -31,16 +31,16 @@ namespace { template auto -emplace_impl(ContainerT& _targ, Arg&& _v, int) - -> decltype(_targ.emplace(std::forward(_v))) +emplace_impl(ContainerT& _targ, Arg&& _v, + int) -> decltype(_targ.emplace(std::forward(_v))) { return _targ.emplace(std::forward(_v)); } template auto -emplace_impl(ContainerT& _targ, Arg&& _v, long) - -> decltype(_targ.emplace_back(std::forward(_v))) +emplace_impl(ContainerT& _targ, Arg&& _v, + long) -> decltype(_targ.emplace_back(std::forward(_v))) { return _targ.emplace_back(std::forward(_v)); } diff --git a/projects/rocprofiler-systems/source/lib/rocprof-sys-rt/h/Types.h b/projects/rocprofiler-systems/source/lib/rocprof-sys-rt/h/Types.h index 0c676d9ab1..cb84df2526 100644 --- a/projects/rocprofiler-systems/source/lib/rocprof-sys-rt/h/Types.h +++ b/projects/rocprofiler-systems/source/lib/rocprof-sys-rt/h/Types.h @@ -81,7 +81,7 @@ typedef unsigned __int8 uint8_t; # if defined(arch_x86_64) || defined(arch_64bit) # define TYPE64BIT # endif -typedef long double double128_t; +typedef long double double128_t; # elif defined(os_freebsd) # if !defined(__STDC_CONSTANT_MACROS) @@ -136,7 +136,7 @@ typedef int64_t time64; # if defined(__cplusplus) # include "h/dyntypes.h" using namespace Dyninst; -static const Address ADDR_NULL = (Address)(0); +static const Address ADDR_NULL = (Address) (0); # else # define ADDR_NULL (0) typedef unsigned long Address; @@ -152,9 +152,9 @@ typedef long long int RegValue; /* register content 64-bit */ /* This needs to be an int since it is sometimes used to pass offsets to the code generator (i.e. if-statement) - jkh 5/24/99 */ typedef unsigned int Register; /* a register number, e.g., [0..31] */ -static const Register Null_Register = (Register)(-1); /* '255' */ +static const Register Null_Register = (Register) (-1); /* '255' */ /* Easily noticeable name... */ -static const Register REG_NULL = (Register)(-1); +static const Register REG_NULL = (Register) (-1); // Virtual Memory Map -- shared between platforms # define PREMS_PRIVATE (1 << 4) diff --git a/projects/rocprofiler-systems/source/lib/rocprof-sys-rt/h/dyntypes.h b/projects/rocprofiler-systems/source/lib/rocprof-sys-rt/h/dyntypes.h index 09e7468ad9..c21c2e2d61 100644 --- a/projects/rocprofiler-systems/source/lib/rocprof-sys-rt/h/dyntypes.h +++ b/projects/rocprofiler-systems/source/lib/rocprof-sys-rt/h/dyntypes.h @@ -91,10 +91,10 @@ typedef DWORD psaddr_t; // for breakpoints; match the debug struct # define NULL_THR_ID INVALID_HANDLE_VALUE # define DYNINST_SINGLETHREADED INVALID_HANDLE_VALUE # else -typedef int PID; -typedef int PROC_HANDLE; -typedef int LWP; -typedef long THR_ID; +typedef int PID; +typedef int PROC_HANDLE; +typedef int LWP; +typedef long THR_ID; # define NULL_PID -1 # define NULL_LWP -1 diff --git a/projects/rocprofiler-systems/source/lib/rocprof-sys-rt/src/RTcommon.c b/projects/rocprofiler-systems/source/lib/rocprof-sys-rt/src/RTcommon.c index 00e7fe7d9c..9a8e44ffab 100644 --- a/projects/rocprofiler-systems/source/lib/rocprof-sys-rt/src/RTcommon.c +++ b/projects/rocprofiler-systems/source/lib/rocprof-sys-rt/src/RTcommon.c @@ -273,7 +273,7 @@ DYNINST_instForkEntry() DLLEXPORT void DYNINST_instForkExit(void* arg1) { -//#warning "This function is not implemented for AARCH64 yet!" +// #warning "This function is not implemented for AARCH64 yet!" #if !defined(arch_aarch64) tc_lock_lock(&DYNINST_trace_lock); @@ -306,7 +306,7 @@ DYNINST_instForkExit(void* arg1) DLLEXPORT void DYNINST_instExecEntry(void* arg1) { -//#warning "This function is not implemented for AARCH64 yet!" +// #warning "This function is not implemented for AARCH64 yet!" #if !defined(arch_aarch64) tc_lock_lock(&DYNINST_trace_lock); @@ -446,7 +446,7 @@ cacheLookup(void* calculation) * bit 1: true if interpAsTarget * bit 2: true if interpAsReturnAddr **/ -//#define STACKDUMP +// #define STACKDUMP void DYNINST_stopThread(void* pointAddr, void* callBackID, void* flags, void* calculation) { diff --git a/projects/rocprofiler-systems/source/lib/rocprof-sys-rt/src/RTheap-win.c b/projects/rocprofiler-systems/source/lib/rocprof-sys-rt/src/RTheap-win.c index 5916c74bba..99bbc74c2f 100644 --- a/projects/rocprofiler-systems/source/lib/rocprof-sys-rt/src/RTheap-win.c +++ b/projects/rocprofiler-systems/source/lib/rocprof-sys-rt/src/RTheap-win.c @@ -61,7 +61,7 @@ map_region(void* addr, int len, int fd) FormatMessage(FORMAT_MESSAGE_ALLOCATE_BUFFER | FORMAT_MESSAGE_FROM_SYSTEM | FORMAT_MESSAGE_IGNORE_INSERTS, NULL, lastError, MAKELANGID(LANG_NEUTRAL, SUBLANG_DEFAULT), - (LPTSTR)(lpMessage), 0, NULL); + (LPTSTR) (lpMessage), 0, NULL); fprintf(stderr, "VirtualAlloc failed in RTlib: %s\n", lpMessage); LocalFree((LPVOID) lpMessage); } diff --git a/projects/rocprofiler-systems/source/lib/rocprof-sys-rt/src/RTlinux.c b/projects/rocprofiler-systems/source/lib/rocprof-sys-rt/src/RTlinux.c index 0d4be45766..e468a15db9 100644 --- a/projects/rocprofiler-systems/source/lib/rocprof-sys-rt/src/RTlinux.c +++ b/projects/rocprofiler-systems/source/lib/rocprof-sys-rt/src/RTlinux.c @@ -377,8 +377,8 @@ DYNINST_am_initial_thread(dyntid_t tid) # define UC_PC(x) x->uc_mcontext.uc_regs->gregs[32] # endif // power # elif defined(arch_aarch64) -//#warning "UC_PC: in aarch64, pc is not directly accessable." -// aarch64 pc is not one of 31 GPRs, but an independent reg +// #warning "UC_PC: in aarch64, pc is not directly accessable." +// aarch64 pc is not one of 31 GPRs, but an independent reg # define UC_PC(x) x->uc_mcontext.pc # endif // UC_PC diff --git a/projects/rocprofiler-systems/source/lib/rocprof-sys-rt/src/RTmemEmulator.c b/projects/rocprofiler-systems/source/lib/rocprof-sys-rt/src/RTmemEmulator.c index 78c97be97c..bede66228a 100644 --- a/projects/rocprofiler-systems/source/lib/rocprof-sys-rt/src/RTmemEmulator.c +++ b/projects/rocprofiler-systems/source/lib/rocprof-sys-rt/src/RTmemEmulator.c @@ -55,7 +55,7 @@ struct MemoryMapper RTmemoryMapper = { 0, 0, 0, 0, { { 0 } } }; #endif extern FILE* stOut; -//#define DEBUG_MEM_EM +// #define DEBUG_MEM_EM unsigned long RTtranslateMemory(unsigned long input, unsigned long origAddr, unsigned long currAddr) diff --git a/projects/rocprofiler-systems/source/lib/rocprof-sys-rt/src/RTstatic_ctors_dtors-aarch64.c b/projects/rocprofiler-systems/source/lib/rocprof-sys-rt/src/RTstatic_ctors_dtors-aarch64.c index b915ae3761..8f545aa076 100644 --- a/projects/rocprofiler-systems/source/lib/rocprof-sys-rt/src/RTstatic_ctors_dtors-aarch64.c +++ b/projects/rocprofiler-systems/source/lib/rocprof-sys-rt/src/RTstatic_ctors_dtors-aarch64.c @@ -28,7 +28,7 @@ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA */ -//#warning "This file is not implemented yet!" +// #warning "This file is not implemented yet!" #if defined(DYNINST_RT_STATIC_LIB) @@ -37,19 +37,19 @@ void (*DYNINSTctors_addr)(void); void (*DYNINSTdtors_addr)(void); -//#if defined(MUTATEE64) -// static const unsigned long long CTOR_LIST_TERM = 0x0000000000000000ULL; -// static const unsigned long long CTOR_LIST_START = 0xffffffffffffffffULL; -// static const unsigned long long DTOR_LIST_TERM = 0x0000000000000000ULL; -// static const unsigned long long DTOR_LIST_START = 0xffffffffffffffffULL; -//#else +// #if defined(MUTATEE64) +// static const unsigned long long CTOR_LIST_TERM = 0x0000000000000000ULL; +// static const unsigned long long CTOR_LIST_START = 0xffffffffffffffffULL; +// static const unsigned long long DTOR_LIST_TERM = 0x0000000000000000ULL; +// static const unsigned long long DTOR_LIST_START = 0xffffffffffffffffULL; +// #else /* static const unsigned CTOR_LIST_TERM = 0x00000000; static const unsigned CTOR_LIST_START = 0xffffffff; static const unsigned DTOR_LIST_TERM = 0x00000000; static const unsigned DTOR_LIST_START = 0xffffffff; */ -//#endif +// #endif extern void DYNINSTBaseInit(); @@ -68,14 +68,14 @@ DYNINSTBaseInit(); void DYNINSTglobal_ctors_handler() { - //#warning "This function is not implemented yet!" + // #warning "This function is not implemented yet!" assert(0); } void DYNINSTglobal_dtors_handler() { - //#warning "This function is not implemented yet!" + // #warning "This function is not implemented yet!" assert(0); } diff --git a/projects/rocprofiler-systems/source/lib/rocprof-sys-rt/src/RTstatic_ctors_dtors-x86.c b/projects/rocprofiler-systems/source/lib/rocprof-sys-rt/src/RTstatic_ctors_dtors-x86.c index 76e8fabec6..4be692e3e5 100644 --- a/projects/rocprofiler-systems/source/lib/rocprof-sys-rt/src/RTstatic_ctors_dtors-x86.c +++ b/projects/rocprofiler-systems/source/lib/rocprof-sys-rt/src/RTstatic_ctors_dtors-x86.c @@ -119,7 +119,7 @@ DYNINSTglobal_irel_handler() long (*ptr)(void) = 0; long result = 0; if(rel->info != 0x2a) continue; - ptr = (funcptr)(*rel->offset); + ptr = (funcptr) (*rel->offset); result = ptr(); *(rel->offset) = result; } diff --git a/projects/rocprofiler-systems/source/lib/rocprof-sys-rt/src/RTthread.h b/projects/rocprofiler-systems/source/lib/rocprof-sys-rt/src/RTthread.h index ecd3d1353d..863f3f7e5e 100644 --- a/projects/rocprofiler-systems/source/lib/rocprof-sys-rt/src/RTthread.h +++ b/projects/rocprofiler-systems/source/lib/rocprof-sys-rt/src/RTthread.h @@ -45,7 +45,7 @@ extern int DYNINST_multithread_capable; typedef dyninst_lock_t tc_lock_t; -#define DECLARE_TC_LOCK(l) tc_lock_t l = { 0, (dyntid_t) -1 } +#define DECLARE_TC_LOCK(l) tc_lock_t l = { 0, (dyntid_t) - 1 } int tc_lock_init(tc_lock_t*); diff --git a/projects/rocprofiler-systems/source/lib/rocprof-sys-rt/src/RTwinnt.c b/projects/rocprofiler-systems/source/lib/rocprof-sys-rt/src/RTwinnt.c index 2ebfa0f757..9ed3692a60 100644 --- a/projects/rocprofiler-systems/source/lib/rocprof-sys-rt/src/RTwinnt.c +++ b/projects/rocprofiler-systems/source/lib/rocprof-sys-rt/src/RTwinnt.c @@ -363,10 +363,10 @@ getStaticTrapMap(unsigned long addr, unsigned long* allocBase) // see if the last section has been tagged with "DYNINST_REWRITE" numSections = peHdr->FileHeader.NumberOfSections; - curSecn = *(PIMAGE_SECTION_HEADER)(((unsigned char*) peHdr) + sizeof(DWORD) + - sizeof(IMAGE_FILE_HEADER) + - peHdr->FileHeader.SizeOfOptionalHeader + - sizeof(IMAGE_SECTION_HEADER) * (numSections - 1)); + curSecn = *(PIMAGE_SECTION_HEADER) (((unsigned char*) peHdr) + sizeof(DWORD) + + sizeof(IMAGE_FILE_HEADER) + + peHdr->FileHeader.SizeOfOptionalHeader + + sizeof(IMAGE_SECTION_HEADER) * (numSections - 1)); // fprintf(stderr, "RTLIB: PE section header address = %lx\n", curSecn); // fprintf(stderr, "curSecn.chars = %lx %s[%d]\n",curSecn.Characteristics, diff --git a/projects/rocprofiler-systems/source/lib/rocprof-sys-user/rocprofiler-systems/causal.h b/projects/rocprofiler-systems/source/lib/rocprof-sys-user/rocprofiler-systems/causal.h index 89723d0c96..ee6dc589dd 100644 --- a/projects/rocprofiler-systems/source/lib/rocprof-sys-user/rocprofiler-systems/causal.h +++ b/projects/rocprofiler-systems/source/lib/rocprof-sys-user/rocprofiler-systems/causal.h @@ -41,7 +41,7 @@ # if !defined(ROCPROFSYS_CAUSAL_LABEL) /** @cond ROCPROFSYS_HIDDEN_DEFINES */ -# define ROCPROFSYS_CAUSAL_STR2(x) # x +# define ROCPROFSYS_CAUSAL_STR2(x) #x # define ROCPROFSYS_CAUSAL_STR(x) ROCPROFSYS_CAUSAL_STR2(x) /** @endcond */ /** Default label for a causal progress point */ diff --git a/projects/rocprofiler-systems/source/lib/rocprof-sys/library/amd_smi.hpp b/projects/rocprofiler-systems/source/lib/rocprof-sys/library/amd_smi.hpp index ec5619434c..ca5f2c4dfb 100644 --- a/projects/rocprofiler-systems/source/lib/rocprof-sys/library/amd_smi.hpp +++ b/projects/rocprofiler-systems/source/lib/rocprof-sys/library/amd_smi.hpp @@ -165,7 +165,9 @@ inline void post_process() {} -inline void set_state(State) {} +inline void +set_state(State) +{} #endif } // namespace amd_smi } // namespace rocprofsys diff --git a/projects/rocprofiler-systems/source/lib/rocprof-sys/library/causal/components/backtrace.hpp b/projects/rocprofiler-systems/source/lib/rocprof-sys/library/causal/components/backtrace.hpp index 4dbcb500f6..d23bfbf02b 100644 --- a/projects/rocprofiler-systems/source/lib/rocprof-sys/library/causal/components/backtrace.hpp +++ b/projects/rocprofiler-systems/source/lib/rocprof-sys/library/causal/components/backtrace.hpp @@ -82,7 +82,7 @@ struct backtrace : comp::empty_base backtrace(const backtrace&) = default; backtrace(backtrace&&) noexcept = default; - backtrace& operator=(const backtrace&) = default; + backtrace& operator=(const backtrace&) = default; backtrace& operator=(backtrace&&) noexcept = default; void sample(int = -1); diff --git a/projects/rocprofiler-systems/source/lib/rocprof-sys/library/causal/data.cpp b/projects/rocprofiler-systems/source/lib/rocprof-sys/library/causal/data.cpp index 93e2bfbc01..3f2a23168c 100644 --- a/projects/rocprofiler-systems/source/lib/rocprof-sys/library/causal/data.cpp +++ b/projects/rocprofiler-systems/source/lib/rocprof-sys/library/causal/data.cpp @@ -82,13 +82,13 @@ auto speedup_dist = []() { size_t _n = std::max(1, 100 / speedup_divisions); std::vector _v(_n, uint16_t{ 0 }); std::generate(_v.begin(), _v.end(), - [_value = 0]() mutable { return (_value += speedup_divisions); }); + [_value = 0]() mutable { return (_value += speedup_divisions); }); // approximately 25% of bins should be zero speedup size_t _nzero = std::ceil(_v.size() / 4.0); _v.resize(_v.size() + _nzero, 0); std::sort(_v.begin(), _v.end()); ROCPROFSYS_CI_THROW(_v.back() > 100, "Error! last value is too large: %i\n", - (int) _v.back()); + (int) _v.back()); return _v; }(); @@ -899,7 +899,7 @@ get_line_info(uintptr_t _addr, bool _include_discarded) // make sure the address is in the coarse grained mapped regions // before performing an exhaustive search bool _is_mapped = std::find_if(litr.mappings.begin(), litr.mappings.end(), - [_addr](const auto& mitr) { + [_addr](const auto& mitr) { return address_range_t{ mitr.load_address, mitr.last_address } .contains(_addr); @@ -939,7 +939,7 @@ get_line_info(uintptr_t _addr, bool _include_discarded) if(!_ipaddr.contains(itr.ipaddr())) ROCPROFSYS_THROW( "Error! debug line info ipaddr (%s) is not contained in " - "symbol ipaddr (%s)", + "symbol ipaddr (%s)", as_hex(itr.ipaddr()).c_str(), as_hex(_ipaddr).c_str()); if(itr.ipaddr().contains(_addr)) _debug_data.emplace_back(itr); } diff --git a/projects/rocprofiler-systems/source/lib/rocprof-sys/library/causal/sampling.cpp b/projects/rocprofiler-systems/source/lib/rocprof-sys/library/causal/sampling.cpp index 21148fe4c8..4e207c0986 100644 --- a/projects/rocprofiler-systems/source/lib/rocprof-sys/library/causal/sampling.cpp +++ b/projects/rocprofiler-systems/source/lib/rocprof-sys/library/causal/sampling.cpp @@ -462,7 +462,8 @@ sampling_signals() } // namespace template -void pause(ScopeT) +void +pause(ScopeT) { static_assert( tim::is_one_of -void resume(ScopeT) +void +resume(ScopeT) { static_assert( tim::is_one_of filter_and_patch(const std::vector&); diff --git a/projects/rocprofiler-systems/source/lib/rocprof-sys/library/components/backtrace_metrics.cpp b/projects/rocprofiler-systems/source/lib/rocprof-sys/library/components/backtrace_metrics.cpp index 919b4189ca..fcc533f2c7 100644 --- a/projects/rocprofiler-systems/source/lib/rocprof-sys/library/components/backtrace_metrics.cpp +++ b/projects/rocprofiler-systems/source/lib/rocprof-sys/library/components/backtrace_metrics.cpp @@ -148,7 +148,8 @@ backtrace_metrics::stop() namespace { template -auto get_enabled(tim::type_list) +auto +get_enabled(tim::type_list) { constexpr size_t N = sizeof...(Tp); auto _v = std::bitset{}; diff --git a/projects/rocprofiler-systems/source/lib/rocprof-sys/library/components/backtrace_metrics.hpp b/projects/rocprofiler-systems/source/lib/rocprof-sys/library/components/backtrace_metrics.hpp index d6ca9a670a..c9211aeb23 100644 --- a/projects/rocprofiler-systems/source/lib/rocprof-sys/library/components/backtrace_metrics.hpp +++ b/projects/rocprofiler-systems/source/lib/rocprof-sys/library/components/backtrace_metrics.hpp @@ -77,7 +77,7 @@ struct backtrace_metrics : comp::empty_base backtrace_metrics(const backtrace_metrics&) = default; backtrace_metrics(backtrace_metrics&&) noexcept = default; - backtrace_metrics& operator=(const backtrace_metrics&) = default; + backtrace_metrics& operator=(const backtrace_metrics&) = default; backtrace_metrics& operator=(backtrace_metrics&&) noexcept = default; static void configure(bool, int64_t _tid = threading::get_id()); @@ -140,7 +140,8 @@ backtrace_metrics::get_valid(type_list, valid_array_t _valid) } template -bool backtrace_metrics::operator()(type_list) const +bool +backtrace_metrics::operator()(type_list) const { static_assert(!concepts::is_type_listing::value, "Error! invalid call with tuple"); @@ -157,7 +158,8 @@ backtrace_metrics::get_valid(Tp, valid_array_t _valid) } template -bool backtrace_metrics::operator()(Tp) const +bool +backtrace_metrics::operator()(Tp) const { return (*this)(type_list{}); } diff --git a/projects/rocprofiler-systems/source/lib/rocprof-sys/library/components/backtrace_timestamp.hpp b/projects/rocprofiler-systems/source/lib/rocprof-sys/library/components/backtrace_timestamp.hpp index f38ede8d75..e4cc577633 100644 --- a/projects/rocprofiler-systems/source/lib/rocprof-sys/library/components/backtrace_timestamp.hpp +++ b/projects/rocprofiler-systems/source/lib/rocprof-sys/library/components/backtrace_timestamp.hpp @@ -50,7 +50,7 @@ struct backtrace_timestamp : comp::empty_base backtrace_timestamp(const backtrace_timestamp&) = default; backtrace_timestamp(backtrace_timestamp&&) noexcept = default; - backtrace_timestamp& operator=(const backtrace_timestamp&) = default; + backtrace_timestamp& operator=(const backtrace_timestamp&) = default; backtrace_timestamp& operator=(backtrace_timestamp&&) noexcept = default; bool operator<(const backtrace_timestamp& rhs) const; diff --git a/projects/rocprofiler-systems/source/lib/rocprof-sys/library/components/callchain.hpp b/projects/rocprofiler-systems/source/lib/rocprof-sys/library/components/callchain.hpp index 3c1b433b71..48564432f7 100644 --- a/projects/rocprofiler-systems/source/lib/rocprof-sys/library/components/callchain.hpp +++ b/projects/rocprofiler-systems/source/lib/rocprof-sys/library/components/callchain.hpp @@ -73,7 +73,7 @@ struct callchain : comp::empty_base callchain(const callchain&) = default; callchain(callchain&&) noexcept = default; - callchain& operator=(const callchain&) = default; + callchain& operator=(const callchain&) = default; callchain& operator=(callchain&&) noexcept = default; static std::vector filter_and_patch( diff --git a/projects/rocprofiler-systems/source/lib/rocprof-sys/library/cpu_freq.cpp b/projects/rocprofiler-systems/source/lib/rocprof-sys/library/cpu_freq.cpp index b9b7d4aaef..e21058a998 100644 --- a/projects/rocprofiler-systems/source/lib/rocprof-sys/library/cpu_freq.cpp +++ b/projects/rocprofiler-systems/source/lib/rocprof-sys/library/cpu_freq.cpp @@ -60,7 +60,8 @@ using cpu_data_tuple_t = std::tuple data = {}; template -void init_perfetto_counter_tracks(type_list) +void +init_perfetto_counter_tracks(type_list) { (perfetto_counter_track::init(), ...); } diff --git a/projects/rocprofiler-systems/source/lib/rocprof-sys/library/ompt.cpp b/projects/rocprofiler-systems/source/lib/rocprof-sys/library/ompt.cpp index 4f8ba8953d..ab5d756971 100644 --- a/projects/rocprofiler-systems/source/lib/rocprof-sys/library/ompt.cpp +++ b/projects/rocprofiler-systems/source/lib/rocprof-sys/library/ompt.cpp @@ -74,7 +74,7 @@ struct ompt : comp::base ompt(const ompt&) = default; ompt(ompt&&) noexcept = default; - ompt& operator=(const ompt&) = default; + ompt& operator=(const ompt&) = default; ompt& operator=(ompt&&) noexcept = default; template diff --git a/projects/rocprofiler-systems/source/lib/rocprof-sys/library/perf.cpp b/projects/rocprofiler-systems/source/lib/rocprof-sys/library/perf.cpp index e57c0edc37..355ab5974c 100644 --- a/projects/rocprofiler-systems/source/lib/rocprof-sys/library/perf.cpp +++ b/projects/rocprofiler-systems/source/lib/rocprof-sys/library/perf.cpp @@ -178,8 +178,8 @@ perf_event::open(struct perf_event_attr& _pe, pid_t _pid, int _cpu) ROCPROFSYS_RETURN_ERROR_MSG( true, "Failed to open perf event. Consider tweaking " - << path << " to 2 or less " - << "(current value is " << value << "), " + << path << " to 2 or less " << "(current value is " << value + << "), " << "or run rocprof-sys as a privileged user (with CAP_SYS_ADMIN)."); } diff --git a/projects/rocprofiler-systems/source/lib/rocprof-sys/library/perf.hpp b/projects/rocprofiler-systems/source/lib/rocprof-sys/library/perf.hpp index 8f2243d59f..d6b166493a 100644 --- a/projects/rocprofiler-systems/source/lib/rocprof-sys/library/perf.hpp +++ b/projects/rocprofiler-systems/source/lib/rocprof-sys/library/perf.hpp @@ -61,7 +61,7 @@ struct perf_event /// Move assignment is supported perf_event& operator=(perf_event&& other) noexcept; - perf_event(const perf_event&) = delete; + perf_event(const perf_event&) = delete; perf_event& operator=(const perf_event&) = delete; /// Open a perf_event file using the given options structure @@ -108,15 +108,15 @@ struct perf_event { friend class perf_event::iterator; - record() = default; - ~record() = default; - record(const record&) = default; - record(record&&) noexcept = default; - record& operator=(const record&) = default; + record() = default; + ~record() = default; + record(const record&) = default; + record(record&&) noexcept = default; + record& operator=(const record&) = default; record& operator=(record&&) noexcept = default; bool is_valid() const { return (m_source != nullptr && m_header != nullptr); } - operator bool() const { return is_valid(); } + operator bool() const { return is_valid(); } record_type get_type() const { return static_cast(m_header->type); } diff --git a/projects/rocprofiler-systems/source/lib/rocprof-sys/library/rocprofiler-sdk.cpp b/projects/rocprofiler-systems/source/lib/rocprof-sys/library/rocprofiler-sdk.cpp index 51c9d6e570..e7494f4657 100644 --- a/projects/rocprofiler-systems/source/lib/rocprof-sys/library/rocprofiler-sdk.cpp +++ b/projects/rocprofiler-systems/source/lib/rocprof-sys/library/rocprofiler-sdk.cpp @@ -1085,18 +1085,18 @@ tool_init(rocprofiler_client_finalize_t fini_func, void* user_data) for(auto itr : { ROCPROFILER_CALLBACK_TRACING_HSA_CORE_API, - ROCPROFILER_CALLBACK_TRACING_HSA_AMD_EXT_API, - ROCPROFILER_CALLBACK_TRACING_HSA_IMAGE_EXT_API, - ROCPROFILER_CALLBACK_TRACING_HSA_FINALIZE_EXT_API, - ROCPROFILER_CALLBACK_TRACING_HIP_RUNTIME_API, - ROCPROFILER_CALLBACK_TRACING_HIP_COMPILER_API, - ROCPROFILER_CALLBACK_TRACING_MARKER_CORE_API, - ROCPROFILER_CALLBACK_TRACING_RCCL_API, + ROCPROFILER_CALLBACK_TRACING_HSA_AMD_EXT_API, + ROCPROFILER_CALLBACK_TRACING_HSA_IMAGE_EXT_API, + ROCPROFILER_CALLBACK_TRACING_HSA_FINALIZE_EXT_API, + ROCPROFILER_CALLBACK_TRACING_HIP_RUNTIME_API, + ROCPROFILER_CALLBACK_TRACING_HIP_COMPILER_API, + ROCPROFILER_CALLBACK_TRACING_MARKER_CORE_API, + ROCPROFILER_CALLBACK_TRACING_RCCL_API, #if(ROCPROFILER_VERSION >= 600) - ROCPROFILER_CALLBACK_TRACING_ROCDECODE_API, + ROCPROFILER_CALLBACK_TRACING_ROCDECODE_API, #endif #if(ROCPROFILER_VERSION >= 700) - ROCPROFILER_CALLBACK_TRACING_ROCJPEG_API, + ROCPROFILER_CALLBACK_TRACING_ROCJPEG_API, #endif }) { diff --git a/projects/rocprofiler-systems/source/lib/rocprof-sys/library/rocprofiler-sdk/counters.hpp b/projects/rocprofiler-systems/source/lib/rocprof-sys/library/rocprofiler-sdk/counters.hpp index e3af71b130..f67d873113 100644 --- a/projects/rocprofiler-systems/source/lib/rocprof-sys/library/rocprofiler-sdk/counters.hpp +++ b/projects/rocprofiler-systems/source/lib/rocprof-sys/library/rocprofiler-sdk/counters.hpp @@ -93,11 +93,11 @@ struct counter_storage counter_storage(const client_data* _tool_data, uint64_t _devid, size_t _idx, std::string_view _name); - ~counter_storage() = default; - counter_storage(const counter_storage&) = delete; - counter_storage(counter_storage&&) = default; + ~counter_storage() = default; + counter_storage(const counter_storage&) = delete; + counter_storage(counter_storage&&) = default; counter_storage& operator=(const counter_storage&) = delete; - counter_storage& operator=(counter_storage&&) = default; + counter_storage& operator=(counter_storage&&) = default; friend bool operator<(const counter_storage& lhs, const counter_storage& rhs) { diff --git a/projects/rocprofiler-systems/source/lib/rocprof-sys/library/rocprofiler-sdk/fwd.hpp b/projects/rocprofiler-systems/source/lib/rocprof-sys/library/rocprofiler-sdk/fwd.hpp index 4c1a62945e..28a26b9284 100644 --- a/projects/rocprofiler-systems/source/lib/rocprof-sys/library/rocprofiler-sdk/fwd.hpp +++ b/projects/rocprofiler-systems/source/lib/rocprof-sys/library/rocprofiler-sdk/fwd.hpp @@ -79,7 +79,7 @@ struct rocprofiler_tool_counter_info_t : rocprofiler_counter_info_v0_t rocprofiler_tool_counter_info_t(rocprofiler_tool_counter_info_t&&) noexcept = default; rocprofiler_tool_counter_info_t& operator=(const rocprofiler_tool_counter_info_t&) = default; - rocprofiler_tool_counter_info_t& operator =( + rocprofiler_tool_counter_info_t& operator=( rocprofiler_tool_counter_info_t&&) noexcept = default; rocprofiler_agent_id_t agent_id = {}; diff --git a/projects/rocprofiler-systems/source/lib/rocprof-sys/library/thread_data.hpp b/projects/rocprofiler-systems/source/lib/rocprof-sys/library/thread_data.hpp index 147d93f536..9c1e005f5b 100644 --- a/projects/rocprofiler-systems/source/lib/rocprof-sys/library/thread_data.hpp +++ b/projects/rocprofiler-systems/source/lib/rocprof-sys/library/thread_data.hpp @@ -261,7 +261,7 @@ struct thread_data, Tag, MaxThreads> thread_data(const thread_data&) = default; thread_data(thread_data&&) noexcept = default; - thread_data& operator=(const thread_data&) = default; + thread_data& operator=(const thread_data&) = default; thread_data& operator=(thread_data&&) noexcept = default; static unique_ptr_t& instance(); @@ -432,7 +432,7 @@ struct thread_data, Tag, MaxThreads> thread_data(const thread_data&) = default; thread_data(thread_data&&) noexcept = default; - thread_data& operator=(const thread_data&) = default; + thread_data& operator=(const thread_data&) = default; thread_data& operator=(thread_data&&) noexcept = default; static unique_ptr_t& instance(); diff --git a/projects/rocprofiler-systems/source/lib/rocprof-sys/library/thread_info.hpp b/projects/rocprofiler-systems/source/lib/rocprof-sys/library/thread_info.hpp index b54b4051ed..dee22fe68a 100644 --- a/projects/rocprofiler-systems/source/lib/rocprof-sys/library/thread_info.hpp +++ b/projects/rocprofiler-systems/source/lib/rocprof-sys/library/thread_info.hpp @@ -93,7 +93,7 @@ struct thread_info thread_info(thread_info&&) = default; thread_info& operator=(const thread_info&) = delete; - thread_info& operator=(thread_info&&) = default; + thread_info& operator=(thread_info&&) = default; static void set_start(uint64_t, bool _force = false); static void set_stop(uint64_t); diff --git a/projects/rocprofiler-systems/source/lib/rocprof-sys/library/tpls/mpi/mpi.h b/projects/rocprofiler-systems/source/lib/rocprof-sys/library/tpls/mpi/mpi.h index 277176d9ea..db3e6e15b5 100644 --- a/projects/rocprofiler-systems/source/lib/rocprof-sys/library/tpls/mpi/mpi.h +++ b/projects/rocprofiler-systems/source/lib/rocprof-sys/library/tpls/mpi/mpi.h @@ -387,7 +387,7 @@ # define OMPI_PREDEFINED_GLOBAL(type, global) \ (static_cast(static_cast(&(global)))) # else -# define OMPI_PREDEFINED_GLOBAL(type, global) ((type)((void*) &(global))) +# define OMPI_PREDEFINED_GLOBAL(type, global) ((type) ((void*) &(global))) # endif #else # define OMPI_PREDEFINED_GLOBAL(type, global) ((type) & (global)) @@ -718,7 +718,7 @@ extern "C" #if(OMPI_ENABLE_MPI1_COMPAT || OMPI_BUILDING) MPI_COMBINER_HVECTOR_INTEGER, #else - OMPI_WAS_MPI_COMBINER_HVECTOR_INTEGER, /* preserve ABI compatibility */ + OMPI_WAS_MPI_COMBINER_HVECTOR_INTEGER, /* preserve ABI compatibility */ #endif MPI_COMBINER_HVECTOR, MPI_COMBINER_INDEXED, @@ -732,7 +732,7 @@ extern "C" #if(OMPI_ENABLE_MPI1_COMPAT || OMPI_BUILDING) MPI_COMBINER_STRUCT_INTEGER, #else - OMPI_WAS_MPI_COMBINER_STRUCT_INTEGER, /* preserve ABI compatibility */ + OMPI_WAS_MPI_COMBINER_STRUCT_INTEGER, /* preserve ABI compatibility */ #endif MPI_COMBINER_STRUCT, MPI_COMBINER_SUBARRAY, @@ -882,7 +882,7 @@ extern "C" /* * Special MPI_T handles */ -#define MPI_T_PVAR_ALL_HANDLES ((MPI_T_pvar_handle) -1) +#define MPI_T_PVAR_ALL_HANDLES ((MPI_T_pvar_handle) - 1) #define MPI_T_PVAR_HANDLE_NULL ((MPI_T_pvar_handle) 0) #define MPI_T_PVAR_SESSION_NULL ((MPI_T_pvar_session) 0) #define MPI_T_CVAR_HANDLE_NULL ((MPI_T_cvar_handle) 0) @@ -1284,8 +1284,8 @@ extern "C" #define MPI_TYPECLASS_COMPLEX 3 /* Aint helper macros (MPI-3.1) */ -#define MPI_Aint_add(base, disp) ((MPI_Aint)((char*) (base) + (disp))) -#define MPI_Aint_diff(addr1, addr2) ((MPI_Aint)((char*) (addr1) - (char*) (addr2))) +#define MPI_Aint_add(base, disp) ((MPI_Aint) ((char*) (base) + (disp))) +#define MPI_Aint_diff(addr1, addr2) ((MPI_Aint) ((char*) (addr1) - (char*) (addr2))) #define PMPI_Aint_add(base, disp) MPI_Aint_add(base, disp) #define PMPI_Aint_diff(addr1, addr2) MPI_Aint_diff(addr1, addr2) diff --git a/projects/rocprofiler-systems/source/lib/rocprof-sys/library/tpls/mpi/mpi_portable_platform.h b/projects/rocprofiler-systems/source/lib/rocprof-sys/library/tpls/mpi/mpi_portable_platform.h index 74689d0efc..2894985645 100644 --- a/projects/rocprofiler-systems/source/lib/rocprof-sys/library/tpls/mpi/mpi_portable_platform.h +++ b/projects/rocprofiler-systems/source/lib/rocprof-sys/library/tpls/mpi/mpi_portable_platform.h @@ -73,7 +73,7 @@ * */ #ifndef _STRINGIFY -# define _STRINGIFY_HELPER(x) # x +# define _STRINGIFY_HELPER(x) #x # define _STRINGIFY(x) _STRINGIFY_HELPER(x) #endif @@ -94,10 +94,10 @@ # endif /* patch number is a decimal build date: YYYYMMDD */ # define PLATFORM_COMPILER_VERSION_INT(maj, min, pat) \ - (((((maj) *10) | (min)) << 20) | \ + (((((maj) * 10) | (min)) << 20) | \ ((pat) < _PLATFORM_COMPILER_INTEL_MIN_BUILDDATE \ ? _PLATFORM_COMPILER_INTEL_MIN_BUILDDATE \ - : ((pat) -_PLATFORM_COMPILER_INTEL_MIN_BUILDDATE))) + : ((pat) - _PLATFORM_COMPILER_INTEL_MIN_BUILDDATE))) # define PLATFORM_COMPILER_VERSION \ PLATFORM_COMPILER_VERSION_INT(__INTEL_COMPILER / 10, __INTEL_COMPILER / 100, \ _PLATFORM_INTEL_COMPILER_BUILD_DATE) @@ -207,7 +207,7 @@ # endif # define PLATFORM_COMPILER_VERSION_INT(maj, min, pat) \ - (((maj) *10000000) + ((min) *100000) + (90000) + (pat)) + (((maj) * 10000000) + ((min) * 100000) + (90000) + (pat)) /* 90000 = official ver, 80000 = customer special ver, 60000 = field test ver */ #elif defined(__SUNPRO_C) || defined(__SUNPRO_CC) diff --git a/projects/rocprofiler-systems/source/lib/rocprof-sys/library/tracing/annotation.hpp b/projects/rocprofiler-systems/source/lib/rocprof-sys/library/tracing/annotation.hpp index c67228c9cc..d586c190ac 100644 --- a/projects/rocprofiler-systems/source/lib/rocprof-sys/library/tracing/annotation.hpp +++ b/projects/rocprofiler-systems/source/lib/rocprof-sys/library/tracing/annotation.hpp @@ -230,8 +230,8 @@ struct annotate private: // If the component has a annotate(...) member function template - static auto sfinae(T& obj, int, perfetto_event_context_t& _ctx) - -> decltype(obj.annotate(_ctx)) + static auto sfinae(T& obj, int, + perfetto_event_context_t& _ctx) -> decltype(obj.annotate(_ctx)) { static_assert(std::is_same::value, "Error T != Tp"); return obj.annotate(_ctx); diff --git a/projects/rocprofiler-systems/source/lib/rocprof-sys/timeout.cpp b/projects/rocprofiler-systems/source/lib/rocprof-sys/timeout.cpp index 9ebf4dda30..017e6ef486 100644 --- a/projects/rocprofiler-systems/source/lib/rocprof-sys/timeout.cpp +++ b/projects/rocprofiler-systems/source/lib/rocprof-sys/timeout.cpp @@ -137,7 +137,7 @@ ensure_ci_timeout_backtrace(double _ci_timeout_seconds, ROCPROFSYS_WARNING_F( 0, "pthread_kill(%zu, %i) failed. executing generic " - "kill(%i, %i)...\n", + "kill(%i, %i)...\n", _handle, timeout_signal_v, process::get_id(), timeout_signal_v); } diff --git a/projects/rocprofiler-systems/source/python/libpyrocprofsys.cpp b/projects/rocprofiler-systems/source/python/libpyrocprofsys.cpp index aeb73d255c..a197ba6634 100644 --- a/projects/rocprofiler-systems/source/python/libpyrocprofsys.cpp +++ b/projects/rocprofiler-systems/source/python/libpyrocprofsys.cpp @@ -100,11 +100,9 @@ PYBIND11_MODULE(libpyrocprofsys, omni) return _use_mpi; }; - omni.def( - "is_initialized", []() { return _is_initialized; }, "Initialization state"); + omni.def("is_initialized", []() { return _is_initialized; }, "Initialization state"); - omni.def( - "is_finalized", []() { return _is_finalized; }, "Finalization state"); + omni.def("is_finalized", []() { return _is_finalized; }, "Finalization state"); omni.def( "initialize", @@ -224,11 +222,11 @@ struct config strset_t exclude_filenames = default_exclude_filenames; std::vector records = {}; annotations_t annotations = { note_t{ "file", ROCPROFSYS_STRING, nullptr }, - note_t{ "line", ROCPROFSYS_INT32, nullptr }, - note_t{ "lasti", ROCPROFSYS_INT32, nullptr }, - note_t{ "argcount", ROCPROFSYS_INT32, nullptr }, - note_t{ "nlocals", ROCPROFSYS_INT32, nullptr }, - note_t{ "stacksize", ROCPROFSYS_INT32, nullptr } }; + note_t{ "line", ROCPROFSYS_INT32, nullptr }, + note_t{ "lasti", ROCPROFSYS_INT32, nullptr }, + note_t{ "argcount", ROCPROFSYS_INT32, nullptr }, + note_t{ "nlocals", ROCPROFSYS_INT32, nullptr }, + note_t{ "stacksize", ROCPROFSYS_INT32, nullptr } }; }; // inline config& @@ -306,7 +304,7 @@ profiler_function(py::object pframe, const char* swhat, py::object arg) if(_disable) return; _disable = true; - tim::scope::destructor _dtor{ []() { _disable= false; } }; + tim::scope::destructor _dtor{ []() { _disable = false; } }; (void) _dtor; if(pframe.is_none() || pframe.ptr() == nullptr) return;