diff --git a/.clang-format b/.clang-format index c9a7cd9a..0b206204 100644 --- a/.clang-format +++ b/.clang-format @@ -4,7 +4,7 @@ AccessModifierOffset: -4 AlignAfterOpenBracket: BlockIndent AlignArrayOfStructures: None AlignConsecutiveAssignments: - Enabled: false + Enabled: true AcrossEmptyLines: false AcrossComments: false AlignCompound: false diff --git a/examples/apps/c-example.c b/examples/apps/c-example.c index 3c84e9a8..955ee756 100644 --- a/examples/apps/c-example.c +++ b/examples/apps/c-example.c @@ -82,7 +82,7 @@ int main(int argc, char* argv[]) // Mark a code region. Opens region "annotation=init" in Caliper. CALI_MARK_BEGIN("init"); int count = 4; - double t = 0; + double t = 0; CALI_MARK_END("init"); // Mark a loop. Opens region "loop=mainloop" in Caliper. diff --git a/examples/apps/cali-functional.cpp b/examples/apps/cali-functional.cpp index 595b02b5..fd802c94 100644 --- a/examples/apps/cali-functional.cpp +++ b/examples/apps/cali-functional.cpp @@ -46,7 +46,7 @@ auto minimally_wrapped_free = cali::wrap_function("free", free); int main(int argc, char* argv[]) { - int seven = sum(3, 4); + int seven = sum(3, 4); int* int_pointer = (int*) wrapped_malloc(sizeof(int) * 100); minimally_wrapped_free(int_pointer); } diff --git a/examples/apps/cali-memtracking-macros.cpp b/examples/apps/cali-memtracking-macros.cpp index 2e72a9dd..3980bc8e 100644 --- a/examples/apps/cali-memtracking-macros.cpp +++ b/examples/apps/cali-memtracking-macros.cpp @@ -24,9 +24,9 @@ void do_work(size_t M, size_t W, size_t N) double* matC = (double*) malloc(sizeof(double) * M * N); size_t num_dimensions = 2; - size_t A_dims[] = { M, W }; - size_t B_dims[] = { W, N }; - size_t C_dims[] = { M, N }; + size_t A_dims[] = { M, W }; + size_t B_dims[] = { W, N }; + size_t C_dims[] = { M, N }; CALI_DATATRACKER_TRACK_DIMENSIONAL(matA, sizeof(double), A_dims, num_dimensions); CALI_DATATRACKER_TRACK_DIMENSIONAL(matB, sizeof(double), B_dims, num_dimensions); @@ -99,9 +99,9 @@ int main(int argc, const char* argv[]) return -1; } - size_t m_size = std::stoul(args.get("m_size", "512")); - size_t w_size = std::stoul(args.get("w_size", "512")); - size_t n_size = std::stoul(args.get("n_size", "512")); + size_t m_size = std::stoul(args.get("m_size", "512")); + size_t w_size = std::stoul(args.get("w_size", "512")); + size_t n_size = std::stoul(args.get("n_size", "512")); size_t num_iterations = std::stoul(args.get("iterations", "4")); CALI_MARK_BEGIN("benchmark"); diff --git a/examples/apps/cali-memtracking.cpp b/examples/apps/cali-memtracking.cpp index 4d7e3146..f3a663c0 100644 --- a/examples/apps/cali-memtracking.cpp +++ b/examples/apps/cali-memtracking.cpp @@ -96,9 +96,9 @@ int main(int argc, const char* argv[]) return -1; } - size_t m_size = std::stoul(args.get("m_size", "512")); - size_t w_size = std::stoul(args.get("w_size", "512")); - size_t n_size = std::stoul(args.get("n_size", "512")); + size_t m_size = std::stoul(args.get("m_size", "512")); + size_t w_size = std::stoul(args.get("w_size", "512")); + size_t n_size = std::stoul(args.get("n_size", "512")); size_t num_iterations = std::stoul(args.get("iterations", "4")); cali::Annotation phase_annotation("phase", CALI_ATTR_SCOPE_PROCESS); diff --git a/examples/apps/cali-print-snapshot.c b/examples/apps/cali-print-snapshot.c index b8b0db96..76418867 100644 --- a/examples/apps/cali-print-snapshot.c +++ b/examples/apps/cali-print-snapshot.c @@ -39,7 +39,7 @@ int print_entry(void* user_arg, cali_id_t attr_id, cali_variant_t val) { char buf[20]; size_t len = cali_variant_get_size(val); - len = (len < 19 ? len : 19); + len = (len < 19 ? len : 19); strncpy(buf, (char*) cali_variant_get_data(&val), len); buf[len] = '\0'; @@ -112,8 +112,8 @@ void do_work(cali_id_t channel) int main() { const char* cfg[][2] = { { NULL, NULL } }; - cali_configset_t cfgset = cali_create_configset(cfg); - cali_id_t channel = cali_create_channel("print-snapshot", 0, cfgset); + cali_configset_t cfgset = cali_create_configset(cfg); + cali_id_t channel = cali_create_channel("print-snapshot", 0, cfgset); cali_delete_configset(cfgset); CALI_MARK_FUNCTION_BEGIN; diff --git a/include/caliper/Annotation.h b/include/caliper/Annotation.h index 6acde126..ed3a78f2 100644 --- a/include/caliper/Annotation.h +++ b/include/caliper/Annotation.h @@ -28,7 +28,7 @@ class Function Function(const char* name); - Function(const Function&) = delete; + Function(const Function&) = delete; Function& operator=(const Function&) = delete; ~Function(); @@ -42,7 +42,7 @@ class ScopeAnnotation explicit ScopeAnnotation(const char* name); - ScopeAnnotation(const ScopeAnnotation&) = delete; + ScopeAnnotation(const ScopeAnnotation&) = delete; ScopeAnnotation& operator=(const ScopeAnnotation&) = delete; ~ScopeAnnotation(); @@ -151,7 +151,7 @@ class Annotation Guard(Annotation& a); - Guard(const Guard&) = delete; + Guard(const Guard&) = delete; Guard& operator=(const Guard&) = delete; ~Guard(); diff --git a/include/caliper/Caliper.h b/include/caliper/Caliper.h index 071e1ee6..736eb795 100644 --- a/include/caliper/Caliper.h +++ b/include/caliper/Caliper.h @@ -49,10 +49,10 @@ class Channel constexpr Channel() : mP { nullptr } {} Channel(const Channel&) = default; - Channel(Channel&&) = default; + Channel(Channel&&) = default; Channel& operator=(const Channel&) = default; - Channel& operator=(Channel&&) = default; + Channel& operator=(Channel&&) = default; ~Channel(); @@ -305,9 +305,9 @@ class Caliper : public CaliperMetadataAccessInterface size_t elem_size, size_t ndim, const size_t dims[], - size_t n_extra = 0, + size_t n_extra = 0, const Attribute* extra_attrs = nullptr, - const Variant* extra_vals = nullptr + const Variant* extra_vals = nullptr ); /// \brief De-register a tracked memory region starting at \a ptr @@ -460,9 +460,9 @@ class Caliper : public CaliperMetadataAccessInterface size_t elem_size, size_t ndim, const size_t dims[], - size_t n = 0, + size_t n = 0, const Attribute* extra_attr = nullptr, - const Variant* extra_val = nullptr + const Variant* extra_val = nullptr ); void memory_region_end(Channel* chn, const void* ptr); @@ -585,8 +585,8 @@ class Caliper : public CaliperMetadataAccessInterface Attribute create_attribute( const std::string& name, cali_attr_type type, - int prop = CALI_ATTR_DEFAULT, - int meta = 0, + int prop = CALI_ATTR_DEFAULT, + int meta = 0, const Attribute* meta_attr = nullptr, const Variant* meta_data = nullptr ); diff --git a/include/caliper/SnapshotRecord.h b/include/caliper/SnapshotRecord.h index 92101e16..6ce7b979 100644 --- a/include/caliper/SnapshotRecord.h +++ b/include/caliper/SnapshotRecord.h @@ -29,7 +29,7 @@ class SnapshotView SnapshotView(const Entry& e) : m_data { &e }, m_len { 1 } {} - using iterator = Entry*; + using iterator = Entry*; using const_iterator = const Entry*; const_iterator begin() const { return m_data; } @@ -83,10 +83,10 @@ class SnapshotBuilder : m_data { data }, m_capacity { capacity }, m_len { 0 }, m_skipped { 0 } {} - SnapshotBuilder(SnapshotBuilder&&) = default; + SnapshotBuilder(SnapshotBuilder&&) = default; SnapshotBuilder(const SnapshotBuilder&) = delete; - SnapshotBuilder& operator=(SnapshotBuilder&&) = default; + SnapshotBuilder& operator=(SnapshotBuilder&&) = default; SnapshotBuilder& operator=(const SnapshotBuilder&) = delete; size_t capacity() const { return m_capacity; } @@ -129,7 +129,7 @@ class FixedSizeSnapshotRecord FixedSizeSnapshotRecord() : m_builder { N, m_data } {} - FixedSizeSnapshotRecord(const FixedSizeSnapshotRecord&) = delete; + FixedSizeSnapshotRecord(const FixedSizeSnapshotRecord&) = delete; FixedSizeSnapshotRecord operator=(const FixedSizeSnapshotRecord&) = delete; SnapshotBuilder& builder() { return m_builder; } diff --git a/include/caliper/cali_definitions.h b/include/caliper/cali_definitions.h index 538f8671..1bf968ba 100644 --- a/include/caliper/cali_definitions.h +++ b/include/caliper/cali_definitions.h @@ -17,8 +17,8 @@ extern "C" typedef enum { CALI_SCOPE_PROCESS = 1, - CALI_SCOPE_THREAD = 2, - CALI_SCOPE_TASK = 4, + CALI_SCOPE_THREAD = 2, + CALI_SCOPE_TASK = 4, CALI_SCOPE_CHANNEL = 8 } cali_context_scope_t; diff --git a/include/caliper/common/CaliperMetadataAccessInterface.h b/include/caliper/common/CaliperMetadataAccessInterface.h index a933118c..b89f5566 100644 --- a/include/caliper/common/CaliperMetadataAccessInterface.h +++ b/include/caliper/common/CaliperMetadataAccessInterface.h @@ -27,7 +27,7 @@ class CaliperMetadataAccessInterface virtual Node* node(cali_id_t) const = 0; - virtual Attribute get_attribute(cali_id_t id) const = 0; + virtual Attribute get_attribute(cali_id_t id) const = 0; virtual Attribute get_attribute(const std::string& str) const = 0; /// \brief Return all attributes @@ -44,8 +44,8 @@ class CaliperMetadataAccessInterface virtual Attribute create_attribute( const std::string& name, cali_attr_type type, - int prop = CALI_ATTR_DEFAULT, - int meta = 0, + int prop = CALI_ATTR_DEFAULT, + int meta = 0, const Attribute* meta_attr = nullptr, const Variant* meta_data = nullptr ) = 0; diff --git a/include/caliper/common/Entry.h b/include/caliper/common/Entry.h index bc2aad95..25511d85 100644 --- a/include/caliper/common/Entry.h +++ b/include/caliper/common/Entry.h @@ -89,7 +89,7 @@ class Entry inline bool operator==(const Entry& lhs, const Entry& rhs) { bool node_eq = lhs.m_node == rhs.m_node || (lhs.m_node && rhs.m_node && lhs.m_node->id() == rhs.m_node->id()); - bool is_imm = lhs.is_immediate(); + bool is_imm = lhs.is_immediate(); return node_eq && (!is_imm || (is_imm && lhs.m_value == rhs.m_value)); } diff --git a/include/caliper/common/cali_types.h b/include/caliper/common/cali_types.h index 2ec87175..d79d4dc5 100644 --- a/include/caliper/common/cali_types.h +++ b/include/caliper/common/cali_types.h @@ -26,16 +26,16 @@ typedef uint64_t cali_id_t; * \brief Data type of an attribute. */ typedef enum { - CALI_TYPE_INV = 0, /**< Invalid type */ - CALI_TYPE_USR = 1, /**< User-defined type (pointer to binary data) */ - CALI_TYPE_INT = 2, /**< 64-bit signed integer */ - CALI_TYPE_UINT = 3, /**< 64-bit unsigned integer */ + CALI_TYPE_INV = 0, /**< Invalid type */ + CALI_TYPE_USR = 1, /**< User-defined type (pointer to binary data) */ + CALI_TYPE_INT = 2, /**< 64-bit signed integer */ + CALI_TYPE_UINT = 3, /**< 64-bit unsigned integer */ CALI_TYPE_STRING = 4, /**< String (\a char*) */ - CALI_TYPE_ADDR = 5, /**< 64-bit address */ + CALI_TYPE_ADDR = 5, /**< 64-bit address */ CALI_TYPE_DOUBLE = 6, /**< Double-precision floating point type */ - CALI_TYPE_BOOL = 7, /**< C or C++ boolean */ - CALI_TYPE_TYPE = 8, /**< Instance of cali_attr_type */ - CALI_TYPE_PTR = 9 /**< Raw pointer. Internal use only. */ + CALI_TYPE_BOOL = 7, /**< C or C++ boolean */ + CALI_TYPE_TYPE = 8, /**< Instance of cali_attr_type */ + CALI_TYPE_PTR = 9 /**< Raw pointer. Internal use only. */ } cali_attr_type; #define CALI_MAXTYPE CALI_TYPE_PTR diff --git a/include/caliper/common/cali_variant.h b/include/caliper/common/cali_variant.h index 6f6f055d..462d3038 100644 --- a/include/caliper/common/cali_variant.h +++ b/include/caliper/common/cali_variant.h @@ -50,7 +50,7 @@ inline cali_variant_t cali_make_empty_variant() { cali_variant_t v; v.type_and_size = 0; - v.value.v_uint = 0; + v.value.v_uint = 0; return v; } @@ -81,8 +81,8 @@ inline cali_variant_t cali_make_variant_from_bool(bool value) { cali_variant_t v; v.type_and_size = CALI_TYPE_BOOL; - v.value.v_uint = 0; - v.value.v_bool = value; + v.value.v_uint = 0; + v.value.v_bool = value; return v; } @@ -90,7 +90,7 @@ inline cali_variant_t cali_make_variant_from_int(int value) { cali_variant_t v; v.type_and_size = CALI_TYPE_INT; - v.value.v_int = value; + v.value.v_int = value; return v; } @@ -98,7 +98,7 @@ inline cali_variant_t cali_make_variant_from_int64(int64_t value) { cali_variant_t v; v.type_and_size = CALI_TYPE_INT; - v.value.v_int = value; + v.value.v_int = value; return v; } @@ -106,14 +106,14 @@ inline cali_variant_t cali_make_variant_from_uint(uint64_t value) { cali_variant_t v; v.type_and_size = CALI_TYPE_UINT; - v.value.v_uint = value; + v.value.v_uint = value; return v; } inline cali_variant_t cali_make_variant_from_double(double value) { cali_variant_t v; - v.type_and_size = CALI_TYPE_DOUBLE; + v.type_and_size = CALI_TYPE_DOUBLE; v.value.v_double = value; return v; } @@ -133,7 +133,7 @@ inline cali_variant_t cali_make_variant_from_string(const char* value) cali_variant_t v; - v.type_and_size = (size << 32) | hash | (CALI_TYPE_STRING & CALI_VARIANT_TYPE_MASK); + v.type_and_size = (size << 32) | hash | (CALI_TYPE_STRING & CALI_VARIANT_TYPE_MASK); v.value.unmanaged_const_ptr = value; return v; @@ -143,15 +143,15 @@ inline cali_variant_t cali_make_variant_from_type(cali_attr_type value) { cali_variant_t v; v.type_and_size = CALI_TYPE_TYPE; - v.value.v_uint = 0; - v.value.v_type = value; + v.value.v_uint = 0; + v.value.v_type = value; return v; } inline cali_variant_t cali_make_variant_from_ptr(void* ptr) { cali_variant_t v; - v.type_and_size = CALI_TYPE_PTR; + v.type_and_size = CALI_TYPE_PTR; v.value.unmanaged_ptr = ptr; return v; } diff --git a/include/caliper/reader/CaliperMetadataDB.h b/include/caliper/reader/CaliperMetadataDB.h index 1d9b980f..fd7dde0c 100644 --- a/include/caliper/reader/CaliperMetadataDB.h +++ b/include/caliper/reader/CaliperMetadataDB.h @@ -88,7 +88,7 @@ class CaliperMetadataDB : public CaliperMetadataAccessInterface const std::string& name, cali_attr_type type, int prop, - int meta = 0, + int meta = 0, const Attribute* meta_attr = nullptr, const Variant* meta_data = nullptr ); diff --git a/src/caliper/AnnotationBinding.cpp b/src/caliper/AnnotationBinding.cpp index a8d2df2b..f8e707d3 100644 --- a/src/caliper/AnnotationBinding.cpp +++ b/src/caliper/AnnotationBinding.cpp @@ -130,7 +130,7 @@ void AnnotationBinding::end_cb(Caliper* c, Channel* chn, const Attribute& attr, void AnnotationBinding::base_pre_initialize(Caliper* c, Channel* chn) { - const char* tag = service_tag(); + const char* tag = service_tag(); std::string cfgname = std::string(tag) + "_binding"; m_config = chn->config().init(cfgname.c_str(), s_configdata); diff --git a/src/caliper/Blackboard.cpp b/src/caliper/Blackboard.cpp index 1f58595f..b3425e21 100644 --- a/src/caliper/Blackboard.cpp +++ b/src/caliper/Blackboard.cpp @@ -47,7 +47,7 @@ void Blackboard::add(cali_id_t key, const Entry& value, bool include_in_snapshot return; } - hashtable[I].key = key; + hashtable[I].key = key; hashtable[I].value = value; if (include_in_snapshots) { @@ -91,12 +91,12 @@ void Blackboard::del(cali_id_t key) size_t k = hashtable[j].key % Nmax; if ((j > I && (k <= I || k > j)) || (j < I && (k <= I && k > j))) { hashtable[I] = hashtable[j]; - I = j; + I = j; } } } - hashtable[I].key = CALI_INV_ID; + hashtable[I].key = CALI_INV_ID; hashtable[I].value = Entry(); --num_entries; @@ -115,7 +115,7 @@ Entry Blackboard::exchange(cali_id_t key, const Entry& value, bool include_in_sn Entry ret; if (hashtable[I].key == key) { - ret = hashtable[I].value; + ret = hashtable[I].value; hashtable[I].value = value; } else add(key, value, include_in_snapshots); diff --git a/src/caliper/Caliper.cpp b/src/caliper/Caliper.cpp index 08b34f00..2b99f192 100644 --- a/src/caliper/Caliper.cpp +++ b/src/caliper/Caliper.cpp @@ -589,7 +589,7 @@ struct BlackboardEntry { inline BlackboardEntry load_current_entry(const Attribute& attr, cali_id_t key, Blackboard& blackboard) { Entry merged_entry = blackboard.get(key); - Entry entry = merged_entry.get(attr); + Entry entry = merged_entry.get(attr); if (merged_entry.attribute() != attr.id()) { if (entry.empty()) { @@ -616,7 +616,7 @@ inline void handle_begin( if (prop & CALI_ATTR_ASVALUE) { blackboard.set(attr.id(), Entry(attr, value), !(prop & CALI_ATTR_HIDDEN)); } else { - cali_id_t key = get_blackboard_key_for_reference_entry(prop); + cali_id_t key = get_blackboard_key_for_reference_entry(prop); Entry entry = Entry(tree.get_child(attr, value, blackboard.get(key).node())); blackboard.set(key, entry, !(prop & CALI_ATTR_HIDDEN)); } @@ -658,7 +658,7 @@ inline void handle_set( if (prop & CALI_ATTR_ASVALUE) blackboard.set(attr.id(), Entry(attr, value), !(prop & CALI_ATTR_HIDDEN)); else { - cali_id_t key = get_blackboard_key_for_reference_entry(prop); + cali_id_t key = get_blackboard_key_for_reference_entry(prop); Node* node = blackboard.get(key).node(); blackboard.set(key, tree.replace_first_in_path(node, attr, value), !(prop & CALI_ATTR_HIDDEN)); } @@ -944,7 +944,7 @@ void Caliper::begin(const Attribute& attr, const Variant& data) if (sT->stack_error) return; - int prop = attr.properties(); + int prop = attr.properties(); int scope = prop & CALI_ATTR_SCOPE_MASK; bool run_events = !(prop & CALI_ATTR_SKIP_EVENTS); @@ -972,12 +972,12 @@ void Caliper::end(const Attribute& attr) if (sT->stack_error) return; - int prop = attr.properties(); + int prop = attr.properties(); int scope = prop & CALI_ATTR_SCOPE_MASK; bool run_events = !(prop & CALI_ATTR_SKIP_EVENTS); - cali_id_t key = get_blackboard_key(attr.id(), prop); + cali_id_t key = get_blackboard_key(attr.id(), prop); Blackboard* blackboard = nullptr; if (scope == CALI_ATTR_SCOPE_THREAD) @@ -1009,12 +1009,12 @@ void Caliper::end_with_value_check(const Attribute& attr, const Variant& data) if (sT->stack_error) return; - int prop = attr.properties(); + int prop = attr.properties(); int scope = prop & CALI_ATTR_SCOPE_MASK; bool run_events = !(prop & CALI_ATTR_SKIP_EVENTS); - cali_id_t key = get_blackboard_key(attr.id(), prop); + cali_id_t key = get_blackboard_key(attr.id(), prop); Blackboard* blackboard = nullptr; if (scope == CALI_ATTR_SCOPE_THREAD) @@ -1047,7 +1047,7 @@ void Caliper::set(const Attribute& attr, const Variant& data) if (sT->stack_error) return; - int prop = attr.properties(); + int prop = attr.properties(); int scope = prop & CALI_ATTR_SCOPE_MASK; bool run_events = !(prop & CALI_ATTR_SKIP_EVENTS); @@ -1067,7 +1067,7 @@ void Caliper::set(const Attribute& attr, const Variant& data) void Caliper::begin(Channel* channel, const Attribute& attr, const Variant& data) { - int prop = attr.properties(); + int prop = attr.properties(); bool run_events = !(prop & CALI_ATTR_SKIP_EVENTS); std::lock_guard<::siglock> g(sT->lock); @@ -1085,7 +1085,7 @@ void Caliper::begin(Channel* channel, const Attribute& attr, const Variant& data void Caliper::end(Channel* channel, const Attribute& attr) { - int prop = attr.properties(); + int prop = attr.properties(); bool run_events = !(prop & CALI_ATTR_SKIP_EVENTS); cali_id_t key = get_blackboard_key(attr.id(), prop); @@ -1108,7 +1108,7 @@ void Caliper::end(Channel* channel, const Attribute& attr) void Caliper::set(Channel* channel, const Attribute& attr, const Variant& data) { - int prop = attr.properties(); + int prop = attr.properties(); bool run_events = !(prop & CALI_ATTR_SKIP_EVENTS); std::lock_guard<::siglock> g(sT->lock); @@ -1124,7 +1124,7 @@ void Caliper::set(Channel* channel, const Attribute& attr, const Variant& data) Entry Caliper::get(const Attribute& attr) { - int prop = attr.properties(); + int prop = attr.properties(); int scope = prop & CALI_ATTR_SCOPE_MASK; Blackboard* blackboard = nullptr; @@ -1246,7 +1246,7 @@ Node* Caliper::node(cali_id_t id) const Variant Caliper::exchange(const Attribute& attr, const Variant& data) { - int prop = attr.properties(); + int prop = attr.properties(); int scope = prop & CALI_ATTR_SCOPE_MASK; Blackboard* blackboard = nullptr; diff --git a/src/caliper/CollectiveOutputChannel.cpp b/src/caliper/CollectiveOutputChannel.cpp index 11515510..fc3eb298 100644 --- a/src/caliper/CollectiveOutputChannel.cpp +++ b/src/caliper/CollectiveOutputChannel.cpp @@ -32,7 +32,7 @@ std::string remove_from_stringlist(const std::string& in, const std::string& ele // delete all occurences of element in the vector for (auto pos = std::find(vec.begin(), vec.end(), element); pos != vec.end(); - pos = std::find(vec.begin(), vec.end(), element)) + pos = std::find(vec.begin(), vec.end(), element)) vec.erase(pos); std::string ret; @@ -115,7 +115,7 @@ class MpiReportWrapper : public CollectiveOutputChannel OutputStream stream; auto cfg = m_channel->copy_config(); - auto it = cfg.find("CALI_MPIREPORT_FILENAME"); + auto it = cfg.find("CALI_MPIREPORT_FILENAME"); if (it == cfg.end()) { stream.set_stream(OutputStream::StdOut); } else { @@ -178,8 +178,8 @@ std::shared_ptr CollectiveOutputChannel::from(const std config_map_t cfg(from->copy_config()); - cfg["CALI_SERVICES_ENABLE"] = ::remove_from_stringlist(cfg["CALI_SERVICES_ENABLE"], "mpireport"); - cfg["CALI_CHANNEL_CONFIG_CHECK"] = "false"; + cfg["CALI_SERVICES_ENABLE"] = ::remove_from_stringlist(cfg["CALI_SERVICES_ENABLE"], "mpireport"); + cfg["CALI_CHANNEL_CONFIG_CHECK"] = "false"; cfg["CALI_CHANNEL_FLUSH_AT_EXIT"] = "false"; std::string cross_query = cfg["CALI_MPIREPORT_CONFIG"]; diff --git a/src/caliper/ConfigManager.cpp b/src/caliper/ConfigManager.cpp index ea16bb95..2b7d0ae4 100644 --- a/src/caliper/ConfigManager.cpp +++ b/src/caliper/ConfigManager.cpp @@ -49,8 +49,8 @@ ChannelController* make_basic_channel_controller( if (opts.is_set("output")) { std::string output = opts.get("output").to_string(); - config()["CALI_RECORDER_FILENAME"] = output; - config()["CALI_REPORT_FILENAME"] = output; + config()["CALI_RECORDER_FILENAME"] = output; + config()["CALI_REPORT_FILENAME"] = output; config()["CALI_MPIREPORT_FILENAME"] = output; } @@ -223,7 +223,7 @@ std::pair find_key_in_json( StringConverter ret = it->second; for (auto path_it = path.begin() + 1; path_it != path.end(); ++path_it) { auto sub_dict = ret.rec_dict(); - it = sub_dict.find(*path_it); + it = sub_dict.find(*path_it); if (it == sub_dict.end()) return std::make_pair(false, StringConverter()); ret = it->second; @@ -237,7 +237,7 @@ unsigned add_metadata_entries(const std::string& key, const StringConverter& val unsigned num_entries = 0; bool is_dict = false; - auto dict = val.rec_dict(&is_dict); + auto dict = val.rec_dict(&is_dict); if (is_dict) { std::string prefix = key + "."; @@ -268,7 +268,7 @@ void read_metadata_from_json_file(const std::string& filename, const std::string return; } - bool ok = false; + bool ok = false; auto top = StringConverter(str).rec_dict(&ok); if (!ok) { @@ -285,7 +285,7 @@ void read_metadata_from_json_file(const std::string& filename, const std::string for (const std::string& key : keylist) { std::vector path = StringConverter(key).to_stringlist("."); - auto ret = find_key_in_json(path, top); + auto ret = find_key_in_json(path, top); if (ret.first) add_metadata_entries(key, ret.second, info); else @@ -353,7 +353,7 @@ class ConfigManager::OptionSpec void set_error(const std::string& msg) { - m_error = true; + m_error = true; m_error_msg = msg; } @@ -361,7 +361,7 @@ class ConfigManager::OptionSpec { for (const StringConverter& sc : list) { bool is_a_dict = false; - std::map dict = sc.rec_dict(&is_a_dict); + std::map dict = sc.rec_dict(&is_a_dict); // The deprecated syntax for a select spec is a list of // { "expr": "expression", "as": "alias", "unit": "unit" } @@ -370,7 +370,7 @@ class ConfigManager::OptionSpec // strings. Determine which we have and parse accordingly. if (is_a_dict) { std::string str = dict["expr"].to_string(); - auto it = dict.find("as"); + auto it = dict.find("as"); if (it != dict.end()) { str.append(" as \""); str.append(it->second.to_string()); @@ -501,10 +501,10 @@ class ConfigManager::OptionSpec OptionSpec() : m_error(false) {} OptionSpec(const OptionSpec&) = default; - OptionSpec(OptionSpec&&) = default; + OptionSpec(OptionSpec&&) = default; OptionSpec& operator=(const OptionSpec&) = default; - OptionSpec& operator=(OptionSpec&&) = default; + OptionSpec& operator=(OptionSpec&&) = default; ~OptionSpec() {} @@ -678,13 +678,13 @@ struct ConfigManager::Options::OptionsImpl { std::string build_query(const char* level, const std::map& in) const { - std::string q_let = ::find_or(in, "let"); - std::string q_select = ::find_or(in, "select"); - std::string q_groupby = ::find_or(in, "group by"); - std::string q_where = ::find_or(in, "where"); + std::string q_let = ::find_or(in, "let"); + std::string q_select = ::find_or(in, "select"); + std::string q_groupby = ::find_or(in, "group by"); + std::string q_where = ::find_or(in, "where"); std::string q_aggregate = ::find_or(in, "aggregate"); - std::string q_orderby = ::find_or(in, "order by"); - std::string q_format = ::find_or(in, "format"); + std::string q_orderby = ::find_or(in, "order by"); + std::string q_format = ::find_or(in, "format"); for (const std::string& opt : enabled_options) { auto s_it = spec.data.find(opt); @@ -855,7 +855,7 @@ std::string ConfigManager::Options::build_query(const char* level, const std::ma struct ConfigManager::ConfigManagerImpl { ChannelList m_channels; - bool m_error = false; + bool m_error = false; std::string m_error_msg = ""; std::map m_default_parameters_for_spec; @@ -881,13 +881,13 @@ struct ConfigManager::ConfigManagerImpl { void set_error(const std::string& msg) { - m_error = true; + m_error = true; m_error_msg = msg; } void set_error(const std::string& msg, std::istream& is) { - m_error = true; + m_error = true; m_error_msg = msg; size_t maxctx = 16; @@ -917,8 +917,8 @@ struct ConfigManager::ConfigManagerImpl { config_spec_t spec; bool ok = false; - spec.json = jsonspec; - spec.create = (create == nullptr) ? ::make_basic_channel_controller : create; + spec.json = jsonspec; + spec.create = (create == nullptr) ? ::make_basic_channel_controller : create; spec.check_args = check; auto dict = StringConverter(spec.json).rec_dict(&ok); @@ -1023,7 +1023,7 @@ struct ConfigManager::ConfigManagerImpl { set_error("Expected value after \"" + key + "=\"", is); } else if (c == '(') { val = util::read_nested_text(is, '(', ')'); - c = util::read_char(is); + c = util::read_char(is); if (c != ')') set_error("Missing ')' after \"" + key + "\"(", is); } else @@ -1095,7 +1095,7 @@ struct ConfigManager::ConfigManagerImpl { void parse_json_content(const std::string& json) { - bool ok = false; + bool ok = false; auto dict = StringConverter(json).rec_dict(&ok); if (ok) { diff --git a/src/caliper/MemoryPool.cpp b/src/caliper/MemoryPool.cpp index c8553f67..bd98fc42 100644 --- a/src/caliper/MemoryPool.cpp +++ b/src/caliper/MemoryPool.cpp @@ -65,10 +65,10 @@ struct MemoryPool::MemoryPoolImpl { return nullptr; } - unsigned char* ptr = m_chunks.back().ptr + m_chunks.back().wmark; - std::uintptr_t pn = reinterpret_cast(ptr); + unsigned char* ptr = m_chunks.back().ptr + m_chunks.back().wmark; + std::uintptr_t pn = reinterpret_cast(ptr); std::uintptr_t aligned = (pn + alignment - 1) & -alignment; - std::size_t n = bytes + (aligned - pn); + std::size_t n = bytes + (aligned - pn); m_chunks.back().wmark += n; m_total_used += n; @@ -87,13 +87,13 @@ struct MemoryPool::MemoryPoolImpl { m_total_used += other.m_total_used; other.m_total_reserved = 0; - other.m_total_used = 0; + other.m_total_used = 0; } std::ostream& print_statistics(std::ostream& os) const { unitfmt_result bytes_reserved = unitfmt(m_total_reserved, unitfmt_bytes); - unitfmt_result bytes_used = unitfmt(m_total_used, unitfmt_bytes); + unitfmt_result bytes_used = unitfmt(m_total_used, unitfmt_bytes); os << "Metadata memory pool: " << bytes_reserved.val << " " << bytes_reserved.symbol << " reserved, " << bytes_used.val << " " << bytes_used.symbol << " used"; @@ -107,7 +107,7 @@ struct MemoryPool::MemoryPoolImpl { m_total_used { 0 } { m_can_expand = m_config.get("can_expand").to_bool(); - size_t s = m_config.get("pool_size").to_uint(); + size_t s = m_config.get("pool_size").to_uint(); expand(s); } diff --git a/src/caliper/MetadataTree.cpp b/src/caliper/MetadataTree.cpp index 9f91acc8..988311a5 100644 --- a/src/caliper/MetadataTree.cpp +++ b/src/caliper/MetadataTree.cpp @@ -29,7 +29,7 @@ MetadataTree::GlobalData::GlobalData(MemoryPool& pool) node_blocks(0), g_mempool(pool) { - num_blocks = config.get("num_blocks").to_uint(); + num_blocks = config.get("num_blocks").to_uint(); nodes_per_block = std::min(config.get("nodes_per_block").to_uint(), 256); node_blocks = new NodeBlock[num_blocks]; @@ -145,12 +145,12 @@ Node* MetadataTree::create_path(const Attribute& attr, size_t n, const Variant* // Calculate and allocate required memory - const size_t align = 8; + const size_t align = 8; size_t data_size = 0; cali_attr_type type = attr.type(); bool copy = (type == CALI_TYPE_STRING || type == CALI_TYPE_USR); - char* ptr = nullptr; + char* ptr = nullptr; if (copy) { for (size_t i = 0; i < n; ++i) { @@ -208,7 +208,7 @@ Node* MetadataTree::create_child(const Attribute& attr, const Variant& value, No ptr = m_mempool.allocate(value.size() + 1 /* ensure 0-padding so we can safely hand out string ptrs */); size_t index = m_nodeblock->index++; - GlobalData* g = mG.load(); + GlobalData* g = mG.load(); Node* node = new (m_nodeblock->chunk + index) Node((m_nodeblock - g->node_blocks) * g->nodes_per_block + index, attr.id(), value.copy(ptr)); diff --git a/src/caliper/MetadataTree.h b/src/caliper/MetadataTree.h index 9a2fee56..5734f8ca 100644 --- a/src/caliper/MetadataTree.h +++ b/src/caliper/MetadataTree.h @@ -69,7 +69,7 @@ class MetadataTree ~MetadataTree(); - MetadataTree(const MetadataTree&) = delete; + MetadataTree(const MetadataTree&) = delete; MetadataTree& operator=(const MetadataTree&) = delete; static void release(); diff --git a/src/caliper/OutputCommMpi.cpp b/src/caliper/OutputCommMpi.cpp index c31c3432..094aec36 100644 --- a/src/caliper/OutputCommMpi.cpp +++ b/src/caliper/OutputCommMpi.cpp @@ -35,7 +35,7 @@ struct OutputCommMpi::OutputCommMpiImpl { OutputCommMpi::OutputCommMpi() { int initialized = 0; - int finalized = 0; + int finalized = 0; MPI_Initialized(&initialized); MPI_Finalized(&finalized); diff --git a/src/caliper/RegionFilter.cpp b/src/caliper/RegionFilter.cpp index d4b4728c..c4555bdf 100644 --- a/src/caliper/RegionFilter.cpp +++ b/src/caliper/RegionFilter.cpp @@ -48,7 +48,7 @@ class ArgumentListParser } while (!m_error && is.good() && c == ','); if (c != ')') { - m_error = true; + m_error = true; m_error_msg = "missing \')\'"; } @@ -76,7 +76,7 @@ std::pair, std::string> RegionFilter::pars if (!argparse.error()) { ret.match.insert(ret.match.end(), args.begin(), args.end()); } else { - error = true; + error = true; error_msg = std::string("in match(): ") + argparse.error_msg(); } } else if (word == "startswith") { @@ -85,7 +85,7 @@ std::pair, std::string> RegionFilter::pars if (!argparse.error()) { ret.startswith.insert(ret.startswith.end(), args.begin(), args.end()); } else { - error = true; + error = true; error_msg = std::string("in startswith(): ") + argparse.error_msg(); } } else if (word == "regex") { @@ -96,11 +96,11 @@ std::pair, std::string> RegionFilter::pars for (const auto& s : args) ret.regex.push_back(std::regex(s)); } catch (const std::regex_error& e) { - error = true; + error = true; error_msg = e.what(); } } else { - error = true; + error = true; error_msg = std::string("in regex(): ") + argparse.error_msg(); } } else if (!word.empty()) { diff --git a/src/caliper/api.cpp b/src/caliper/api.cpp index fb7c7734..1a1e95eb 100644 --- a/src/caliper/api.cpp +++ b/src/caliper/api.cpp @@ -9,23 +9,23 @@ #include "caliper/common/cali_types.h" -cali_id_t cali_class_aggregatable_attr_id = CALI_INV_ID; +cali_id_t cali_class_aggregatable_attr_id = CALI_INV_ID; cali_id_t cali_class_symboladdress_attr_id = CALI_INV_ID; cali_id_t cali_class_memoryaddress_attr_id = CALI_INV_ID; -cali_id_t cali_class_iteration_attr_id = CALI_INV_ID; -cali_id_t cali_subscription_event_attr_id = CALI_INV_ID; +cali_id_t cali_class_iteration_attr_id = CALI_INV_ID; +cali_id_t cali_subscription_event_attr_id = CALI_INV_ID; -cali_id_t cali_loop_attr_id = CALI_INV_ID; +cali_id_t cali_loop_attr_id = CALI_INV_ID; cali_id_t cali_region_attr_id = CALI_INV_ID; -cali_id_t cali_phase_attr_id = CALI_INV_ID; +cali_id_t cali_phase_attr_id = CALI_INV_ID; -cali_id_t cali_alloc_fn_attr_id = CALI_INV_ID; -cali_id_t cali_alloc_label_attr_id = CALI_INV_ID; -cali_id_t cali_alloc_uid_attr_id = CALI_INV_ID; -cali_id_t cali_alloc_addr_attr_id = CALI_INV_ID; -cali_id_t cali_alloc_elem_size_attr_id = CALI_INV_ID; -cali_id_t cali_alloc_num_elems_attr_id = CALI_INV_ID; -cali_id_t cali_alloc_total_size_attr_id = CALI_INV_ID; +cali_id_t cali_alloc_fn_attr_id = CALI_INV_ID; +cali_id_t cali_alloc_label_attr_id = CALI_INV_ID; +cali_id_t cali_alloc_uid_attr_id = CALI_INV_ID; +cali_id_t cali_alloc_addr_attr_id = CALI_INV_ID; +cali_id_t cali_alloc_elem_size_attr_id = CALI_INV_ID; +cali_id_t cali_alloc_num_elems_attr_id = CALI_INV_ID; +cali_id_t cali_alloc_total_size_attr_id = CALI_INV_ID; cali_id_t cali_alloc_same_size_count_attr_id = CALI_INV_ID; namespace cali @@ -43,27 +43,27 @@ Attribute comm_region_attr; void init_attribute_classes(Caliper* c) { - class_aggregatable_attr = c->create_attribute("class.aggregatable", CALI_TYPE_BOOL, CALI_ATTR_SKIP_EVENTS); + class_aggregatable_attr = c->create_attribute("class.aggregatable", CALI_TYPE_BOOL, CALI_ATTR_SKIP_EVENTS); class_symboladdress_attr = c->create_attribute("class.symboladdress", CALI_TYPE_BOOL, CALI_ATTR_SKIP_EVENTS); class_memoryaddress_attr = c->create_attribute("class.memoryaddress", CALI_TYPE_BOOL, CALI_ATTR_SKIP_EVENTS); - class_iteration_attr = c->create_attribute("class.iteration", CALI_TYPE_BOOL, CALI_ATTR_SKIP_EVENTS); - subscription_event_attr = c->create_attribute("subscription_event", CALI_TYPE_BOOL, CALI_ATTR_SKIP_EVENTS); + class_iteration_attr = c->create_attribute("class.iteration", CALI_TYPE_BOOL, CALI_ATTR_SKIP_EVENTS); + subscription_event_attr = c->create_attribute("subscription_event", CALI_TYPE_BOOL, CALI_ATTR_SKIP_EVENTS); - cali_class_aggregatable_attr_id = class_aggregatable_attr.id(); + cali_class_aggregatable_attr_id = class_aggregatable_attr.id(); cali_class_symboladdress_attr_id = class_symboladdress_attr.id(); cali_class_memoryaddress_attr_id = class_memoryaddress_attr.id(); - cali_class_iteration_attr_id = class_iteration_attr.id(); + cali_class_iteration_attr_id = class_iteration_attr.id(); } void init_api_attributes(Caliper* c) { - loop_attr = c->create_attribute("loop", CALI_TYPE_STRING, CALI_ATTR_NESTED); - region_attr = c->create_attribute("region", CALI_TYPE_STRING, CALI_ATTR_NESTED); - phase_attr = c->create_attribute("phase", CALI_TYPE_STRING, CALI_ATTR_NESTED | CALI_ATTR_LEVEL_4); + loop_attr = c->create_attribute("loop", CALI_TYPE_STRING, CALI_ATTR_NESTED); + region_attr = c->create_attribute("region", CALI_TYPE_STRING, CALI_ATTR_NESTED); + phase_attr = c->create_attribute("phase", CALI_TYPE_STRING, CALI_ATTR_NESTED | CALI_ATTR_LEVEL_4); comm_region_attr = c->create_attribute("comm.region", CALI_TYPE_STRING, CALI_ATTR_NESTED | CALI_ATTR_LEVEL_1); cali_region_attr_id = region_attr.id(); - cali_phase_attr_id = phase_attr.id(); - cali_loop_attr_id = loop_attr.id(); + cali_phase_attr_id = phase_attr.id(); + cali_loop_attr_id = loop_attr.id(); } } // namespace cali diff --git a/src/caliper/builtin_configmanager.cpp b/src/caliper/builtin_configmanager.cpp index 3f3ee225..a0f03e9e 100644 --- a/src/caliper/builtin_configmanager.cpp +++ b/src/caliper/builtin_configmanager.cpp @@ -23,7 +23,7 @@ namespace Channel make_flush_trigger_channel(Caliper* c) { - auto services = services::get_available_services(); + auto services = services::get_available_services(); bool have_mpiflush = std::find(services.begin(), services.end(), "mpiflush") != services.end(); std::map cfgmap = { { "CALI_CHANNEL_CONFIG_CHECK", "false" } }; diff --git a/src/caliper/cali.cpp b/src/caliper/cali.cpp index c0a7e18c..428be449 100644 --- a/src/caliper/cali.cpp +++ b/src/caliper/cali.cpp @@ -340,7 +340,7 @@ cali_variant_t cali_get(cali_id_t attr_id) cali_variant_t cali_channel_get(cali_id_t chn_id, cali_id_t attr_id) { - Caliper c = Caliper::sigsafe_instance(); + Caliper c = Caliper::sigsafe_instance(); Channel channel = c.get_channel(chn_id); if (!c || !channel) diff --git a/src/caliper/config_sanity_check.cpp b/src/caliper/config_sanity_check.cpp index c1b09d61..19674dc9 100644 --- a/src/caliper/config_sanity_check.cpp +++ b/src/caliper/config_sanity_check.cpp @@ -16,9 +16,9 @@ namespace const char* trigger_grp[] = { "alloc", "cuptitrace", "event", "libpfm", "loop_monitor", "region_monitor", "sampler", nullptr }; -const char* buffer_grp[] = { "aggregate", "trace", "cuptitrace", nullptr }; +const char* buffer_grp[] = { "aggregate", "trace", "cuptitrace", nullptr }; const char* process_grp[] = { "aggregate", "trace", "textlog", nullptr }; -const char* online_grp[] = { "textlog", nullptr }; +const char* online_grp[] = { "textlog", nullptr }; const char* offline_grp[] = { "recorder", "report", "sos", "mpireport", nullptr }; struct service_group_t { @@ -32,10 +32,10 @@ struct service_group_t { enum ServiceGroupID { SnapshotTrigger = 0, - SnapshotBuffer = 1, + SnapshotBuffer = 1, SnapshotProcess = 2, - OnlineOutput = 3, - OfflineOutput = 4 + OnlineOutput = 3, + OfflineOutput = 4 }; std::string format_group(const char* const* group, const char* sep, const char* last_sep) diff --git a/src/caliper/controllers/CudaActivityProfileController.cpp b/src/caliper/controllers/CudaActivityProfileController.cpp index 527d5a3b..de7bc8fd 100644 --- a/src/caliper/controllers/CudaActivityProfileController.cpp +++ b/src/caliper/controllers/CudaActivityProfileController.cpp @@ -59,27 +59,27 @@ class CudaActivityProfileController : public cali::ChannelController if (use_mpi) { config()["CALI_SERVICES_ENABLE"].append(",mpi,mpireport"); - config()["CALI_AGGREGATE_KEY"] = "*,mpi.rank"; - config()["CALI_MPIREPORT_FILENAME"] = output; + config()["CALI_AGGREGATE_KEY"] = "*,mpi.rank"; + config()["CALI_MPIREPORT_FILENAME"] = output; config()["CALI_MPIREPORT_WRITE_ON_FINALIZE"] = "false"; - config()["CALI_MPIREPORT_CONFIG"] = opts.build_query( + config()["CALI_MPIREPORT_CONFIG"] = opts.build_query( "local", { { "select", - "*,scale(cupti.activity.duration,1e-9) as \"time (gpu)\" unit sec" - " ,scale(sum#cupti.host.duration,1e-9) as \"time\" unit sec" }, - { "group by", "path,cupti.kernel.name,cupti.activity.kind,mpi.rank" }, - { "format", format } } + "*,scale(cupti.activity.duration,1e-9) as \"time (gpu)\" unit sec" + " ,scale(sum#cupti.host.duration,1e-9) as \"time\" unit sec" }, + { "group by", "path,cupti.kernel.name,cupti.activity.kind,mpi.rank" }, + { "format", format } } ); } else { config()["CALI_SERVICES_ENABLE"].append(",report"); config()["CALI_REPORT_FILENAME"] = output; - config()["CALI_REPORT_CONFIG"] = opts.build_query( + config()["CALI_REPORT_CONFIG"] = opts.build_query( "local", { { "select", - "*,scale(cupti.activity.duration,1e-9) as \"time (gpu)\" unit sec" - " ,scale(sum#cupti.host.duration,1e-9) as \"time\" unit sec" }, - { "group by", "path,cupti.kernel.name,cupti.activity.kind" }, - { "format", format } } + "*,scale(cupti.activity.duration,1e-9) as \"time (gpu)\" unit sec" + " ,scale(sum#cupti.host.duration,1e-9) as \"time\" unit sec" }, + { "group by", "path,cupti.kernel.name,cupti.activity.kind" }, + { "format", format } } ); } @@ -92,7 +92,7 @@ std::string check_args(const cali::ConfigManager::Options& opts) { // Check if output.format is valid - std::string format = opts.get("output.format", "cali").to_string(); + std::string format = opts.get("output.format", "cali").to_string(); std::set allowed_formats = { "cali", "json", "json-split", "hatchet" }; if (allowed_formats.find(format) == allowed_formats.end()) diff --git a/src/caliper/controllers/CudaActivityReportController.cpp b/src/caliper/controllers/CudaActivityReportController.cpp index 0927bccf..abf6102f 100644 --- a/src/caliper/controllers/CudaActivityReportController.cpp +++ b/src/caliper/controllers/CudaActivityReportController.cpp @@ -54,15 +54,15 @@ class CudaActivityReportController : public cali::ChannelController if (opts.is_enabled("show_kernels")) { groupby += ",cupti.kernel.name"; serial_select = std::string("cupti.kernel.name as Kernel,") + serial_select; - cross_select = std::string("cupti.kernel.name as Kernel,") + cross_select; + cross_select = std::string("cupti.kernel.name as Kernel,") + cross_select; } std::string format = util::build_tree_format_spec(config(), opts); if (use_mpi) { config()["CALI_SERVICES_ENABLE"].append(",mpi,mpireport"); - config()["CALI_MPIREPORT_FILENAME"] = opts.get("output", "stderr").to_string(); - config()["CALI_MPIREPORT_APPEND"] = opts.get("output.append").to_string(); + config()["CALI_MPIREPORT_FILENAME"] = opts.get("output", "stderr").to_string(); + config()["CALI_MPIREPORT_APPEND"] = opts.get("output.append").to_string(); config()["CALI_MPIREPORT_WRITE_ON_FINALIZE"] = "false"; config()["CALI_MPIREPORT_LOCAL_CONFIG"] = opts.build_query("local", { { "select", local_select }, { "group by", groupby } }); @@ -73,8 +73,8 @@ class CudaActivityReportController : public cali::ChannelController } else { config()["CALI_SERVICES_ENABLE"].append(",report"); config()["CALI_REPORT_FILENAME"] = opts.get("output", "stderr").to_string(); - config()["CALI_REPORT_APPEND"] = opts.get("output.append").to_string(); - config()["CALI_REPORT_CONFIG"] = opts.build_query( + config()["CALI_REPORT_APPEND"] = opts.get("output.append").to_string(); + config()["CALI_REPORT_CONFIG"] = opts.build_query( "local", { { "select", serial_select }, { "group by", groupby }, { "format", format } } ); diff --git a/src/caliper/controllers/HatchetRegionProfileController.cpp b/src/caliper/controllers/HatchetRegionProfileController.cpp index 7042b325..97491e29 100644 --- a/src/caliper/controllers/HatchetRegionProfileController.cpp +++ b/src/caliper/controllers/HatchetRegionProfileController.cpp @@ -59,25 +59,25 @@ class HatchetRegionProfileController : public cali::ChannelController if (use_mpi) { config()["CALI_SERVICES_ENABLE"].append(",mpi,mpireport"); - config()["CALI_AGGREGATE_KEY"] = "*,mpi.rank"; - config()["CALI_MPIREPORT_FILENAME"] = output; + config()["CALI_AGGREGATE_KEY"] = "*,mpi.rank"; + config()["CALI_MPIREPORT_FILENAME"] = output; config()["CALI_MPIREPORT_WRITE_ON_FINALIZE"] = "false"; - config()["CALI_MPIREPORT_CONFIG"] = opts.build_query( + config()["CALI_MPIREPORT_CONFIG"] = opts.build_query( "local", { { "let", "sum#time.duration=scale(sum#time.duration.ns,1e-9)" }, - { "select", "*,sum(sum#time.duration) as time unit sec" }, - { "group by", "path,mpi.rank" }, - { "format", format } } + { "select", "*,sum(sum#time.duration) as time unit sec" }, + { "group by", "path,mpi.rank" }, + { "format", format } } ); } else { config()["CALI_SERVICES_ENABLE"].append(",report"); config()["CALI_REPORT_FILENAME"] = output; - config()["CALI_REPORT_CONFIG"] = opts.build_query( + config()["CALI_REPORT_CONFIG"] = opts.build_query( "local", { { "let", "sum#time.duration=scale(sum#time.duration.ns,1e-9)" }, - { "select", "*,sum(sum#time.duration) as time unit sec" }, - { "group by", "path" }, - { "format", format } } + { "select", "*,sum(sum#time.duration) as time unit sec" }, + { "group by", "path" }, + { "format", format } } ); } @@ -90,7 +90,7 @@ std::string check_args(const cali::ConfigManager::Options& opts) { // Check if output.format is valid - std::string format = opts.get("output.format", "json-split").to_string(); + std::string format = opts.get("output.format", "json-split").to_string(); std::set allowed_formats = { "cali", "json", "json-split", "hatchet" }; if (allowed_formats.find(format) == allowed_formats.end()) diff --git a/src/caliper/controllers/HatchetSampleProfileController.cpp b/src/caliper/controllers/HatchetSampleProfileController.cpp index f08bc34a..cab79976 100644 --- a/src/caliper/controllers/HatchetSampleProfileController.cpp +++ b/src/caliper/controllers/HatchetSampleProfileController.cpp @@ -37,7 +37,7 @@ class HatchetSampleProfileController : public cali::ChannelController config()["CALI_SAMPLER_FREQUENCY"] = freqstr; std::string select = "path,count()"; - double freq = std::stod(freqstr); + double freq = std::stod(freqstr); if (freq > 0) { select.append(",scale_count("); @@ -76,9 +76,9 @@ class HatchetSampleProfileController : public cali::ChannelController if (use_mpi) { config()["CALI_SERVICES_ENABLE"].append(",mpi,mpireport"); - config()["CALI_MPIREPORT_FILENAME"] = output; + config()["CALI_MPIREPORT_FILENAME"] = output; config()["CALI_MPIREPORT_WRITE_ON_FINALIZE"] = "false"; - config()["CALI_MPIREPORT_CONFIG"] = opts.build_query( + config()["CALI_MPIREPORT_CONFIG"] = opts.build_query( "local", { { "select", select }, { "group by", "path,mpi.rank" }, { "format", format } } ); @@ -110,7 +110,7 @@ std::string check_args(const cali::ConfigManager::Options& opts) // Check if output.format is valid // - std::string format = opts.get("output.format", "json-split").to_string(); + std::string format = opts.get("output.format", "json-split").to_string(); std::set allowed_formats = { "cali", "json", "json-split" }; if (allowed_formats.find(format) == allowed_formats.end()) diff --git a/src/caliper/controllers/LoopReportController.cpp b/src/caliper/controllers/LoopReportController.cpp index 25426c46..fc0dcee3 100644 --- a/src/caliper/controllers/LoopReportController.cpp +++ b/src/caliper/controllers/LoopReportController.cpp @@ -178,8 +178,8 @@ class LoopReportController : public cali::internal::CustomOutputController void process_timeseries(Caliper& c, CaliperMetadataDB& db, OutputStream& stream, const LoopInfo& info, Comm comm) { int iterations = comm.bcast_int(info.iterations); - int rec_count = comm.bcast_int(info.count); - std::string name = comm.bcast_str(info.name); + int rec_count = comm.bcast_int(info.count); + std::string name = comm.bcast_str(info.name); if (iterations > 0) { int nblocks = 20; @@ -192,7 +192,7 @@ class LoopReportController : public cali::internal::CustomOutputController int blocksize = rec_count > nblocks ? iterations / nblocks : 1; Aggregator local_agg = timeseries_local_aggregation(c, db, name, std::max(blocksize, 1)); - QuerySpec spec = timeseries_spec(); + QuerySpec spec = timeseries_spec(); Aggregator cross_agg(spec); local_agg.flush(db, cross_agg); @@ -225,7 +225,7 @@ class LoopReportController : public cali::internal::CustomOutputController Caliper c; CaliperMetadataDB db; - Aggregator summary_local_agg = summary_local_aggregation(c, db); + Aggregator summary_local_agg = summary_local_aggregation(c, db); QuerySpec summary_query_spec = summary_query(); Aggregator summary_cross_agg(summary_query_spec); diff --git a/src/caliper/controllers/OpenMPReportController.cpp b/src/caliper/controllers/OpenMPReportController.cpp index e23633c3..bd64ebe4 100644 --- a/src/caliper/controllers/OpenMPReportController.cpp +++ b/src/caliper/controllers/OpenMPReportController.cpp @@ -78,7 +78,7 @@ class OpenMPReportController : public cali::ChannelController if (use_mpi) { config()["CALI_SERVICES_ENABLE"].append(",mpi,mpireport"); - config()["CALI_MPIREPORT_FILENAME"] = opts.get("output", "stderr").to_string(); + config()["CALI_MPIREPORT_FILENAME"] = opts.get("output", "stderr").to_string(); config()["CALI_MPIREPORT_WRITE_ON_FINALIZE"] = "false"; config()["CALI_MPIREPORT_LOCAL_CONFIG"] = opts.build_query("local", { { "let", let }, { "select", local_select }, { "group by", groupby } }); @@ -89,7 +89,7 @@ class OpenMPReportController : public cali::ChannelController } else { config()["CALI_SERVICES_ENABLE"].append(",report"); config()["CALI_REPORT_FILENAME"] = opts.get("output", "stderr").to_string(); - config()["CALI_REPORT_CONFIG"] = opts.build_query( + config()["CALI_REPORT_CONFIG"] = opts.build_query( "local", { { "let", let }, { "select", serial_select }, { "group by", groupby }, { "format", format } } ); diff --git a/src/caliper/controllers/ROCmActivityProfileController.cpp b/src/caliper/controllers/ROCmActivityProfileController.cpp index fb371365..c0d9e127 100644 --- a/src/caliper/controllers/ROCmActivityProfileController.cpp +++ b/src/caliper/controllers/ROCmActivityProfileController.cpp @@ -59,27 +59,27 @@ class RocmActivityProfileController : public cali::ChannelController if (use_mpi) { config()["CALI_SERVICES_ENABLE"].append(",mpi,mpireport"); - config()["CALI_AGGREGATE_KEY"] = "*,mpi.rank"; - config()["CALI_MPIREPORT_FILENAME"] = output; + config()["CALI_AGGREGATE_KEY"] = "*,mpi.rank"; + config()["CALI_MPIREPORT_FILENAME"] = output; config()["CALI_MPIREPORT_WRITE_ON_FINALIZE"] = "false"; - config()["CALI_MPIREPORT_CONFIG"] = opts.build_query( + config()["CALI_MPIREPORT_CONFIG"] = opts.build_query( "local", { { "select", - "*,scale(sum#rocm.activity.duration,1e-9) as \"time (gpu)\" unit sec" - " ,scale(sum#time.duration.ns,1e-9) as \"time\" unit sec" }, - { "group by", "path,rocm.kernel.name,rocm.activity.kind,mpi.rank" }, - { "format", format } } + "*,scale(sum#rocm.activity.duration,1e-9) as \"time (gpu)\" unit sec" + " ,scale(sum#time.duration.ns,1e-9) as \"time\" unit sec" }, + { "group by", "path,rocm.kernel.name,rocm.activity.kind,mpi.rank" }, + { "format", format } } ); } else { config()["CALI_SERVICES_ENABLE"].append(",report"); config()["CALI_REPORT_FILENAME"] = output; - config()["CALI_REPORT_CONFIG"] = opts.build_query( + config()["CALI_REPORT_CONFIG"] = opts.build_query( "local", { { "select", - "*,scale(sum#rocm.activity.duration,1e-9) as \"time (gpu)\" unit sec" - " ,scale(sum#time.duration.ns,1e-9) as \"time\" unit sec" }, - { "group by", "path,rocm.kernel.name,rocm.activity.kind" }, - { "format", format } } + "*,scale(sum#rocm.activity.duration,1e-9) as \"time (gpu)\" unit sec" + " ,scale(sum#time.duration.ns,1e-9) as \"time\" unit sec" }, + { "group by", "path,rocm.kernel.name,rocm.activity.kind" }, + { "format", format } } ); } @@ -92,7 +92,7 @@ std::string check_args(const cali::ConfigManager::Options& opts) { // Check if output.format is valid - std::string format = opts.get("output.format", "cali").to_string(); + std::string format = opts.get("output.format", "cali").to_string(); std::set allowed_formats = { "cali", "json", "json-split", "hatchet" }; if (allowed_formats.find(format) == allowed_formats.end()) diff --git a/src/caliper/controllers/ROCmActivityReportController.cpp b/src/caliper/controllers/ROCmActivityReportController.cpp index e76317a4..eed301ad 100644 --- a/src/caliper/controllers/ROCmActivityReportController.cpp +++ b/src/caliper/controllers/ROCmActivityReportController.cpp @@ -54,15 +54,15 @@ class RocmActivityReportController : public cali::ChannelController if (opts.is_enabled("show_kernels")) { groupby += ",rocm.kernel.name"; serial_select = std::string("rocm.kernel.name as Kernel,") + serial_select; - cross_select = std::string("rocm.kernel.name as Kernel,") + cross_select; + cross_select = std::string("rocm.kernel.name as Kernel,") + cross_select; } std::string format = util::build_tree_format_spec(config(), opts); if (use_mpi) { config()["CALI_SERVICES_ENABLE"].append(",mpi,mpireport"); - config()["CALI_MPIREPORT_FILENAME"] = opts.get("output", "stderr").to_string(); - config()["CALI_MPIREPORT_APPEND"] = opts.get("output.append").to_string(); + config()["CALI_MPIREPORT_FILENAME"] = opts.get("output", "stderr").to_string(); + config()["CALI_MPIREPORT_APPEND"] = opts.get("output.append").to_string(); config()["CALI_MPIREPORT_WRITE_ON_FINALIZE"] = "false"; config()["CALI_MPIREPORT_LOCAL_CONFIG"] = opts.build_query("local", { { "select", local_select }, { "group by", groupby } }); @@ -73,8 +73,8 @@ class RocmActivityReportController : public cali::ChannelController } else { config()["CALI_SERVICES_ENABLE"].append(",report"); config()["CALI_REPORT_FILENAME"] = opts.get("output", "stderr").to_string(); - config()["CALI_REPORT_APPEND"] = opts.get("output.append").to_string(); - config()["CALI_REPORT_CONFIG"] = opts.build_query( + config()["CALI_REPORT_APPEND"] = opts.get("output.append").to_string(); + config()["CALI_REPORT_CONFIG"] = opts.build_query( "local", { { "select", serial_select }, { "group by", groupby }, { "format", format } } ); diff --git a/src/caliper/controllers/RuntimeReportController.cpp b/src/caliper/controllers/RuntimeReportController.cpp index afff83cc..d647a2b9 100644 --- a/src/caliper/controllers/RuntimeReportController.cpp +++ b/src/caliper/controllers/RuntimeReportController.cpp @@ -60,8 +60,8 @@ class RuntimeReportController : public cali::ChannelController if (use_mpi) { config()["CALI_SERVICES_ENABLE"].append(",mpi,mpireport"); - config()["CALI_MPIREPORT_FILENAME"] = opts.get("output", "stderr").to_string(); - config()["CALI_MPIREPORT_APPEND"] = opts.get("output.append").to_string(); + config()["CALI_MPIREPORT_FILENAME"] = opts.get("output", "stderr").to_string(); + config()["CALI_MPIREPORT_APPEND"] = opts.get("output.append").to_string(); config()["CALI_MPIREPORT_WRITE_ON_FINALIZE"] = "false"; config()["CALI_MPIREPORT_LOCAL_CONFIG"] = opts.build_query("local", { { "let", local_let }, { "select", local_select }, { "group by", "path" } }); @@ -70,8 +70,8 @@ class RuntimeReportController : public cali::ChannelController } else { config()["CALI_SERVICES_ENABLE"].append(",report"); config()["CALI_REPORT_FILENAME"] = opts.get("output", "stderr").to_string(); - config()["CALI_REPORT_APPEND"] = opts.get("output.append").to_string(); - config()["CALI_REPORT_CONFIG"] = opts.build_query( + config()["CALI_REPORT_APPEND"] = opts.get("output.append").to_string(); + config()["CALI_REPORT_CONFIG"] = opts.build_query( "local", { { "let", local_let }, { "select", serial_select }, { "group by", "path" }, { "format", format } } ); diff --git a/src/caliper/controllers/SampleReportController.cpp b/src/caliper/controllers/SampleReportController.cpp index 4054998b..1adf8e04 100644 --- a/src/caliper/controllers/SampleReportController.cpp +++ b/src/caliper/controllers/SampleReportController.cpp @@ -53,11 +53,11 @@ class SampleReportController : public cali::ChannelController bool use_callpath = opts.is_enabled("callpath"); const char* groupby = "path"; - const char* fmt_in = ""; + const char* fmt_in = ""; if (use_callpath) { groupby = "source.function#callpath.address"; - fmt_in = "path-attributes=source.function#callpath.address"; + fmt_in = "path-attributes=source.function#callpath.address"; } std::string format = util::build_tree_format_spec(config(), opts, fmt_in); @@ -67,8 +67,8 @@ class SampleReportController : public cali::ChannelController if (use_mpi) { config()["CALI_SERVICES_ENABLE"].append(",mpi,mpireport"); - config()["CALI_MPIREPORT_FILENAME"] = opts.get("output", "stderr").to_string(); - config()["CALI_MPIREPORT_APPEND"] = opts.get("output.append").to_string(); + config()["CALI_MPIREPORT_FILENAME"] = opts.get("output", "stderr").to_string(); + config()["CALI_MPIREPORT_APPEND"] = opts.get("output.append").to_string(); config()["CALI_MPIREPORT_WRITE_ON_FINALIZE"] = "false"; config()["CALI_MPIREPORT_LOCAL_CONFIG"] = opts.build_query("local", { { "select", local_select }, { "group by", groupby } }); @@ -79,8 +79,8 @@ class SampleReportController : public cali::ChannelController } else { config()["CALI_SERVICES_ENABLE"].append(",report"); config()["CALI_REPORT_FILENAME"] = opts.get("output", "stderr").to_string(); - config()["CALI_REPORT_APPEND"] = opts.get("output.append").to_string(); - config()["CALI_REPORT_CONFIG"] = opts.build_query( + config()["CALI_REPORT_APPEND"] = opts.get("output.append").to_string(); + config()["CALI_REPORT_CONFIG"] = opts.build_query( "local", { { "select", local_select }, { "group by", groupby }, { "format", format } } ); diff --git a/src/caliper/controllers/SpotController.cpp b/src/caliper/controllers/SpotController.cpp index ae6bb013..cc317890 100644 --- a/src/caliper/controllers/SpotController.cpp +++ b/src/caliper/controllers/SpotController.cpp @@ -288,8 +288,8 @@ class SpotController : public cali::internal::CustomOutputController ) { int iterations = comm.bcast_int(info.iterations); - int rec_count = comm.bcast_int(info.count); - std::string name = comm.bcast_str(info.name); + int rec_count = comm.bcast_int(info.count); + std::string name = comm.bcast_str(info.name); if (iterations > 0) { int nblocks = 20; @@ -435,7 +435,7 @@ class SpotController : public cali::internal::CustomOutputController void save_spot_metadata() { std::string spot_channels = "regionprofile"; - std::string spot_opts = ""; + std::string spot_opts = ""; for (const auto& o : m_opts.enabled_options()) { if (!spot_opts.empty()) diff --git a/src/caliper/test/MockupMetadataDB.h b/src/caliper/test/MockupMetadataDB.h index a4b59e13..2ebac086 100644 --- a/src/caliper/test/MockupMetadataDB.h +++ b/src/caliper/test/MockupMetadataDB.h @@ -106,8 +106,8 @@ class MockupMetadataDB : public CaliperMetadataAccessInterface Attribute create_attribute( const std::string& name, cali_attr_type type, - int prop = CALI_ATTR_DEFAULT, - int meta = 0, + int prop = CALI_ATTR_DEFAULT, + int meta = 0, const Attribute* meta_attr = nullptr, const Variant* meta_data = nullptr ) diff --git a/src/caliper/test/test_attribute.cpp b/src/caliper/test/test_attribute.cpp index bd046cce..49d539a7 100644 --- a/src/caliper/test/test_attribute.cpp +++ b/src/caliper/test/test_attribute.cpp @@ -29,7 +29,7 @@ TEST(AttributeAPITest, ValidAttribute) EXPECT_FALSE(meta_attr.is_nested()); EXPECT_FALSE(meta_attr.store_as_value()); - cali_id_t meta_id = meta_attr.id(); + cali_id_t meta_id = meta_attr.id(); cali_variant_t meta_val = cali_make_variant_from_int(42); cali_id_t attr_id = cali_create_attribute_with_metadata( diff --git a/src/caliper/test/test_blackboard.cpp b/src/caliper/test/test_blackboard.cpp index 3db979ea..69c396b5 100644 --- a/src/caliper/test/test_blackboard.cpp +++ b/src/caliper/test/test_blackboard.cpp @@ -11,9 +11,9 @@ TEST(BlackboardTest, BasicFunctionality) { Caliper c; - Attribute attr_ref = c.create_attribute("bb.gs.ref", CALI_TYPE_INT, CALI_ATTR_DEFAULT); - Attribute attr_imm = c.create_attribute("bb.gs.imm", CALI_TYPE_INT, CALI_ATTR_ASVALUE); - Attribute attr_uns = c.create_attribute("bb.gs.uns", CALI_TYPE_INT, CALI_ATTR_ASVALUE); + Attribute attr_ref = c.create_attribute("bb.gs.ref", CALI_TYPE_INT, CALI_ATTR_DEFAULT); + Attribute attr_imm = c.create_attribute("bb.gs.imm", CALI_TYPE_INT, CALI_ATTR_ASVALUE); + Attribute attr_uns = c.create_attribute("bb.gs.uns", CALI_TYPE_INT, CALI_ATTR_ASVALUE); Attribute attr_hidden = c.create_attribute("bb.gs.h", CALI_TYPE_INT, CALI_ATTR_ASVALUE | CALI_ATTR_HIDDEN); Node* node_p = c.make_tree_entry(attr_ref, Variant(42)); @@ -126,8 +126,8 @@ TEST(BlackboardTest, Snapshot) { Caliper c; - Attribute attr_ref = c.create_attribute("bb.sn.ref", CALI_TYPE_INT, CALI_ATTR_DEFAULT); - Attribute attr_imm = c.create_attribute("bb.sn.imm", CALI_TYPE_INT, CALI_ATTR_ASVALUE); + Attribute attr_ref = c.create_attribute("bb.sn.ref", CALI_TYPE_INT, CALI_ATTR_DEFAULT); + Attribute attr_imm = c.create_attribute("bb.sn.imm", CALI_TYPE_INT, CALI_ATTR_ASVALUE); Attribute attr_hidden = c.create_attribute("bb.sn.h", CALI_TYPE_INT, CALI_ATTR_ASVALUE | CALI_ATTR_HIDDEN); Node* node_p = c.make_tree_entry(attr_ref, Variant(42)); diff --git a/src/caliper/test/test_c_snapshot.cpp b/src/caliper/test/test_c_snapshot.cpp index d1a3c01e..3c546249 100644 --- a/src/caliper/test/test_c_snapshot.cpp +++ b/src/caliper/test/test_c_snapshot.cpp @@ -69,7 +69,7 @@ TEST(C_Snapshot_Test, Unpack) Attribute node_str_attr = c.create_attribute("unpack.node.str", CALI_TYPE_STRING, CALI_ATTR_DEFAULT); Attribute node_int_attr = c.create_attribute("unpack.node.int", CALI_TYPE_INT, CALI_ATTR_DEFAULT); - Attribute val_int_attr = c.create_attribute("unpac.val.int", CALI_TYPE_INT, CALI_ATTR_ASVALUE); + Attribute val_int_attr = c.create_attribute("unpac.val.int", CALI_TYPE_INT, CALI_ATTR_ASVALUE); Variant node_str_1(CALI_TYPE_STRING, "My wonderful unpack test string", 32); Variant node_str_2(CALI_TYPE_STRING, "My other unpack test string", 27); @@ -151,8 +151,8 @@ TEST(C_Snapshot_Test, PullSnapshot) Attribute node_str_attr = c.create_attribute("pull.node.str", CALI_TYPE_STRING, CALI_ATTR_DEFAULT); Attribute node_int_attr = c.create_attribute("pull.node.int", CALI_TYPE_INT, CALI_ATTR_DEFAULT); - Attribute val_int_attr = c.create_attribute("pull.val.int", CALI_TYPE_INT, CALI_ATTR_ASVALUE); - Attribute val_dbl_attr = c.create_attribute("pull.val.dbl", CALI_TYPE_DOUBLE, CALI_ATTR_ASVALUE); + Attribute val_int_attr = c.create_attribute("pull.val.int", CALI_TYPE_INT, CALI_ATTR_ASVALUE); + Attribute val_dbl_attr = c.create_attribute("pull.val.dbl", CALI_TYPE_DOUBLE, CALI_ATTR_ASVALUE); Variant node_str_1(CALI_TYPE_STRING, "My wonderful pull test string", 30); Variant node_str_2(CALI_TYPE_STRING, "My other pull test string", 25); @@ -168,7 +168,7 @@ TEST(C_Snapshot_Test, PullSnapshot) const char* cfg[][2] = { { NULL, NULL } }; - cali_configset_t cfgset = cali_create_configset(cfg); + cali_configset_t cfgset = cali_create_configset(cfg); cali_id_t test_channel = cali_create_channel("test.push_snapshot", 0, cfgset); cali_delete_configset(cfgset); @@ -258,7 +258,7 @@ TEST(C_Snapshot_Test, FindFirstInSnapshot) Attribute node_str_attr = c.create_attribute("findfirst.node.str", CALI_TYPE_STRING, CALI_ATTR_DEFAULT); Attribute node_int_attr = c.create_attribute("findfirst.node.int", CALI_TYPE_INT, CALI_ATTR_DEFAULT); - Attribute val_int_attr = c.create_attribute("findfirst.val.int", CALI_TYPE_INT, CALI_ATTR_ASVALUE); + Attribute val_int_attr = c.create_attribute("findfirst.val.int", CALI_TYPE_INT, CALI_ATTR_ASVALUE); Variant node_str_1(CALI_TYPE_STRING, "My wonderful unpack test string", 32); Variant node_str_2(CALI_TYPE_STRING, "My other unpack test string", 27); @@ -291,13 +291,13 @@ TEST(C_Snapshot_Test, FindFirstInSnapshot) EXPECT_EQ(Variant(val), node_str_2); bytes_read = 0; - val = cali_find_first_in_snapshot(rec.data(), node_int_attr.id(), &bytes_read); + val = cali_find_first_in_snapshot(rec.data(), node_int_attr.id(), &bytes_read); EXPECT_EQ(bytes_read, rec.size()); EXPECT_EQ(Variant(val), node_int_2); bytes_read = 0; - val = cali_find_first_in_snapshot(rec.data(), val_int_attr.id(), &bytes_read); + val = cali_find_first_in_snapshot(rec.data(), val_int_attr.id(), &bytes_read); EXPECT_EQ(bytes_read, rec.size()); EXPECT_EQ(Variant(val), val_int_1); @@ -305,7 +305,7 @@ TEST(C_Snapshot_Test, FindFirstInSnapshot) // a non-existing attribute bytes_read = 0; - val = cali_find_first_in_snapshot(rec.data(), CALI_INV_ID, &bytes_read); + val = cali_find_first_in_snapshot(rec.data(), CALI_INV_ID, &bytes_read); EXPECT_EQ(bytes_read, rec.size()); EXPECT_TRUE(Variant(val).empty()); @@ -319,7 +319,7 @@ TEST(C_Snapshot_Test, FindAllInSnapshot) Attribute node_str_attr = c.create_attribute("findall.node.str", CALI_TYPE_STRING, CALI_ATTR_DEFAULT); Attribute node_int_attr = c.create_attribute("findall.node.int", CALI_TYPE_INT, CALI_ATTR_DEFAULT); - Attribute val_int_attr = c.create_attribute("findall.val.int", CALI_TYPE_INT, CALI_ATTR_ASVALUE); + Attribute val_int_attr = c.create_attribute("findall.val.int", CALI_TYPE_INT, CALI_ATTR_ASVALUE); Variant node_str_1(CALI_TYPE_STRING, "My wonderful findall test string", 33); Variant node_str_2(CALI_TYPE_STRING, "My other findall test string", 28); @@ -408,7 +408,7 @@ TEST(C_Snapshot_Test, FindAllInSnapshot) UnpackSnapshotTestData t5; t5.max_visit_count = 1; - size_t bytes_read = 0; + size_t bytes_read = 0; cali_find_all_in_snapshot(rec.data(), node_int_attr.id(), &bytes_read, ::test_entry_proc_op, &t5); diff --git a/src/caliper/test/test_channel_api.cpp b/src/caliper/test/test_channel_api.cpp index c93c98c1..3e7eb078 100644 --- a/src/caliper/test/test_channel_api.cpp +++ b/src/caliper/test/test_channel_api.cpp @@ -18,7 +18,7 @@ TEST(ChannelAPITest, MultiChannel) Channel chn_b = c.get_channel(chn_b_id); Attribute attr_global = c.create_attribute("multichn.global", CALI_TYPE_INT, CALI_ATTR_DEFAULT); - Attribute attr_local = c.create_attribute("multichn.local", CALI_TYPE_INT, CALI_ATTR_DEFAULT); + Attribute attr_local = c.create_attribute("multichn.local", CALI_TYPE_INT, CALI_ATTR_DEFAULT); c.begin(attr_global, Variant(42)); diff --git a/src/caliper/test/test_channel_controller.cpp b/src/caliper/test/test_channel_controller.cpp index e69181d2..223485a4 100644 --- a/src/caliper/test/test_channel_controller.cpp +++ b/src/caliper/test/test_channel_controller.cpp @@ -16,7 +16,7 @@ TEST(ChannelControllerTest, ChannelController) void on_create(Caliper*, Channel& chn) { saw_create_callback = true; - the_channel = chn; + the_channel = chn; } TestCC() diff --git a/src/caliper/test/test_postprocess_snapshot.cpp b/src/caliper/test/test_postprocess_snapshot.cpp index 64a62876..8a507751 100644 --- a/src/caliper/test/test_postprocess_snapshot.cpp +++ b/src/caliper/test/test_postprocess_snapshot.cpp @@ -23,7 +23,7 @@ void flush_cb(Caliper* c, Channel*, SnapshotView, SnapshotFlushFn flush_fn) void postprocess_snapshot_cb(Caliper* c, Channel*, std::vector& rec) { - Attribute val_attr = c->create_attribute("tps.postprocess.val", CALI_TYPE_INT, CALI_ATTR_ASVALUE); + Attribute val_attr = c->create_attribute("tps.postprocess.val", CALI_TYPE_INT, CALI_ATTR_ASVALUE); Attribute node_attr = c->create_attribute("tps.postprocess.node", CALI_TYPE_INT, CALI_ATTR_DEFAULT); rec.push_back(Entry(val_attr, Variant(42))); @@ -50,8 +50,8 @@ TEST(PostprocessSnapshotTest, PostprocessSnapshot) }); Attribute snapshot_val_attr = c.get_attribute("tps.snapshot.val"); - Attribute post_val_attr = c.get_attribute("tps.postprocess.val"); - Attribute post_node_attr = c.get_attribute("tps.postprocess.node"); + Attribute post_val_attr = c.get_attribute("tps.postprocess.val"); + Attribute post_node_attr = c.get_attribute("tps.postprocess.node"); ASSERT_EQ(output.size(), 1); ASSERT_EQ(output.front().size(), 3); diff --git a/src/common/CompressedSnapshotRecord.cpp b/src/common/CompressedSnapshotRecord.cpp index 562a1773..0a91bbb0 100644 --- a/src/common/CompressedSnapshotRecord.cpp +++ b/src/common/CompressedSnapshotRecord.cpp @@ -81,7 +81,7 @@ Entry CompressedSnapshotRecordView::unpack_next_entry(const CaliperMetadataAcces if (n < m_num_nodes + m_num_imm) { ++n; - cali_id_t id = vldec_u64(m_buffer + pos, &pos); + cali_id_t id = vldec_u64(m_buffer + pos, &pos); Variant data = Variant::unpack(m_buffer + pos, &pos, nullptr); return Entry(c->get_attribute(id), data); @@ -129,7 +129,7 @@ std::vector CompressedSnapshotRecordView::to_entrylist(const CaliperMetad size_t pos = m_imm_pos + 1; for (size_t i = 0; i < m_num_imm; ++i) { - cali_id_t id = vldec_u64(m_buffer + pos, &pos); + cali_id_t id = vldec_u64(m_buffer + pos, &pos); Variant data = Variant::unpack(m_buffer + pos, &pos, nullptr); list.push_back(Entry(c->get_attribute(id), data)); diff --git a/src/common/CompressedSnapshotRecord.h b/src/common/CompressedSnapshotRecord.h index 12f204c3..4d448daa 100644 --- a/src/common/CompressedSnapshotRecord.h +++ b/src/common/CompressedSnapshotRecord.h @@ -72,7 +72,7 @@ class CompressedSnapshotRecordView template void unpack(const CaliperMetadataAccessInterface* c, EntryProcFn fn) { - size_t n = 0; + size_t n = 0; size_t pos = 1; while (n < m_num_nodes + m_num_imm) @@ -91,7 +91,7 @@ class CompressedSnapshotRecordView class CompressedSnapshotRecord { static constexpr size_t m_internal_buffer_size = 512; - static constexpr size_t m_blocksize = 4; + static constexpr size_t m_blocksize = 4; unsigned char m_internal_buffer[m_internal_buffer_size]; unsigned char* m_buffer; diff --git a/src/common/Log.cpp b/src/common/Log.cpp index e0953807..feaa6dfc 100644 --- a/src/common/Log.cpp +++ b/src/common/Log.cpp @@ -76,7 +76,7 @@ struct LogImpl { } }; -const char* LogImpl::s_prefix = "== CALIPER: "; +const char* LogImpl::s_prefix = "== CALIPER: "; const ConfigSet::Entry LogImpl::s_configdata[] = { // key, type, value, short description, long description { "verbosity", diff --git a/src/common/NodeBuffer.cpp b/src/common/NodeBuffer.cpp index 2199b522..7cb2952d 100644 --- a/src/common/NodeBuffer.cpp +++ b/src/common/NodeBuffer.cpp @@ -33,7 +33,7 @@ inline size_t max_packed_size(const NodeBuffer::NodeInfo& info) size_t pack_node(unsigned char* buf, const NodeBuffer::NodeInfo& info) { bool have_parent = (info.parent_id != CALI_INV_ID); - size_t pos = 0; + size_t pos = 0; // store id & flag in first uint: flag indicates whether parent ID is needed uint64_t u = 2 * info.node_id + (have_parent ? 1 : 0); @@ -59,7 +59,7 @@ NodeBuffer::NodeInfo unpack_node(const unsigned char* buf, size_t* inc) NodeBuffer::NodeInfo ret = { CALI_INV_ID, CALI_INV_ID, CALI_INV_ID, Variant() }; size_t pos = 0; - uint64_t u = vldec_u64(buf + pos, &pos); + uint64_t u = vldec_u64(buf + pos, &pos); bool have_parent = ((u % 2) == 1); ret.node_id = u / 2; @@ -68,7 +68,7 @@ NodeBuffer::NodeInfo unpack_node(const unsigned char* buf, size_t* inc) if (have_parent) ret.parent_id = vldec_u64(buf + pos, &pos); - u = vldec_u64(buf + pos, &pos); + u = vldec_u64(buf + pos, &pos); size_t size = vldec_u64(buf + pos, &pos); cali_attr_type type = (u <= CALI_MAXTYPE ? static_cast(u) : CALI_TYPE_INV); @@ -126,7 +126,7 @@ unsigned char* NodeBuffer::import(size_t size, size_t count) { reserve(size); - m_pos = size; + m_pos = size; m_count = count; return m_buffer; diff --git a/src/common/NodeBuffer.h b/src/common/NodeBuffer.h index 380c8106..49e3fd1e 100644 --- a/src/common/NodeBuffer.h +++ b/src/common/NodeBuffer.h @@ -41,7 +41,7 @@ class NodeBuffer ~NodeBuffer(); - NodeBuffer(const NodeBuffer&) = delete; + NodeBuffer(const NodeBuffer&) = delete; NodeBuffer& operator=(const NodeBuffer&) = delete; void append(const NodeInfo& info); diff --git a/src/common/OutputStream.cpp b/src/common/OutputStream.cpp index 797bd327..f1be6aaf 100644 --- a/src/common/OutputStream.cpp +++ b/src/common/OutputStream.cpp @@ -144,8 +144,8 @@ struct OutputStream::OutputStreamImpl { { fs.close(); filename.clear(); - user_os = nullptr; - type = StreamType::None; + user_os = nullptr; + type = StreamType::None; is_initialized = false; } @@ -194,7 +194,7 @@ void OutputStream::set_stream(std::ostream* os) { mP->reset(); - mP->type = StreamType::User; + mP->type = StreamType::User; mP->user_os = os; } @@ -203,7 +203,7 @@ void OutputStream::set_filename(const char* filename) mP->reset(); mP->filename = filename; - mP->type = StreamType::File; + mP->type = StreamType::File; } void OutputStream::set_filename( @@ -225,6 +225,6 @@ void OutputStream::set_filename( formatter.print(fnamestr, db, rec); mP->filename = fnamestr.str(); - mP->type = StreamType::File; + mP->type = StreamType::File; } } diff --git a/src/common/SnapshotBuffer.cpp b/src/common/SnapshotBuffer.cpp index 66a57ed5..feda7545 100644 --- a/src/common/SnapshotBuffer.cpp +++ b/src/common/SnapshotBuffer.cpp @@ -53,7 +53,7 @@ unsigned char* SnapshotBuffer::import(size_t size, size_t count) { reserve(size); - m_pos = size; + m_pos = size; m_count = count; return m_buffer; diff --git a/src/common/SnapshotBuffer.h b/src/common/SnapshotBuffer.h index 2de37a9f..b6e66e37 100644 --- a/src/common/SnapshotBuffer.h +++ b/src/common/SnapshotBuffer.h @@ -33,7 +33,7 @@ class SnapshotBuffer ~SnapshotBuffer(); - SnapshotBuffer(const SnapshotBuffer&) = delete; + SnapshotBuffer(const SnapshotBuffer&) = delete; SnapshotBuffer& operator=(const SnapshotBuffer&) = delete; void append(const CompressedSnapshotRecord& rec); diff --git a/src/common/SnapshotTextFormatter.cpp b/src/common/SnapshotTextFormatter.cpp index fee24c27..2c966991 100644 --- a/src/common/SnapshotTextFormatter.cpp +++ b/src/common/SnapshotTextFormatter.cpp @@ -58,8 +58,8 @@ struct cali::SnapshotTextFormatter::SnapshotTextFormatterImpl { // look for width/alignment specification (in [] brackets) int wfbegin = -1; - int wfend = -1; - int apos = -1; + int wfend = -1; + int apos = -1; int nfields = field_strings.size(); @@ -142,7 +142,7 @@ struct cali::SnapshotTextFormatter::SnapshotTextFormatterImpl { " "; int len = str.size(); - int w = len < f.width ? std::min(f.width - len, 80) : 0; + int w = len < f.width ? std::min(f.width - len, 80) : 0; if (f.align == 'r') os << f.prefix << (w > 0 ? whitespace + (80 - w) : "") << str; diff --git a/src/common/StringConverter.cpp b/src/common/StringConverter.cpp index 62f378fc..8c8b99d7 100644 --- a/src/common/StringConverter.cpp +++ b/src/common/StringConverter.cpp @@ -22,7 +22,7 @@ cali_id_t cali::StringConverter::to_id() const bool cali::StringConverter::to_bool(bool* okptr) const { - bool ok = false; + bool ok = false; bool res = false; // try string @@ -33,10 +33,10 @@ bool cali::StringConverter::to_bool(bool* okptr) const std::transform(m_str.begin(), m_str.end(), std::back_inserter(lower), ::tolower); if (lower == "true" || lower == "t") { - ok = true; + ok = true; res = true; } else if (lower == "false" || lower == "f") { - ok = true; + ok = true; res = false; } } @@ -48,7 +48,7 @@ bool cali::StringConverter::to_bool(bool* okptr) const unsigned long i = std::stoul(m_str); res = (i != 0); - ok = true; + ok = true; } catch (...) { ok = false; } @@ -62,12 +62,12 @@ bool cali::StringConverter::to_bool(bool* okptr) const int cali::StringConverter::to_int(bool* okptr) const { - bool ok = false; + bool ok = false; int res = 0; try { res = std::stoi(m_str); - ok = true; + ok = true; } catch (...) { ok = false; } @@ -80,12 +80,12 @@ int cali::StringConverter::to_int(bool* okptr) const int64_t cali::StringConverter::to_int64(bool* okptr) const { - bool ok = false; + bool ok = false; int64_t res = 0; try { res = std::stoll(m_str); - ok = true; + ok = true; } catch (...) { ok = false; } @@ -98,12 +98,12 @@ int64_t cali::StringConverter::to_int64(bool* okptr) const uint64_t cali::StringConverter::to_uint(bool* okptr, int base) const { - bool ok = false; + bool ok = false; uint64_t res = 0; try { res = std::stoull(m_str, nullptr, base); - ok = true; + ok = true; } catch (...) { ok = false; } @@ -116,12 +116,12 @@ uint64_t cali::StringConverter::to_uint(bool* okptr, int base) const double cali::StringConverter::to_double(bool* okptr) const { - bool ok = false; + bool ok = false; double res = 0; try { res = std::stod(m_str); - ok = true; + ok = true; } catch (...) { ok = false; } @@ -163,7 +163,7 @@ std::vector cali::StringConverter::rec_list(bool* okptr) std::istringstream is(m_str); int d = 0; - c = util::read_char(is); + c = util::read_char(is); if (c == '[') ++d; @@ -239,7 +239,7 @@ std::map cali::StringConverter::rec_dict(boo do { std::string key = util::read_word(is, ":"); - c = util::read_char(is); + c = util::read_char(is); if (c != ':') { if (okptr) diff --git a/src/common/Variant.cpp b/src/common/Variant.cpp index 9d172b7e..fff830fc 100644 --- a/src/common/Variant.cpp +++ b/src/common/Variant.cpp @@ -42,7 +42,7 @@ std::string Variant::to_string() const case CALI_TYPE_USR: { size_t size = this->size(); - const void* ptr = data(); + const void* ptr = data(); std::ostringstream os; @@ -111,13 +111,13 @@ Variant Variant::from_string(cali_attr_type type, const char* str) case CALI_TYPE_INT: { char* str_end = nullptr; - long long ll = std::strtoll(str, &str_end, 10); + long long ll = std::strtoll(str, &str_end, 10); return str != str_end ? Variant(cali_make_variant_from_int64(ll)) : Variant(); } case CALI_TYPE_ADDR: { bool ok = false; - uint64_t u = StringConverter(str).to_uint(&ok, 16); + uint64_t u = StringConverter(str).to_uint(&ok, 16); return ok ? Variant(CALI_TYPE_ADDR, &u, sizeof(uint64_t)) : Variant(); } case CALI_TYPE_UINT: @@ -128,13 +128,13 @@ Variant Variant::from_string(cali_attr_type type, const char* str) case CALI_TYPE_DOUBLE: { char* str_end = nullptr; - double d = std::strtod(str, &str_end); + double d = std::strtod(str, &str_end); return str != str_end ? Variant(d) : Variant(); } case CALI_TYPE_BOOL: { bool ok = false; - bool b = StringConverter(str).to_bool(&ok); + bool b = StringConverter(str).to_bool(&ok); return ok ? Variant(b) : Variant(); } case CALI_TYPE_TYPE: diff --git a/src/common/cali_variant.c b/src/common/cali_variant.c index 26c53c4d..f2351cb1 100644 --- a/src/common/cali_variant.c +++ b/src/common/cali_variant.c @@ -28,7 +28,7 @@ cali_attr_type cali_variant_get_type(cali_variant_t v) size_t cali_variant_get_size(cali_variant_t v) { - uint64_t t = _EXTRACT_TYPE(v.type_and_size); + uint64_t t = _EXTRACT_TYPE(v.type_and_size); cali_attr_type type = (t <= CALI_MAXTYPE ? (cali_attr_type) t : CALI_TYPE_INV); switch (type) { @@ -56,7 +56,7 @@ size_t cali_variant_get_size(cali_variant_t v) const void* cali_variant_get_data(const cali_variant_t* v) { - uint64_t t = _EXTRACT_TYPE(v->type_and_size); + uint64_t t = _EXTRACT_TYPE(v->type_and_size); cali_attr_type type = (t <= CALI_MAXTYPE ? (cali_attr_type) t : CALI_TYPE_INV); switch (type) { @@ -107,7 +107,7 @@ cali_variant_t cali_make_variant(cali_attr_type type, const void* ptr, size_t si hash <<= 8; } - v.type_and_size = (size << 32) | hash | (type & CALI_VARIANT_TYPE_MASK); + v.type_and_size = (size << 32) | hash | (type & CALI_VARIANT_TYPE_MASK); v.value.unmanaged_const_ptr = ptr; } break; @@ -167,10 +167,10 @@ extern inline void* cali_variant_get_ptr(cali_variant_t v); */ int cali_variant_to_int(cali_variant_t v, bool* okptr) { - bool ok = true; + bool ok = true; int ret = 0; - uint64_t t = _EXTRACT_TYPE(v.type_and_size); + uint64_t t = _EXTRACT_TYPE(v.type_and_size); cali_attr_type type = (t <= CALI_MAXTYPE ? (cali_attr_type) t : CALI_TYPE_INV); switch (type) { @@ -224,10 +224,10 @@ int cali_variant_to_int(cali_variant_t v, bool* okptr) */ int64_t cali_variant_to_int64(cali_variant_t v, bool* okptr) { - bool ok = true; + bool ok = true; int64_t ret = 0; - uint64_t t = _EXTRACT_TYPE(v.type_and_size); + uint64_t t = _EXTRACT_TYPE(v.type_and_size); cali_attr_type type = (t <= CALI_MAXTYPE ? (cali_attr_type) t : CALI_TYPE_INV); switch (type) { @@ -278,10 +278,10 @@ int64_t cali_variant_to_int64(cali_variant_t v, bool* okptr) */ uint64_t cali_variant_to_uint(cali_variant_t v, bool* okptr) { - bool ok = true; + bool ok = true; uint64_t ret = 0; - uint64_t t = _EXTRACT_TYPE(v.type_and_size); + uint64_t t = _EXTRACT_TYPE(v.type_and_size); cali_attr_type type = (t <= CALI_MAXTYPE ? (cali_attr_type) t : CALI_TYPE_INV); switch (type) { @@ -332,10 +332,10 @@ uint64_t cali_variant_to_uint(cali_variant_t v, bool* okptr) */ double cali_variant_to_double(cali_variant_t v, bool* okptr) { - bool ok = true; + bool ok = true; double ret = 0; - uint64_t t = _EXTRACT_TYPE(v.type_and_size); + uint64_t t = _EXTRACT_TYPE(v.type_and_size); cali_attr_type type = (t <= CALI_MAXTYPE ? (cali_attr_type) t : CALI_TYPE_INV); switch (type) { @@ -383,10 +383,10 @@ double cali_variant_to_double(cali_variant_t v, bool* okptr) */ bool cali_variant_to_bool(cali_variant_t v, bool* okptr) { - bool ok = true; + bool ok = true; bool ret = false; - uint64_t t = _EXTRACT_TYPE(v.type_and_size); + uint64_t t = _EXTRACT_TYPE(v.type_and_size); cali_attr_type type = (t <= CALI_MAXTYPE ? (cali_attr_type) t : CALI_TYPE_INV); switch (type) { @@ -423,10 +423,10 @@ bool cali_variant_to_bool(cali_variant_t v, bool* okptr) */ cali_attr_type cali_variant_to_type(cali_variant_t v, bool* okptr) { - bool ok = true; + bool ok = true; cali_attr_type ret = CALI_TYPE_INV; - uint64_t t = _EXTRACT_TYPE(v.type_and_size); + uint64_t t = _EXTRACT_TYPE(v.type_and_size); cali_attr_type type = (t <= CALI_MAXTYPE ? (cali_attr_type) t : CALI_TYPE_INV); switch (type) { @@ -450,9 +450,9 @@ static inline int imin(int l, int r) int cali_variant_compare(cali_variant_t lhs, cali_variant_t rhs) { - uint64_t t = _EXTRACT_TYPE(lhs.type_and_size); + uint64_t t = _EXTRACT_TYPE(lhs.type_and_size); cali_attr_type lhstype = (t <= CALI_MAXTYPE ? (cali_attr_type) t : CALI_TYPE_INV); - t = _EXTRACT_TYPE(rhs.type_and_size); + t = _EXTRACT_TYPE(rhs.type_and_size); cali_attr_type rhstype = (t <= CALI_MAXTYPE ? (cali_attr_type) t : CALI_TYPE_INV); if (lhstype == rhstype) { @@ -555,7 +555,7 @@ cali_variant_t cali_variant_unpack(const unsigned char* buf, size_t* inc, bool* } v.type_and_size = ts; - v.value.v_uint = vldec_u64(buf + p, &p); + v.value.v_uint = vldec_u64(buf + p, &p); if (inc) *inc += p; diff --git a/src/common/test/MockupMetadataDB.h b/src/common/test/MockupMetadataDB.h index 26f159eb..9d0cb93e 100644 --- a/src/common/test/MockupMetadataDB.h +++ b/src/common/test/MockupMetadataDB.h @@ -106,8 +106,8 @@ class MockupMetadataDB : public CaliperMetadataAccessInterface Attribute create_attribute( const std::string& name, cali_attr_type type, - int prop = CALI_ATTR_DEFAULT, - int meta = 0, + int prop = CALI_ATTR_DEFAULT, + int meta = 0, const Attribute* meta_attr = nullptr, const Variant* meta_data = nullptr ) diff --git a/src/common/test/test_c_variant.cpp b/src/common/test/test_c_variant.cpp index a42ce4ed..a32c2dd5 100644 --- a/src/common/test/test_c_variant.cpp +++ b/src/common/test/test_c_variant.cpp @@ -75,7 +75,7 @@ TEST(C_Variant_Test, CreateUintVariant) // also test ADDR type here, basically the same as UINT void* ptr = &val; - cali_variant_t v3 = cali_make_variant(CALI_TYPE_ADDR, &ptr, sizeof(void*)); + cali_variant_t v3 = cali_make_variant(CALI_TYPE_ADDR, &ptr, sizeof(void*)); EXPECT_EQ(cali_variant_get_type(v3), CALI_TYPE_ADDR); EXPECT_EQ(cali_variant_get_size(v3), sizeof(uint64_t)); // yes, Caliper ADDR type is always 64bit EXPECT_EQ(cali_variant_to_uint(v3, NULL), reinterpret_cast(ptr)); @@ -85,7 +85,7 @@ TEST(C_Variant_Test, CreateDoubleVariant) { double val = 42.42; - cali_variant_t v = cali_make_variant_from_double(val); + cali_variant_t v = cali_make_variant_from_double(val); bool ok = false; EXPECT_EQ(cali_variant_get_type(v), CALI_TYPE_DOUBLE); @@ -261,19 +261,19 @@ TEST(C_Variant_Test, Compare) TEST(C_Variant_Test, PackUnpack) { - int val_1_int = -27; + int val_1_int = -27; uint64_t val_2_uint = 0xFFFFFFFFAA; - const char* val_3_str = "My wonderful test string"; - double val_4_dbl = 42.42; - const void* val_5_inv = NULL; + const char* val_3_str = "My wonderful test string"; + double val_4_dbl = 42.42; + const void* val_5_inv = NULL; cali_attr_type val_6_type = CALI_TYPE_ADDR; bool val_7_bool = true; - cali_variant_t v_1_int_in = cali_make_variant_from_int(val_1_int); + cali_variant_t v_1_int_in = cali_make_variant_from_int(val_1_int); cali_variant_t v_2_uint_in = cali_make_variant_from_uint(val_2_uint); - cali_variant_t v_3_str_in = cali_make_variant(CALI_TYPE_STRING, val_3_str, strlen(val_3_str) + 1); - cali_variant_t v_4_dbl_in = cali_make_variant_from_double(val_4_dbl); - cali_variant_t v_5_inv_in = cali_make_variant(CALI_TYPE_INV, val_5_inv, 0); + cali_variant_t v_3_str_in = cali_make_variant(CALI_TYPE_STRING, val_3_str, strlen(val_3_str) + 1); + cali_variant_t v_4_dbl_in = cali_make_variant_from_double(val_4_dbl); + cali_variant_t v_5_inv_in = cali_make_variant(CALI_TYPE_INV, val_5_inv, 0); cali_variant_t v_6_type_in = cali_make_variant_from_type(val_6_type); cali_variant_t v_7_bool_in = cali_make_variant_from_bool(val_7_bool); @@ -293,7 +293,7 @@ TEST(C_Variant_Test, PackUnpack) EXPECT_LE(pos, 140); bool ok = false; - pos = 0; + pos = 0; cali_variant_t v_1_int_out = cali_variant_unpack(buf + pos, &pos, &ok); EXPECT_TRUE(ok && "v_1 unpack (int)"); diff --git a/src/common/test/test_stringconverter.cpp b/src/common/test/test_stringconverter.cpp index 0edac825..0bf85001 100644 --- a/src/common/test/test_stringconverter.cpp +++ b/src/common/test/test_stringconverter.cpp @@ -60,26 +60,26 @@ TEST(StringConverterTest, ConvertInt) EXPECT_TRUE(ok); EXPECT_EQ(res, 42); - ok = false; + ok = false; strconv = StringConverter("0"); - res = strconv.to_int(&ok); + res = strconv.to_int(&ok); EXPECT_TRUE(ok); EXPECT_EQ(res, 0); - ok = false; + ok = false; strconv = StringConverter(" -14 "); - res = strconv.to_int(&ok); + res = strconv.to_int(&ok); EXPECT_TRUE(ok); EXPECT_EQ(res, -14); - ok = false; + ok = false; strconv = StringConverter("bla"); - res = strconv.to_int(&ok); + res = strconv.to_int(&ok); EXPECT_FALSE(ok); - ok = false; + ok = false; strconv = StringConverter(); - res = strconv.to_int(&ok); + res = strconv.to_int(&ok); EXPECT_FALSE(ok); } @@ -92,20 +92,20 @@ TEST(StringConverterTest, ConvertUint) EXPECT_TRUE(ok); EXPECT_EQ(res, 42); - ok = false; + ok = false; strconv = StringConverter("0"); - res = strconv.to_uint(&ok); + res = strconv.to_uint(&ok); EXPECT_TRUE(ok); EXPECT_EQ(res, 0); - ok = false; + ok = false; strconv = StringConverter("bla"); - res = strconv.to_uint(&ok); + res = strconv.to_uint(&ok); EXPECT_FALSE(ok); - ok = false; + ok = false; strconv = StringConverter(); - res = strconv.to_uint(&ok); + res = strconv.to_uint(&ok); EXPECT_FALSE(ok); } diff --git a/src/common/test/test_variant.cpp b/src/common/test/test_variant.cpp index 55c48cce..26ca9c05 100644 --- a/src/common/test/test_variant.cpp +++ b/src/common/test/test_variant.cpp @@ -11,8 +11,8 @@ using namespace cali; TEST(Variant_Test, FromString) { const char* teststr = "My wonderful test string"; - uint64_t uval = 0xef10; - int64_t i64val = -9876543210; + uint64_t uval = 0xef10; + int64_t i64val = -9876543210; const struct testcase_t { cali_attr_type type; @@ -72,11 +72,11 @@ TEST(Variant_Test, UintOverloads) TEST(Variant_Test, Conversions) { - int val_1_int_neg = -27; + int val_1_int_neg = -27; int64_t val_2_i64_nlrg = -9876543210; uint64_t val_3_uint_sml = 42; uint64_t val_4_uint_lrg = 0xFFFFFFFFFFAA; - int val_5_zero = 0; + int val_5_zero = 0; cali::Variant v_1_int_neg(val_1_int_neg); cali::Variant v_2_i64_nlrg(cali_make_variant_from_int64(val_2_i64_nlrg)); @@ -92,13 +92,13 @@ TEST(Variant_Test, Conversions) { bool v_1_int_neg_to_int = false; - int val_int = v_1_int_neg.to_int(&v_1_int_neg_to_int); + int val_int = v_1_int_neg.to_int(&v_1_int_neg_to_int); EXPECT_TRUE(v_1_int_neg_to_int); EXPECT_EQ(val_int, val_1_int_neg); } { bool v_1_int_neg_to_i64 = false; - int64_t val_i64 = v_1_int_neg.to_int64(&v_1_int_neg_to_i64); + int64_t val_i64 = v_1_int_neg.to_int64(&v_1_int_neg_to_i64); EXPECT_TRUE(v_1_int_neg_to_i64); EXPECT_EQ(val_i64, static_cast(val_1_int_neg)); } @@ -115,7 +115,7 @@ TEST(Variant_Test, Conversions) } { bool v_2_i64_nlrg_to_i64 = false; - int64_t val_i64 = v_2_i64_nlrg.to_int64(&v_2_i64_nlrg_to_i64); + int64_t val_i64 = v_2_i64_nlrg.to_int64(&v_2_i64_nlrg_to_i64); EXPECT_TRUE(v_2_i64_nlrg_to_i64); EXPECT_EQ(val_i64, val_2_i64_nlrg); } @@ -127,25 +127,25 @@ TEST(Variant_Test, Conversions) { bool v_3_uint_sml_to_int = false; - int val_int = v_3_uint_sml.to_int(&v_3_uint_sml_to_int); + int val_int = v_3_uint_sml.to_int(&v_3_uint_sml_to_int); EXPECT_TRUE(v_3_uint_sml_to_int); EXPECT_EQ(val_int, static_cast(val_3_uint_sml)); } { bool v_3_uint_sml_to_i64 = false; - int64_t val_i64 = v_3_uint_sml.to_int64(&v_3_uint_sml_to_i64); + int64_t val_i64 = v_3_uint_sml.to_int64(&v_3_uint_sml_to_i64); EXPECT_TRUE(v_3_uint_sml_to_i64); EXPECT_EQ(val_i64, static_cast(val_3_uint_sml)); } { bool v_3_uint_sml_to_uint = false; - uint64_t val_uint = v_3_uint_sml.to_uint(&v_3_uint_sml_to_uint); + uint64_t val_uint = v_3_uint_sml.to_uint(&v_3_uint_sml_to_uint); EXPECT_TRUE(v_3_uint_sml_to_uint); EXPECT_EQ(val_uint, val_3_uint_sml); } { bool v_3_uint_sml_to_bool = false; - bool val_bool = v_3_uint_sml.to_bool(&v_3_uint_sml_to_bool); + bool val_bool = v_3_uint_sml.to_bool(&v_3_uint_sml_to_bool); EXPECT_TRUE(v_3_uint_sml_to_bool); EXPECT_TRUE(val_bool); } @@ -157,32 +157,32 @@ TEST(Variant_Test, Conversions) } { bool v_4_uint_lrg_to_uint = false; - uint64_t val_uint = v_4_uint_lrg.to_uint(&v_4_uint_lrg_to_uint); + uint64_t val_uint = v_4_uint_lrg.to_uint(&v_4_uint_lrg_to_uint); EXPECT_TRUE(v_4_uint_lrg_to_uint); EXPECT_EQ(val_uint, val_4_uint_lrg); } { bool v_5_zero_to_int = false; - int val_int = v_5_int_zero.to_int(&v_5_zero_to_int); + int val_int = v_5_int_zero.to_int(&v_5_zero_to_int); EXPECT_TRUE(v_5_zero_to_int); EXPECT_EQ(val_int, val_5_zero); } { bool v_5_zero_to_i64 = false; - int64_t val_i64 = v_5_int_zero.to_int64(&v_5_zero_to_i64); + int64_t val_i64 = v_5_int_zero.to_int64(&v_5_zero_to_i64); EXPECT_TRUE(v_5_zero_to_i64); EXPECT_EQ(val_i64, static_cast(val_5_zero)); } { bool v_5_zero_to_uint = false; - uint64_t val_uint = v_5_int_zero.to_uint(&v_5_zero_to_uint); + uint64_t val_uint = v_5_int_zero.to_uint(&v_5_zero_to_uint); EXPECT_TRUE(v_5_zero_to_uint); EXPECT_EQ(val_uint, static_cast(val_5_zero)); } { bool v_5_zero_to_bool = false; - bool val_bool = v_5_int_zero.to_bool(&v_5_zero_to_bool); + bool val_bool = v_5_int_zero.to_bool(&v_5_zero_to_bool); EXPECT_TRUE(v_5_zero_to_bool); EXPECT_FALSE(val_bool); } @@ -192,15 +192,15 @@ TEST(Variant_Test, Conversions) TEST(Variant_Test, PackUnpack) { - int val_1_int = -27; + int val_1_int = -27; uint64_t val_2_uint = 0xFFFFFFFFAA; - const char* val_3_str = "My wonderful test string"; - double val_4_dbl = 42.42; + const char* val_3_str = "My wonderful test string"; + double val_4_dbl = 42.42; // const void* val_5_inv = NULL; cali_attr_type val_6_type = CALI_TYPE_ADDR; bool val_7_bool = true; - void* val_8_ptr = this; - int64_t val_9_i64 = -9876543210; + void* val_8_ptr = this; + int64_t val_9_i64 = -9876543210; cali::Variant v_1_int_in(val_1_int); cali::Variant v_2_uint_in(CALI_TYPE_UINT, &val_2_uint, sizeof(uint64_t)); @@ -230,7 +230,7 @@ TEST(Variant_Test, PackUnpack) EXPECT_LE(pos, 198); bool ok = false; - pos = 0; + pos = 0; Variant v_1_int_out = Variant::unpack(buf + pos, &pos, &ok); EXPECT_TRUE(ok && "v_1 unpack (int)"); diff --git a/src/common/util/demangle.cpp b/src/common/util/demangle.cpp index 6d523ea5..8864f63a 100644 --- a/src/common/util/demangle.cpp +++ b/src/common/util/demangle.cpp @@ -24,7 +24,7 @@ std::string demangle(const char* name) return result; char* demangled = nullptr; - int status = -1; + int status = -1; if (name[0] == '_' && name[1] == 'Z') demangled = abi::__cxa_demangle(name, nullptr, 0, &status); diff --git a/src/common/util/parse_util.cpp b/src/common/util/parse_util.cpp index 92a2652a..1ff9bb6d 100644 --- a/src/common/util/parse_util.cpp +++ b/src/common/util/parse_util.cpp @@ -49,7 +49,7 @@ std::string util::read_word(std::istream& is, const char* separators) std::string util::read_nested_text(std::istream& is, char start_char, char end_char) { std::string ret; - bool esc = false; + bool esc = false; int depth = 1; while (is.good()) { diff --git a/src/common/util/parse_util.h b/src/common/util/parse_util.h index b92f7d3a..1623f835 100644 --- a/src/common/util/parse_util.h +++ b/src/common/util/parse_util.h @@ -36,7 +36,7 @@ char read_char(std::istream& is); inline std::pair str_to_uint64(const char* str) { uint64_t ret = 0; - const char* p = str; + const char* p = str; for (; *p >= '0' && *p <= '9'; ++p) ret = ret * 10 + static_cast(*p - '0'); return std::make_pair(p != str, ret); diff --git a/src/common/util/unitfmt.c b/src/common/util/unitfmt.c index 2e257574..dfa929b6 100644 --- a/src/common/util/unitfmt.c +++ b/src/common/util/unitfmt.c @@ -39,11 +39,11 @@ const struct unitfmt_table unitfmt_bytes[] = { { 1, "Byte(s)" }, unitfmt_result unitfmt(unsigned long long val, const struct unitfmt_table table[]) { - double dval = (double) val; + double dval = (double) val; unitfmt_result result = { dval, table[0].symbol }; for (const struct unitfmt_table* p = table; p->factor && dval >= p->factor; ++p) { - result.val = dval / p->factor; + result.val = dval / p->factor; result.symbol = p->symbol; } diff --git a/src/common/util/vlenc.h b/src/common/util/vlenc.h index c87968f7..45b9e3c4 100644 --- a/src/common/util/vlenc.h +++ b/src/common/util/vlenc.h @@ -107,7 +107,7 @@ inline size_t vlenc_u64(uint64_t val, unsigned char* buf) inline uint64_t vldec_u64(const unsigned char* buf, size_t* inc) { uint64_t val = 0; - size_t p = 0; + size_t p = 0; for (; p < 9 && (buf[p] & 0x80); ++p) val |= ((uint64_t) (buf[p] & 0x7F) << (7 * p)); diff --git a/src/interface/c_fortran/BufferedRegionProfile.cpp b/src/interface/c_fortran/BufferedRegionProfile.cpp index 002b27fa..4a31e38d 100644 --- a/src/interface/c_fortran/BufferedRegionProfile.cpp +++ b/src/interface/c_fortran/BufferedRegionProfile.cpp @@ -31,7 +31,7 @@ void BufferedRegionProfile::clear() { mP->reg_times.clear(); mP->tot_reg_time = 0.0; - mP->tot_time = 0.0; + mP->tot_time = 0.0; RegionProfile::clear(); } diff --git a/src/interface/c_fortran/utilCaliper.cpp b/src/interface/c_fortran/utilCaliper.cpp index 952b4864..99417358 100644 --- a/src/interface/c_fortran/utilCaliper.cpp +++ b/src/interface/c_fortran/utilCaliper.cpp @@ -20,7 +20,7 @@ extern "C" void cali_ShroudCopyStringAndFree(cali_SHROUD_array* data, char* c_var, size_t c_var_len) { const char* cxx_var = data->addr.ccharp; - size_t n = c_var_len; + size_t n = c_var_len; if (data->elem_len < n) n = data->elem_len; std::strncpy(c_var, cxx_var, n); @@ -73,7 +73,7 @@ void cali_SHROUD_memory_destructor(cali_SHROUD_capsule_data* cap) break; } } - cap->addr = nullptr; + cap->addr = nullptr; cap->idtor = 0; // avoid deleting again } diff --git a/src/interface/c_fortran/wrapAnnotation.cpp b/src/interface/c_fortran/wrapAnnotation.cpp index b1181174..4c20e307 100644 --- a/src/interface/c_fortran/wrapAnnotation.cpp +++ b/src/interface/c_fortran/wrapAnnotation.cpp @@ -18,8 +18,8 @@ cali_Annotation* cali_Annotation_new(const char* key, cali_Annotation* SHC_rv) { // splicer begin class.Annotation.method.new cali::Annotation* SHCXX_rv = new cali::Annotation(key); - SHC_rv->addr = static_cast(SHCXX_rv); - SHC_rv->idtor = 2; + SHC_rv->addr = static_cast(SHCXX_rv); + SHC_rv->idtor = 2; return SHC_rv; // splicer end class.Annotation.method.new } @@ -28,8 +28,8 @@ cali_Annotation* cali_Annotation_new_with_properties(const char* key, int proper { // splicer begin class.Annotation.method.new_with_properties cali::Annotation* SHCXX_rv = new cali::Annotation(key, properties); - SHC_rv->addr = static_cast(SHCXX_rv); - SHC_rv->idtor = 2; + SHC_rv->addr = static_cast(SHCXX_rv); + SHC_rv->idtor = 2; return SHC_rv; // splicer end class.Annotation.method.new_with_properties } diff --git a/src/interface/c_fortran/wrapBufferedRegionProfile.cpp b/src/interface/c_fortran/wrapBufferedRegionProfile.cpp index 43b35d1c..275091ca 100644 --- a/src/interface/c_fortran/wrapBufferedRegionProfile.cpp +++ b/src/interface/c_fortran/wrapBufferedRegionProfile.cpp @@ -18,8 +18,8 @@ cali_BufferedRegionProfile* cali_BufferedRegionProfile_new(cali_BufferedRegionPr { // splicer begin class.BufferedRegionProfile.method.new cali::BufferedRegionProfile* SHCXX_rv = new cali::BufferedRegionProfile(); - SHC_rv->addr = static_cast(SHCXX_rv); - SHC_rv->idtor = 5; + SHC_rv->addr = static_cast(SHCXX_rv); + SHC_rv->idtor = 5; return SHC_rv; // splicer end class.BufferedRegionProfile.method.new } diff --git a/src/interface/c_fortran/wrapCaliper.h b/src/interface/c_fortran/wrapCaliper.h index 87a4d1c2..e3bf52ab 100644 --- a/src/interface/c_fortran/wrapCaliper.h +++ b/src/interface/c_fortran/wrapCaliper.h @@ -27,32 +27,32 @@ typedef uint64_t cali_cali_id_t; // cali::cali_attr_properties enum cali_cali_attr_properties { - cali_CALI_ATTR_DEFAULT = 0, - cali_CALI_ATTR_ASVALUE = 1, - cali_CALI_ATTR_NOMERGE = 2, + cali_CALI_ATTR_DEFAULT = 0, + cali_CALI_ATTR_ASVALUE = 1, + cali_CALI_ATTR_NOMERGE = 2, cali_CALI_ATTR_SCOPE_PROCESS = 12, - cali_CALI_ATTR_SCOPE_THREAD = 20, - cali_CALI_ATTR_SCOPE_TASK = 24, - cali_CALI_ATTR_SKIP_EVENTS = 64, - cali_CALI_ATTR_HIDDEN = 128, - cali_CALI_ATTR_NESTED = 256, - cali_CALI_ATTR_GLOBAL = 512, - cali_CALI_ATTR_UNALIGNED = 1024, - cali_CALI_ATTR_AGGREGATABLE = 2048 + cali_CALI_ATTR_SCOPE_THREAD = 20, + cali_CALI_ATTR_SCOPE_TASK = 24, + cali_CALI_ATTR_SKIP_EVENTS = 64, + cali_CALI_ATTR_HIDDEN = 128, + cali_CALI_ATTR_NESTED = 256, + cali_CALI_ATTR_GLOBAL = 512, + cali_CALI_ATTR_UNALIGNED = 1024, + cali_CALI_ATTR_AGGREGATABLE = 2048 }; // cali::cali_attr_type enum cali_cali_attr_type { - cali_CALI_TYPE_INV = 0, - cali_CALI_TYPE_USR = 1, - cali_CALI_TYPE_INT = 2, - cali_CALI_TYPE_UINT = 3, + cali_CALI_TYPE_INV = 0, + cali_CALI_TYPE_USR = 1, + cali_CALI_TYPE_INT = 2, + cali_CALI_TYPE_UINT = 3, cali_CALI_TYPE_STRING = 4, - cali_CALI_TYPE_ADDR = 5, + cali_CALI_TYPE_ADDR = 5, cali_CALI_TYPE_DOUBLE = 6, - cali_CALI_TYPE_BOOL = 7, - cali_CALI_TYPE_TYPE = 8, - cali_CALI_TYPE_PTR = 9 + cali_CALI_TYPE_BOOL = 7, + cali_CALI_TYPE_TYPE = 8, + cali_CALI_TYPE_PTR = 9 }; // cali::cali_flush_opts diff --git a/src/interface/c_fortran/wrapConfigManager.cpp b/src/interface/c_fortran/wrapConfigManager.cpp index a74743a0..81e670fc 100644 --- a/src/interface/c_fortran/wrapConfigManager.cpp +++ b/src/interface/c_fortran/wrapConfigManager.cpp @@ -18,14 +18,14 @@ extern "C" // CHARACTER(len=elem_size) src static void ShroudStrToArray(cali_SHROUD_array* array, const std::string* src, int idtor) { - array->cxx.addr = const_cast(src); + array->cxx.addr = const_cast(src); array->cxx.idtor = idtor; if (src->empty()) { array->addr.ccharp = NULL; - array->elem_len = 0; + array->elem_len = 0; } else { array->addr.ccharp = src->data(); - array->elem_len = src->length(); + array->elem_len = src->length(); } array->size = 1; array->rank = 0; // scalar @@ -38,8 +38,8 @@ cali_ConfigManager* cali_ConfigManager_new(cali_ConfigManager* SHC_rv) { // splicer begin class.ConfigManager.method.new cali::ConfigManager* SHCXX_rv = new cali::ConfigManager(); - SHC_rv->addr = static_cast(SHCXX_rv); - SHC_rv->idtor = 3; + SHC_rv->addr = static_cast(SHCXX_rv); + SHC_rv->idtor = 3; return SHC_rv; // splicer end class.ConfigManager.method.new } @@ -112,7 +112,7 @@ void cali_ConfigManager_error_msg_bufferify(cali_ConfigManager* self, cali_SHROU cali::ConfigManager* SH_this = static_cast(self->addr); // splicer begin class.ConfigManager.method.error_msg_bufferify std::string* SHCXX_rv = new std::string; - *SHCXX_rv = SH_this->error_msg(); + *SHCXX_rv = SH_this->error_msg(); ShroudStrToArray(SHT_rv_cdesc, SHCXX_rv, 4); // splicer end class.ConfigManager.method.error_msg_bufferify } diff --git a/src/interface/c_fortran/wrapScopeAnnotation.cpp b/src/interface/c_fortran/wrapScopeAnnotation.cpp index 159ee4b8..4871834b 100644 --- a/src/interface/c_fortran/wrapScopeAnnotation.cpp +++ b/src/interface/c_fortran/wrapScopeAnnotation.cpp @@ -18,8 +18,8 @@ cali_ScopeAnnotation* cali_ScopeAnnotation_begin(const char* name, cali_ScopeAnn { // splicer begin class.ScopeAnnotation.method.begin cali::ScopeAnnotation* SHCXX_rv = new cali::ScopeAnnotation(name); - SHC_rv->addr = static_cast(SHCXX_rv); - SHC_rv->idtor = 1; + SHC_rv->addr = static_cast(SHCXX_rv); + SHC_rv->idtor = 1; return SHC_rv; // splicer end class.ScopeAnnotation.method.begin } diff --git a/src/reader/Aggregator.cpp b/src/reader/Aggregator.cpp index c68dda2d..1ebc79cd 100644 --- a/src/reader/Aggregator.cpp +++ b/src/reader/Aggregator.cpp @@ -79,7 +79,7 @@ class AggregateKernel virtual void parent_aggregate(CaliperMetadataAccessInterface& db, const EntryList& list) { aggregate(db, list); } virtual void aggregate(CaliperMetadataAccessInterface& db, const EntryList& list) = 0; - virtual void append_result(CaliperMetadataAccessInterface& db, EntryList& list) = 0; + virtual void append_result(CaliperMetadataAccessInterface& db, EntryList& list) = 0; }; class AggregateKernelConfig @@ -406,7 +406,7 @@ class ScaledSumKernel : public AggregateKernel std::lock_guard g(m_lock); Attribute target_attr = m_config->get_target_attr(db); - Attribute sum_attr = m_config->get_sum_attr(db); + Attribute sum_attr = m_config->get_sum_attr(db); for (const Entry& e : list) { if (e.attribute() == target_attr.id() || e.attribute() == sum_attr.id()) { @@ -499,7 +499,7 @@ class MinKernel : public AggregateKernel std::lock_guard g(m_lock); Attribute target_attr = m_config->get_target_attr(db); - Attribute min_attr = m_config->get_min_attr(db); + Attribute min_attr = m_config->get_min_attr(db); if (!min_attr) return; @@ -587,7 +587,7 @@ class MaxKernel : public AggregateKernel std::lock_guard g(m_lock); Attribute target_attr = m_config->get_target_attr(db); - Attribute max_attr = m_config->get_max_attr(db); + Attribute max_attr = m_config->get_max_attr(db); if (!max_attr) return; @@ -893,7 +893,7 @@ class PercentTotalKernel : public AggregateKernel return false; if (m_percentage_attr) { percentage_attr = m_percentage_attr; - sum_attr = m_sum_attr; + sum_attr = m_sum_attr; return true; } @@ -910,7 +910,7 @@ class PercentTotalKernel : public AggregateKernel ); percentage_attr = m_percentage_attr; - sum_attr = m_sum_attr; + sum_attr = m_sum_attr; return true; } @@ -953,7 +953,7 @@ class PercentTotalKernel : public AggregateKernel return; cali_id_t target_id = target_attr.id(); - cali_id_t sum_id = sum_attr.id(); + cali_id_t sum_id = sum_attr.id(); for (const Entry& e : list) { cali_id_t id = e.attribute(); @@ -976,7 +976,7 @@ class PercentTotalKernel : public AggregateKernel return; cali_id_t target_id = target_attr.id(); - cali_id_t sum_id = sum_attr.id(); + cali_id_t sum_id = sum_attr.id(); for (const Entry& e : list) { cali_id_t id = e.attribute(); @@ -1216,30 +1216,30 @@ class VarianceKernel : public AggregateKernel }; enum KernelID { - Count = 0, - Sum = 1, - ScaledRatio = 2, - PercentTotal = 3, - InclusiveSum = 4, - Min = 5, - Max = 6, - Avg = 7, - ScaledSum = 8, - IScaledSum = 9, + Count = 0, + Sum = 1, + ScaledRatio = 2, + PercentTotal = 3, + InclusiveSum = 4, + Min = 5, + Max = 6, + Avg = 7, + ScaledSum = 8, + IScaledSum = 9, IPercentTotal = 10, - Any = 11, - ScaledCount = 12, - IRatio = 13, - IMin = 14, - IMax = 15, - Variance = 16 + Any = 11, + ScaledCount = 12, + IRatio = 13, + IMin = 14, + IMax = 15, + Variance = 16 }; #define MAX_KERNEL_ID Variance const char* kernel_args[] = { "attribute" }; const char* sratio_args[] = { "numerator", "denominator", "scale" }; -const char* scale_args[] = { "attribute", "scale" }; +const char* scale_args[] = { "attribute", "scale" }; const char* scount_args[] = { "scale" }; const QuerySpec::FunctionSignature kernel_signatures[] = { @@ -1325,7 +1325,7 @@ struct Aggregator::AggregatorImpl { m_kernel_configs.clear(); m_key_strings.clear(); - m_select_all = false; + m_select_all = false; m_select_nested = spec.groupby.use_path; switch (spec.groupby.selection) { @@ -1417,7 +1417,7 @@ struct Aggregator::AggregatorImpl { CaliperMetadataAccessInterface& db ) { - std::vector key = make_key(nodes_begin, nodes_end, immediates, db); + std::vector key = make_key(nodes_begin, nodes_end, immediates, db); std::size_t hash = hash_key(key) % m_hashmap.size(); { @@ -1440,8 +1440,8 @@ struct Aggregator::AggregatorImpl { auto e = std::make_shared(); - e->key = std::move(key); - e->kernels = std::move(kernels); + e->key = std::move(key); + e->kernels = std::move(kernels); e->next_entry_idx = m_hashmap[hash]; size_t idx = m_entries.size(); diff --git a/src/reader/CalQLParser.cpp b/src/reader/CalQLParser.cpp index f64fadaf..87c15eae 100644 --- a/src/reader/CalQLParser.cpp +++ b/src/reader/CalQLParser.cpp @@ -39,7 +39,7 @@ std::pair get_keyval(const std::string& str) std::istringstream is(str); std::string first = util::read_word(is, "="); - char c = util::read_char(is); + char c = util::read_char(is); if (c == '=') { std::string val = util::read_word(is); @@ -110,7 +110,7 @@ struct CalQLParser::CalQLParserImpl { void set_error(const std::string& s, std::istream& is) { - error = true; + error = true; error_pos = is.tellg(); error_msg = s; } @@ -133,7 +133,7 @@ struct CalQLParser::CalQLParserImpl { do { std::string str = util::read_word(is, ",;()\n"); - c = util::read_char(is); + c = util::read_char(is); if (!str.empty() && (c == ',' || c == ')')) ret.push_back(str); @@ -181,15 +181,15 @@ struct CalQLParser::CalQLParserImpl { void parse_aggregate(std::istream& is) { const QuerySpec::FunctionSignature* defs = Aggregator::aggregation_defs(); - char c = '\0'; + char c = '\0'; do { - std::string w = util::read_word(is, ",;=<>()\n"); + std::string w = util::read_word(is, ",;=<>()\n"); std::vector args = parse_arglist(is); // check if this is an aggregation function - int i = get_definition_id(w, defs); + int i = get_definition_id(w, defs); int argsize = static_cast(args.size()); if (i >= 0) { @@ -227,15 +227,15 @@ struct CalQLParser::CalQLParserImpl { return; } - std::vector args = parse_arglist(is); + std::vector args = parse_arglist(is); int argsize = static_cast(args.size()); if (defs[i].min_args > argsize || defs[i].max_args < argsize) set_error(std::string("Invalid number of arguments for formatter ") + fname, is); else { - spec.format.opt = QuerySpec::FormatSpec::User; + spec.format.opt = QuerySpec::FormatSpec::User; spec.format.formatter = defs[i]; - spec.format.kwargs = make_kwargs(defs[i], args, is); + spec.format.kwargs = make_kwargs(defs[i], args, is); } } @@ -268,7 +268,7 @@ struct CalQLParser::CalQLParserImpl { // | * const QuerySpec::FunctionSignature* defs = Aggregator::aggregation_defs(); - char c = '\0'; + char c = '\0'; std::string next_keyword; std::vector selection_list; @@ -294,7 +294,7 @@ struct CalQLParser::CalQLParserImpl { int i = get_definition_id(w, defs); if (i >= 0) { - std::vector args = parse_arglist(is); + std::vector args = parse_arglist(is); int argsize = static_cast(args.size()); if (defs[i].min_args > argsize || defs[i].max_args < argsize) { @@ -433,11 +433,11 @@ struct CalQLParser::CalQLParserImpl { if (wl == "not") { negate = true; - w = util::read_word(is, ",;=<>()\n"); + w = util::read_word(is, ",;=<>()\n"); } QuerySpec::Condition cond; - cond.op = QuerySpec::Condition::None; + cond.op = QuerySpec::Condition::None; cond.attr_name = w; if (w.empty()) { @@ -454,7 +454,7 @@ struct CalQLParser::CalQLParserImpl { if (w.empty()) set_error("Argument expected for '='", is); else { - cond.op = (negate ? QuerySpec::Condition::NotEqual : QuerySpec::Condition::Equal); + cond.op = (negate ? QuerySpec::Condition::NotEqual : QuerySpec::Condition::Equal); cond.value = w; } @@ -465,7 +465,7 @@ struct CalQLParser::CalQLParserImpl { if (w.empty()) set_error("Argument expected for '<'", is); else { - cond.op = (negate ? QuerySpec::Condition::GreaterOrEqual : QuerySpec::Condition::LessThan); + cond.op = (negate ? QuerySpec::Condition::GreaterOrEqual : QuerySpec::Condition::LessThan); cond.value = w; } @@ -476,7 +476,7 @@ struct CalQLParser::CalQLParserImpl { if (w.empty()) set_error("Argument expected for '>'", is); else { - cond.op = (negate ? QuerySpec::Condition::LessOrEqual : QuerySpec::Condition::GreaterThan); + cond.op = (negate ? QuerySpec::Condition::LessOrEqual : QuerySpec::Condition::GreaterThan); cond.value = w; } @@ -543,7 +543,7 @@ struct CalQLParser::CalQLParserImpl { return; } - std::vector args = parse_arglist(is); + std::vector args = parse_arglist(is); int argsize = static_cast(args.size()); if (defs[i].min_args > argsize || defs[i].max_args < argsize) @@ -557,7 +557,7 @@ struct CalQLParser::CalQLParserImpl { if (it == spec.preprocess_ops.end()) { pspec.target = target; - pspec.op = QuerySpec::AggregationOp(defs[i], args); + pspec.op = QuerySpec::AggregationOp(defs[i], args); } else { set_error(target + " defined twice", is); return; @@ -670,11 +670,11 @@ struct CalQLParser::CalQLParserImpl { CalQLParserImpl() : error(false), error_pos(std::istream::pos_type(-1)) { spec.aggregate.selection = QuerySpec::AggregationSelection::None; - spec.groupby.selection = QuerySpec::AttributeSelection::Default; - spec.select.selection = QuerySpec::AttributeSelection::Default; - spec.filter.selection = QuerySpec::FilterSelection::None; - spec.sort.selection = QuerySpec::SortSelection::None; - spec.format.opt = QuerySpec::FormatSpec::Default; + spec.groupby.selection = QuerySpec::AttributeSelection::Default; + spec.select.selection = QuerySpec::AttributeSelection::Default; + spec.filter.selection = QuerySpec::FilterSelection::None; + spec.sort.selection = QuerySpec::SortSelection::None; + spec.format.opt = QuerySpec::FormatSpec::Default; } }; diff --git a/src/reader/CaliReader.cpp b/src/reader/CaliReader.cpp index 21c414e9..340bc361 100644 --- a/src/reader/CaliReader.cpp +++ b/src/reader/CaliReader.cpp @@ -140,7 +140,7 @@ struct CaliReader::CaliReaderImpl { void set_error(const std::string& msg) { - m_error = true; + m_error = true; m_error_msg = msg; } @@ -300,7 +300,7 @@ void CaliReader::read( std::ifstream is(filename.c_str()); if (!is) { - mP->m_error = true; + mP->m_error = true; mP->m_error_msg = std::string("Cannot open file ") + filename; return; } diff --git a/src/reader/CaliperMetadataDB.cpp b/src/reader/CaliperMetadataDB.cpp index 90a362bf..0269c8fa 100644 --- a/src/reader/CaliperMetadataDB.cpp +++ b/src/reader/CaliperMetadataDB.cpp @@ -201,7 +201,7 @@ struct CaliperMetadataDB::CaliperMetadataDBImpl { parent = m_nodes[prnt_id]; } - Node* node = nullptr; + Node* node = nullptr; bool new_node = false; { @@ -211,7 +211,7 @@ struct CaliperMetadataDB::CaliperMetadataDBImpl { ; if (!node) { - node = create_node(attr_id, v_data, parent); + node = create_node(attr_id, v_data, parent); new_node = true; } } @@ -268,7 +268,7 @@ struct CaliperMetadataDB::CaliperMetadataDBImpl { return m_nodes[node->id()]; Node* attr_node = recursive_merge_node(db.node(node->attribute()), db); - Node* parent = recursive_merge_node(node->parent(), db); + Node* parent = recursive_merge_node(node->parent(), db); Variant v_data = node->data(); diff --git a/src/reader/FlatExclusiveRegionProfile.cpp b/src/reader/FlatExclusiveRegionProfile.cpp index 632e02fb..74e8b43b 100644 --- a/src/reader/FlatExclusiveRegionProfile.cpp +++ b/src/reader/FlatExclusiveRegionProfile.cpp @@ -11,7 +11,7 @@ using namespace cali; struct FlatExclusiveRegionProfile::FlatExclusiveRegionProfileImpl { - double total = 0.0; + double total = 0.0; double total_reg = 0.0; std::map reg_profile; diff --git a/src/reader/FlatInclusiveRegionProfile.cpp b/src/reader/FlatInclusiveRegionProfile.cpp index 96a819f7..6f124167 100644 --- a/src/reader/FlatInclusiveRegionProfile.cpp +++ b/src/reader/FlatInclusiveRegionProfile.cpp @@ -11,7 +11,7 @@ using namespace cali; struct FlatInclusiveRegionProfile::FlatInclusiveRegionProfileImpl { - double total = 0.0; + double total = 0.0; double total_reg = 0.0; std::map reg_profile; @@ -32,7 +32,7 @@ struct FlatInclusiveRegionProfile::FlatInclusiveRegionProfileImpl { double val = metric_entry_it->value().to_double(); total += val; - cali_id_t r_a_id = region_attr.id(); + cali_id_t r_a_id = region_attr.id(); bool have_reg_entry = false; for (const Entry& e : rec) { @@ -40,7 +40,7 @@ struct FlatInclusiveRegionProfile::FlatInclusiveRegionProfileImpl { continue; for (const Node* node = e.node(); node && node->attribute() != CALI_INV_ID; node = node->parent()) { - cali_id_t n_a_id = node->attribute(); + cali_id_t n_a_id = node->attribute(); bool is_target_reg = (r_a_id == CALI_INV_ID ? db.get_attribute(n_a_id).is_nested() : r_a_id == n_a_id); if (is_target_reg) { diff --git a/src/reader/FormatProcessor.cpp b/src/reader/FormatProcessor.cpp index 1b189686..ec751ff3 100644 --- a/src/reader/FormatProcessor.cpp +++ b/src/reader/FormatProcessor.cpp @@ -21,9 +21,9 @@ namespace { const char* format_kernel_args[] = { "format", "title" }; -const char* tree_kernel_args[] = { "path-attributes", "column-width", "print-globals" }; -const char* table_kernel_args[] = { "column-width", "print-globals" }; -const char* json_kernel_args[] = { "object", "pretty", "quote-all", "separate-nested", "records", "split" }; +const char* tree_kernel_args[] = { "path-attributes", "column-width", "print-globals" }; +const char* table_kernel_args[] = { "column-width", "print-globals" }; +const char* json_kernel_args[] = { "object", "pretty", "quote-all", "separate-nested", "records", "split" }; enum FormatterID { Cali = 0, Json = 1, Expand = 2, Format = 3, Table = 4, Tree = 5, JsonSplit = 6 }; diff --git a/src/reader/JsonFormatter.cpp b/src/reader/JsonFormatter.cpp index d5563a1e..a246808d 100644 --- a/src/reader/JsonFormatter.cpp +++ b/src/reader/JsonFormatter.cpp @@ -40,9 +40,9 @@ struct JsonFormatter::JsonFormatterImpl { Layout m_layout = Records; - bool m_opt_split = false; - bool m_opt_pretty = false; - bool m_opt_quote_all = false; + bool m_opt_split = false; + bool m_opt_pretty = false; + bool m_opt_quote_all = false; bool m_opt_sep_nested = false; std::map m_aliases; @@ -156,7 +156,7 @@ struct JsonFormatter::JsonFormatterImpl { } } else if (e.is_immediate()) { Attribute attr = db.get_attribute(e.attribute()); - std::string key = get_key(attr); + std::string key = get_key(attr); if (key.empty()) continue; diff --git a/src/reader/JsonSplitFormatter.cpp b/src/reader/JsonSplitFormatter.cpp index 66d42f9b..a4abfdae 100644 --- a/src/reader/JsonSplitFormatter.cpp +++ b/src/reader/JsonSplitFormatter.cpp @@ -102,7 +102,7 @@ class Hierarchy for (const Entry& e : vec) { HierarchyNode* parent = node; - std::string label = e.value().to_string(); + std::string label = e.value().to_string(); for (node = parent->first_child(); node && (label != node->label()); node = node->next_sibling()) ; @@ -170,7 +170,7 @@ struct JsonSplitFormatter::JsonSplitFormatterImpl { void configure(const QuerySpec& spec) { - m_select_all = false; + m_select_all = false; m_select_path = spec.select.use_path; m_attr_names.clear(); @@ -203,7 +203,7 @@ struct JsonSplitFormatter::JsonSplitFormatterImpl { { std::vector columns; - auto attrs = db.get_all_attributes(); + auto attrs = db.get_all_attributes(); auto attrs_rem = attrs.end(); if (m_select_all) { @@ -224,7 +224,7 @@ struct JsonSplitFormatter::JsonSplitFormatterImpl { // Create the "path" column for all attributes with NESTED flag Column path; - path.title = "path"; + path.title = "path"; path.is_hierarchy = true; for (const Attribute& a : attrs) { @@ -275,7 +275,7 @@ struct JsonSplitFormatter::JsonSplitFormatterImpl { void write_immediate_entry(std::ostream& os, const EntryList& list, const Attribute& attr) { - cali_attr_type type = attr.type(); + cali_attr_type type = attr.type(); bool quote = !(type == CALI_TYPE_INT || type == CALI_TYPE_UINT || type == CALI_TYPE_DOUBLE); for (const Entry& e : list) diff --git a/src/reader/NestedExclusiveRegionProfile.cpp b/src/reader/NestedExclusiveRegionProfile.cpp index 6625e7ba..e760ff6e 100644 --- a/src/reader/NestedExclusiveRegionProfile.cpp +++ b/src/reader/NestedExclusiveRegionProfile.cpp @@ -22,7 +22,7 @@ std::string get_path(CaliperMetadataAccessInterface& db, const Node* node, cali_ path = get_path(db, node->parent(), r_a_id); - cali_id_t n_a_id = node->attribute(); + cali_id_t n_a_id = node->attribute(); bool is_target_reg = (r_a_id == CALI_INV_ID ? db.get_attribute(n_a_id).is_nested() : r_a_id == n_a_id); if (is_target_reg) @@ -34,7 +34,7 @@ std::string get_path(CaliperMetadataAccessInterface& db, const Node* node, cali_ } // namespace struct NestedExclusiveRegionProfile::NestedExclusiveRegionProfileImpl { - double total = 0.0; + double total = 0.0; double total_reg = 0.0; std::map reg_profile; @@ -61,7 +61,7 @@ struct NestedExclusiveRegionProfile::NestedExclusiveRegionProfileImpl { if (!e.is_reference()) continue; - cali_id_t n_a_id = e.attribute(); + cali_id_t n_a_id = e.attribute(); bool is_target_reg = (r_a_id == CALI_INV_ID ? db.get_attribute(n_a_id).is_nested() : r_a_id == n_a_id); if (is_target_reg) { diff --git a/src/reader/NestedInclusiveRegionProfile.cpp b/src/reader/NestedInclusiveRegionProfile.cpp index 878a85fd..a557129a 100644 --- a/src/reader/NestedInclusiveRegionProfile.cpp +++ b/src/reader/NestedInclusiveRegionProfile.cpp @@ -28,7 +28,7 @@ std::string recursive_update( path = recursive_update(db, reg_profile, node->parent(), val, r_a_id); - cali_id_t n_a_id = node->attribute(); + cali_id_t n_a_id = node->attribute(); bool is_target_reg = (r_a_id == CALI_INV_ID ? db.get_attribute(n_a_id).is_nested() : r_a_id == n_a_id); if (is_target_reg) { @@ -42,7 +42,7 @@ std::string recursive_update( } // namespace struct NestedInclusiveRegionProfile::NestedInclusiveRegionProfileImpl { - double total = 0.0; + double total = 0.0; double total_reg = 0.0; std::map reg_profile; diff --git a/src/reader/Preprocessor.cpp b/src/reader/Preprocessor.cpp index 1ecefaf0..0d69c39a 100644 --- a/src/reader/Preprocessor.cpp +++ b/src/reader/Preprocessor.cpp @@ -334,9 +334,9 @@ class LeafKernel : public Kernel enum KernelID { ScaledRatio, Scale, Truncate, First, Sum, Leaf }; const char* sratio_args[] = { "numerator", "denominator", "scale" }; -const char* scale_args[] = { "attribute", "scale" }; -const char* first_args[] = { "attribute0", "attribute1", "attribute2", "attribute3", "attribute4", - "attribute5", "attribute6", "attribute7", "attribute8" }; +const char* scale_args[] = { "attribute", "scale" }; +const char* first_args[] = { "attribute0", "attribute1", "attribute2", "attribute3", "attribute4", + "attribute5", "attribute6", "attribute7", "attribute8" }; const QuerySpec::FunctionSignature kernel_signatures[] = { { KernelID::ScaledRatio, "ratio", 2, 3, sratio_args }, { KernelID::Scale, "scale", 2, 2, scale_args }, diff --git a/src/reader/RecordSelector.cpp b/src/reader/RecordSelector.cpp index e26bbbf8..85f27906 100644 --- a/src/reader/RecordSelector.cpp +++ b/src/reader/RecordSelector.cpp @@ -30,7 +30,7 @@ QuerySpec::Condition parse_clause(const std::string& str) if (str.empty()) return clause; - std::string::size_type spos = 0; + std::string::size_type spos = 0; bool negate = false; if (str[spos] == '-') { diff --git a/src/reader/TableFormatter.cpp b/src/reader/TableFormatter.cpp index 24788304..f63563b7 100644 --- a/src/reader/TableFormatter.cpp +++ b/src/reader/TableFormatter.cpp @@ -175,7 +175,7 @@ struct TableFormatter::TableImpl { if (!attr || attr.is_hidden() || attr.is_global()) return; - std::string name = attr.name(); + std::string name = attr.name(); std::string alias = name; { @@ -223,7 +223,7 @@ struct TableFormatter::TableImpl { std::vector cols = update_columns(db, list); std::vector row(cols.size()); - bool active = false; + bool active = false; bool update_max_width = false; for (std::vector::size_type c = 0; c < cols.size(); ++c) { @@ -257,7 +257,7 @@ struct TableFormatter::TableImpl { size_t width = val.length(); if (width > cols[c].width) { - cols[c].width = width; + cols[c].width = width; update_max_width = true; } } @@ -326,9 +326,9 @@ struct TableFormatter::TableImpl { if (!m_cols[c].print) continue; - int width = column_width(m_cols[c].width); - std::string str = util::clamp_string(row[c], width); - cali_attr_type t = m_cols[c].attr.type(); + int width = column_width(m_cols[c].width); + std::string str = util::clamp_string(row[c], width); + cali_attr_type t = m_cols[c].attr.type(); bool align_right = (t == CALI_TYPE_INT || t == CALI_TYPE_UINT || t == CALI_TYPE_DOUBLE); if (align_right) diff --git a/src/reader/TreeFormatter.cpp b/src/reader/TreeFormatter.cpp index b0ffcdbd..a6209649 100644 --- a/src/reader/TreeFormatter.cpp +++ b/src/reader/TreeFormatter.cpp @@ -161,7 +161,7 @@ struct TreeFormatter::TreeFormatterImpl { for (auto& data : node->records()) { for (auto& entry : data) { int len = entry.second.to_string().size(); - auto it = m_column_info.find(entry.first); + auto it = m_column_info.find(entry.first); if (it == m_column_info.end()) { std::string name = entry.first.name(); diff --git a/src/reader/UserFormatter.cpp b/src/reader/UserFormatter.cpp index ee507c93..3859c183 100644 --- a/src/reader/UserFormatter.cpp +++ b/src/reader/UserFormatter.cpp @@ -69,8 +69,8 @@ struct UserFormatter::FormatImpl { // look for width/alignment specification (in [] brackets) int wfbegin = -1; - int wfend = -1; - int apos = -1; + int wfend = -1; + int apos = -1; int nfields = field_strings.size(); @@ -144,7 +144,7 @@ struct UserFormatter::FormatImpl { " "; size_t len = str.size(); - size_t w = len < f.width ? std::min(f.width - len, 80) : 0; + size_t w = len < f.width ? std::min(f.width - len, 80) : 0; os << f.prefix << str << (w > 0 ? whitespace + (80 - w) : ""); } diff --git a/src/reader/test/test_aggregator.cpp b/src/reader/test/test_aggregator.cpp index be99e41b..65f14657 100644 --- a/src/reader/test/test_aggregator.cpp +++ b/src/reader/test/test_aggregator.cpp @@ -61,8 +61,8 @@ TEST(AggregatorTest, DefaultKeyCountOpSpec) // create some context attributes - Attribute ctx1 = db.create_attribute("ctx.1", CALI_TYPE_STRING, CALI_ATTR_DEFAULT); - Attribute ctx2 = db.create_attribute("ctx.2", CALI_TYPE_INT, CALI_ATTR_DEFAULT); + Attribute ctx1 = db.create_attribute("ctx.1", CALI_TYPE_STRING, CALI_ATTR_DEFAULT); + Attribute ctx2 = db.create_attribute("ctx.2", CALI_TYPE_INT, CALI_ATTR_DEFAULT); Attribute val_attr = db.create_attribute("val", CALI_TYPE_INT, CALI_ATTR_ASVALUE); // make some nodes @@ -100,7 +100,7 @@ TEST(AggregatorTest, DefaultKeyCountOpSpec) cali_id_t node_ctx1 = 102; cali_id_t node_ctx2 = 101; - cali_id_t val_id = val_attr.id(); + cali_id_t val_id = val_attr.id(); a.add(db, db.merge_snapshot(1, &node_ctx1, 1, &val_id, &v_val, idmap)); a.add(db, db.merge_snapshot(1, &node_ctx1, 0, nullptr, nullptr, idmap)); @@ -156,8 +156,8 @@ TEST(AggregatorTest, DefaultKeySumOpSpec) // create some context attributes - Attribute ctx1 = db.create_attribute("ctx.1", CALI_TYPE_STRING, CALI_ATTR_DEFAULT); - Attribute ctx2 = db.create_attribute("ctx.2", CALI_TYPE_INT, CALI_ATTR_DEFAULT); + Attribute ctx1 = db.create_attribute("ctx.1", CALI_TYPE_STRING, CALI_ATTR_DEFAULT); + Attribute ctx2 = db.create_attribute("ctx.2", CALI_TYPE_INT, CALI_ATTR_DEFAULT); Attribute val_attr = db.create_attribute("val", CALI_TYPE_INT, CALI_ATTR_ASVALUE); // make some nodes @@ -201,7 +201,7 @@ TEST(AggregatorTest, DefaultKeySumOpSpec) cali_id_t node_ctx1 = 102; cali_id_t node_ctx2 = 101; - cali_id_t val_id = val_attr.id(); + cali_id_t val_id = val_attr.id(); a.add(db, db.merge_snapshot(1, &node_ctx1, 1, &val_id, &v_val, idmap)); a.add(db, db.merge_snapshot(1, &node_ctx1, 0, nullptr, nullptr, idmap)); @@ -216,7 +216,7 @@ TEST(AggregatorTest, DefaultKeySumOpSpec) a.flush(db, [&resdb](CaliperMetadataAccessInterface&, const EntryList& list) { resdb.push_back(list); }); Attribute count_attr = db.get_attribute("count"); - Attribute sum_attr = db.get_attribute("sum#val"); + Attribute sum_attr = db.get_attribute("sum#val"); ASSERT_TRUE(count_attr); ASSERT_TRUE(sum_attr); @@ -231,7 +231,7 @@ TEST(AggregatorTest, DefaultKeySumOpSpec) auto dict = make_dict_from_entrylist(list); int aggr = dict[count_attr.id()].value().to_int(); - int val = dict[sum_attr.id()].value().to_int(); + int val = dict[sum_attr.id()].value().to_int(); if (dict[ctx1.id()].value() == Variant("inner")) { EXPECT_EQ(aggr, 3); @@ -264,8 +264,8 @@ TEST(AggregatorTest, SingleKeySumOpSpec) // create some context attributes - Attribute ctx1 = db.create_attribute("ctx.1", CALI_TYPE_STRING, CALI_ATTR_DEFAULT); - Attribute ctx2 = db.create_attribute("ctx.2", CALI_TYPE_INT, CALI_ATTR_DEFAULT); + Attribute ctx1 = db.create_attribute("ctx.1", CALI_TYPE_STRING, CALI_ATTR_DEFAULT); + Attribute ctx2 = db.create_attribute("ctx.2", CALI_TYPE_INT, CALI_ATTR_DEFAULT); Attribute val_attr = db.create_attribute("val", CALI_TYPE_INT, CALI_ATTR_ASVALUE); // make some nodes @@ -309,7 +309,7 @@ TEST(AggregatorTest, SingleKeySumOpSpec) cali_id_t node_ctx1 = 102; cali_id_t node_ctx2 = 101; cali_id_t node_ctx3 = 100; - cali_id_t val_id = val_attr.id(); + cali_id_t val_id = val_attr.id(); a.add(db, db.merge_snapshot(1, &node_ctx1, 1, &val_id, &v_val, idmap)); a.add(db, db.merge_snapshot(1, &node_ctx1, 0, nullptr, nullptr, idmap)); @@ -326,7 +326,7 @@ TEST(AggregatorTest, SingleKeySumOpSpec) a.flush(db, [&resdb](CaliperMetadataAccessInterface&, const EntryList& list) { resdb.push_back(list); }); Attribute count_attr = db.get_attribute("count"); - Attribute sum_attr = db.get_attribute("sum#val"); + Attribute sum_attr = db.get_attribute("sum#val"); ASSERT_TRUE(count_attr); @@ -340,7 +340,7 @@ TEST(AggregatorTest, SingleKeySumOpSpec) auto dict = make_dict_from_entrylist(list); int count = dict[count_attr.id()].value().to_int(); - int val = dict[sum_attr.id()].value().to_int(); + int val = dict[sum_attr.id()].value().to_int(); if (dict[ctx2.id()].value() == Variant(42)) { EXPECT_EQ(count, 5); @@ -368,8 +368,8 @@ TEST(AggregatorTest, InclusiveSumOp) // create some context attributes - Attribute ctx1 = db.create_attribute("ictx.1", CALI_TYPE_STRING, CALI_ATTR_NESTED); - Attribute ctx2 = db.create_attribute("ictx.2", CALI_TYPE_INT, CALI_ATTR_DEFAULT); + Attribute ctx1 = db.create_attribute("ictx.1", CALI_TYPE_STRING, CALI_ATTR_NESTED); + Attribute ctx2 = db.create_attribute("ictx.2", CALI_TYPE_INT, CALI_ATTR_DEFAULT); Attribute val_attr = db.create_attribute("val", CALI_TYPE_INT, CALI_ATTR_ASVALUE); // make some nodes @@ -413,7 +413,7 @@ TEST(AggregatorTest, InclusiveSumOp) cali_id_t node_ctx1 = 101; cali_id_t node_ctx2 = 100; - cali_id_t val_id = val_attr.id(); + cali_id_t val_id = val_attr.id(); a.add(db, db.merge_snapshot(1, &node_ctx1, 1, &val_id, &v_val, idmap)); a.add(db, db.merge_snapshot(1, &node_ctx1, 0, nullptr, nullptr, idmap)); @@ -427,9 +427,9 @@ TEST(AggregatorTest, InclusiveSumOp) a.flush(db, [&resdb](CaliperMetadataAccessInterface&, const EntryList& list) { resdb.push_back(list); }); - Attribute count_attr = db.get_attribute("count"); - Attribute sum_attr = db.get_attribute("sum#val"); - Attribute isum_attr = db.get_attribute("inclusive#val"); + Attribute count_attr = db.get_attribute("count"); + Attribute sum_attr = db.get_attribute("sum#val"); + Attribute isum_attr = db.get_attribute("inclusive#val"); Attribute iscale_attr = db.get_attribute("iscale#val"); ASSERT_TRUE(count_attr); @@ -446,9 +446,9 @@ TEST(AggregatorTest, InclusiveSumOp) std::for_each(resdb.begin(), resdb.end(), [&](const EntryList& list) { auto dict = make_dict_from_entrylist(list); - int count = dict[count_attr.id()].value().to_int(); - int val = dict[sum_attr.id()].value().to_int(); - int ival = dict[isum_attr.id()].value().to_int(); + int count = dict[count_attr.id()].value().to_int(); + int val = dict[sum_attr.id()].value().to_int(); + int ival = dict[isum_attr.id()].value().to_int(); int iscval = dict[iscale_attr.id()].value().to_int(); if (dict[ctx1.id()].value() == Variant("inner")) { @@ -479,7 +479,7 @@ TEST(AggregatorTest, InclusiveRatio) // create some context attributes - Attribute ctx = db.create_attribute("ctx", CALI_TYPE_STRING, CALI_ATTR_NESTED); + Attribute ctx = db.create_attribute("ctx", CALI_TYPE_STRING, CALI_ATTR_NESTED); Attribute num_attr = db.create_attribute("num", CALI_TYPE_INT, CALI_ATTR_ASVALUE); Attribute den_attr = db.create_attribute("den", CALI_TYPE_INT, CALI_ATTR_ASVALUE); @@ -513,9 +513,9 @@ TEST(AggregatorTest, InclusiveRatio) // add some entries - cali_id_t node_inner = 101; - cali_id_t node_outer = 100; - cali_id_t attr[2] = { num_attr.id(), den_attr.id() }; + cali_id_t node_inner = 101; + cali_id_t node_outer = 100; + cali_id_t attr[2] = { num_attr.id(), den_attr.id() }; Variant data_inner[2] = { Variant(10), Variant(10) }; Variant data_outer[2] = { Variant(10), Variant(5) }; @@ -569,8 +569,8 @@ TEST(AggregatorTest, NoneKeySumOpSpec) // create some context attributes - Attribute ctx1 = db.create_attribute("ctx.1", CALI_TYPE_STRING, CALI_ATTR_DEFAULT); - Attribute ctx2 = db.create_attribute("ctx.2", CALI_TYPE_INT, CALI_ATTR_DEFAULT); + Attribute ctx1 = db.create_attribute("ctx.1", CALI_TYPE_STRING, CALI_ATTR_DEFAULT); + Attribute ctx2 = db.create_attribute("ctx.2", CALI_TYPE_INT, CALI_ATTR_DEFAULT); Attribute val_attr = db.create_attribute("val", CALI_TYPE_INT, CALI_ATTR_ASVALUE); // make some nodes @@ -613,7 +613,7 @@ TEST(AggregatorTest, NoneKeySumOpSpec) cali_id_t node_ctx1 = 102; cali_id_t node_ctx2 = 101; cali_id_t node_ctx3 = 100; - cali_id_t val_id = val_attr.id(); + cali_id_t val_id = val_attr.id(); a.add(db, db.merge_snapshot(1, &node_ctx1, 1, &val_id, &v_val, idmap)); a.add(db, db.merge_snapshot(1, &node_ctx1, 0, nullptr, nullptr, idmap)); @@ -630,7 +630,7 @@ TEST(AggregatorTest, NoneKeySumOpSpec) a.flush(db, [&resdb](CaliperMetadataAccessInterface&, const EntryList& list) { resdb.push_back(list); }); Attribute count_attr = db.get_attribute("count"); - Attribute sum_attr = db.get_attribute("sum#val"); + Attribute sum_attr = db.get_attribute("sum#val"); ASSERT_TRUE(count_attr); ASSERT_TRUE(sum_attr); @@ -642,7 +642,7 @@ TEST(AggregatorTest, NoneKeySumOpSpec) auto dict = make_dict_from_entrylist(resdb.front()); int count = dict[count_attr.id()].value().to_int(); - int val = dict[sum_attr.id()].value().to_int(); + int val = dict[sum_attr.id()].value().to_int(); EXPECT_EQ(count, 9); EXPECT_EQ(val, 35); @@ -655,7 +655,7 @@ TEST(AggregatorTest, StatisticsKernels) // create some context attributes - Attribute ctx = db.create_attribute("ctx", CALI_TYPE_STRING, CALI_ATTR_DEFAULT); + Attribute ctx = db.create_attribute("ctx", CALI_TYPE_STRING, CALI_ATTR_DEFAULT); Attribute val_attr = db.create_attribute("val", CALI_TYPE_INT, CALI_ATTR_ASVALUE); // make some nodes @@ -689,8 +689,8 @@ TEST(AggregatorTest, StatisticsKernels) Aggregator a(spec), b(spec); Variant v_ints[4] = { Variant(-4), Variant(9), Variant(25), Variant(36) }; - cali_id_t node_id = 101; - cali_id_t val_id = val_attr.id(); + cali_id_t node_id = 101; + cali_id_t val_id = val_attr.id(); a.add(db, db.merge_snapshot(1, &node_id, 1, &val_id, &v_ints[0], idmap)); a.add(db, db.merge_snapshot(1, &node_id, 1, &val_id, &v_ints[1], idmap)); @@ -745,7 +745,7 @@ TEST(AggregatorTest, ScaledRatioKernel) Aggregator a(spec); Variant v_ints[4] = { Variant(10), Variant(20), Variant(74), Variant(22) }; - cali_id_t attrs[2] = { x_attr.id(), y_attr.id() }; + cali_id_t attrs[2] = { x_attr.id(), y_attr.id() }; a.add(db, db.merge_snapshot(0, nullptr, 2, attrs, v_ints + 0, idmap)); a.add(db, db.merge_snapshot(0, nullptr, 2, attrs, v_ints + 2, idmap)); @@ -782,7 +782,7 @@ TEST(AggregatorTest, ScaledSumKernel) Aggregator a(spec); Variant v_ints[2] = { Variant(10), Variant(20) }; - cali_id_t attr_id = x_attr.id(); + cali_id_t attr_id = x_attr.id(); a.add(db, db.merge_snapshot(0, nullptr, 1, &attr_id, v_ints + 0, idmap)); a.add(db, db.merge_snapshot(0, nullptr, 1, &attr_id, v_ints + 1, idmap)); @@ -819,7 +819,7 @@ TEST(AggregatorTest, ScaledCountKernel) Aggregator a(spec); Variant v_ints[2] = { Variant(10), Variant(20) }; - cali_id_t attr_id = x_attr.id(); + cali_id_t attr_id = x_attr.id(); a.add(db, db.merge_snapshot(0, nullptr, 1, &attr_id, v_ints + 0, idmap)); a.add(db, db.merge_snapshot(0, nullptr, 1, &attr_id, v_ints + 1, idmap)); @@ -856,7 +856,7 @@ TEST(AggregatorTest, AnyKernel) Aggregator a(spec); Variant v_ints[2] = { Variant(42), Variant(42) }; - cali_id_t attr_id = x_attr.id(); + cali_id_t attr_id = x_attr.id(); a.add(db, db.merge_snapshot(0, nullptr, 1, &attr_id, v_ints + 0, idmap)); a.add(db, db.merge_snapshot(0, nullptr, 1, &attr_id, v_ints + 1, idmap)); @@ -883,7 +883,7 @@ TEST(AggregatorTest, PercentTotalKernel) // create some context attributes - Attribute ctx = db.create_attribute("ctx", CALI_TYPE_INT, CALI_ATTR_NESTED); + Attribute ctx = db.create_attribute("ctx", CALI_TYPE_INT, CALI_ATTR_NESTED); Attribute val_attr = db.create_attribute("val", CALI_TYPE_INT, CALI_ATTR_ASVALUE); // make some nodes @@ -917,9 +917,9 @@ TEST(AggregatorTest, PercentTotalKernel) Aggregator a(spec), b(spec); Variant v_ints[4] = { Variant(4), Variant(24), Variant(16), Variant(36) }; - cali_id_t nodea_id = 101; - cali_id_t nodeb_id = 102; - cali_id_t val_id = val_attr.id(); + cali_id_t nodea_id = 101; + cali_id_t nodeb_id = 102; + cali_id_t val_id = val_attr.id(); a.add(db, db.merge_snapshot(1, &nodea_id, 1, &val_id, &v_ints[0], idmap)); a.add(db, db.merge_snapshot(1, &nodeb_id, 1, &val_id, &v_ints[1], idmap)); @@ -930,7 +930,7 @@ TEST(AggregatorTest, PercentTotalKernel) // merge b into a b.flush(db, a); - Attribute attr_pct = db.get_attribute("percent_total#val"); + Attribute attr_pct = db.get_attribute("percent_total#val"); Attribute attr_ipct = db.get_attribute("ipercent_total#val"); ASSERT_TRUE(attr_pct); diff --git a/src/reader/test/test_calireader.cpp b/src/reader/test/test_calireader.cpp index b23fa32f..a8c84a47 100644 --- a/src/reader/test/test_calireader.cpp +++ b/src/reader/test/test_calireader.cpp @@ -54,7 +54,7 @@ TEST(CaliReader, BasicRead) std::istringstream is(cali_txt); unsigned node_count = 0; - unsigned rec_count = 0; + unsigned rec_count = 0; NodeProcessFn node_proc = [&node_count](CaliperMetadataAccessInterface&, const Node*) { ++node_count; diff --git a/src/reader/test/test_filter.cpp b/src/reader/test/test_filter.cpp index 505d9c54..ff4382b9 100644 --- a/src/reader/test/test_filter.cpp +++ b/src/reader/test/test_filter.cpp @@ -51,9 +51,9 @@ TEST(RecordFilterTest, TestExist) // create some context attributes - Attribute ctx1 = db.create_attribute("ctx.1", CALI_TYPE_STRING, CALI_ATTR_DEFAULT); - Attribute ctx2 = db.create_attribute("ctx.2", CALI_TYPE_INT, CALI_ATTR_DEFAULT); - Attribute ctx3 = db.create_attribute("ctx.3", CALI_TYPE_INT, CALI_ATTR_DEFAULT); + Attribute ctx1 = db.create_attribute("ctx.1", CALI_TYPE_STRING, CALI_ATTR_DEFAULT); + Attribute ctx2 = db.create_attribute("ctx.2", CALI_TYPE_INT, CALI_ATTR_DEFAULT); + Attribute ctx3 = db.create_attribute("ctx.3", CALI_TYPE_INT, CALI_ATTR_DEFAULT); Attribute val_attr = db.create_attribute("val", CALI_TYPE_INT, CALI_ATTR_ASVALUE); // make some nodes @@ -74,7 +74,7 @@ TEST(RecordFilterTest, TestExist) cali_id_t node_ctx1 = 100; cali_id_t node_ctx2 = 102; - cali_id_t attr_id = val_attr.id(); + cali_id_t attr_id = val_attr.id(); std::vector in; @@ -217,8 +217,8 @@ TEST(RecordFilterTest, TestEqual) // create some context attributes - Attribute ctx1 = db.create_attribute("ctx.1", CALI_TYPE_STRING, CALI_ATTR_DEFAULT); - Attribute ctx2 = db.create_attribute("ctx.2", CALI_TYPE_INT, CALI_ATTR_DEFAULT); + Attribute ctx1 = db.create_attribute("ctx.1", CALI_TYPE_STRING, CALI_ATTR_DEFAULT); + Attribute ctx2 = db.create_attribute("ctx.2", CALI_TYPE_INT, CALI_ATTR_DEFAULT); Attribute val_attr = db.create_attribute("val", CALI_TYPE_INT, CALI_ATTR_ASVALUE); // make some nodes @@ -239,7 +239,7 @@ TEST(RecordFilterTest, TestEqual) cali_id_t node_ctx1 = 100; cali_id_t node_ctx2 = 102; - cali_id_t attr_id = val_attr.id(); + cali_id_t attr_id = val_attr.id(); std::vector in; @@ -365,8 +365,8 @@ TEST(RecordFilterTest, TestLess) // create some context attributes - Attribute ctx1 = db.create_attribute("ctx.1", CALI_TYPE_STRING, CALI_ATTR_DEFAULT); - Attribute ctx2 = db.create_attribute("ctx.2", CALI_TYPE_INT, CALI_ATTR_DEFAULT); + Attribute ctx1 = db.create_attribute("ctx.1", CALI_TYPE_STRING, CALI_ATTR_DEFAULT); + Attribute ctx2 = db.create_attribute("ctx.2", CALI_TYPE_INT, CALI_ATTR_DEFAULT); Attribute val_attr = db.create_attribute("val", CALI_TYPE_INT, CALI_ATTR_ASVALUE); // make some nodes @@ -388,7 +388,7 @@ TEST(RecordFilterTest, TestLess) cali_id_t node_ctx1 = 100; cali_id_t node_ctx2 = 102; - cali_id_t attr_id = val_attr.id(); + cali_id_t attr_id = val_attr.id(); std::vector in; @@ -473,8 +473,8 @@ TEST(RecordFilterTest, TestGreater) // create some context attributes - Attribute ctx1 = db.create_attribute("ctx.1", CALI_TYPE_STRING, CALI_ATTR_DEFAULT); - Attribute ctx2 = db.create_attribute("ctx.2", CALI_TYPE_INT, CALI_ATTR_DEFAULT); + Attribute ctx1 = db.create_attribute("ctx.1", CALI_TYPE_STRING, CALI_ATTR_DEFAULT); + Attribute ctx2 = db.create_attribute("ctx.2", CALI_TYPE_INT, CALI_ATTR_DEFAULT); Attribute val_attr = db.create_attribute("val", CALI_TYPE_INT, CALI_ATTR_ASVALUE); // make some nodes @@ -496,7 +496,7 @@ TEST(RecordFilterTest, TestGreater) cali_id_t node_ctx1 = 100; cali_id_t node_ctx2 = 102; - cali_id_t attr_id = val_attr.id(); + cali_id_t attr_id = val_attr.id(); std::vector in; diff --git a/src/reader/test/test_flatexclusiveregionprofile.cpp b/src/reader/test/test_flatexclusiveregionprofile.cpp index 90d0c1ac..7439e0c8 100644 --- a/src/reader/test/test_flatexclusiveregionprofile.cpp +++ b/src/reader/test/test_flatexclusiveregionprofile.cpp @@ -13,9 +13,9 @@ TEST(FlatExclusiveRegionProfileTest, NestedRegion) CaliperMetadataDB db; Attribute metric_attr = db.create_attribute("metric.attr", CALI_TYPE_INT, CALI_ATTR_ASVALUE); - Attribute reg_a_attr = db.create_attribute("reg_a", CALI_TYPE_STRING, CALI_ATTR_NESTED); - Attribute reg_b_attr = db.create_attribute("reg_b", CALI_TYPE_STRING, CALI_ATTR_NESTED); - Attribute reg_c_attr = db.create_attribute("reg_c", CALI_TYPE_STRING, CALI_ATTR_DEFAULT); + Attribute reg_a_attr = db.create_attribute("reg_a", CALI_TYPE_STRING, CALI_ATTR_NESTED); + Attribute reg_b_attr = db.create_attribute("reg_b", CALI_TYPE_STRING, CALI_ATTR_NESTED); + Attribute reg_c_attr = db.create_attribute("reg_c", CALI_TYPE_STRING, CALI_ATTR_DEFAULT); IdMap idmap; @@ -33,7 +33,7 @@ TEST(FlatExclusiveRegionProfileTest, NestedRegion) std::map reg_profile; double total_reg = 0.0; - double total = 0.0; + double total = 0.0; std::tie(reg_profile, total_reg, total) = rp.result(); @@ -51,9 +51,9 @@ TEST(FlatExclusiveRegionProfileTest, GivenRegion) CaliperMetadataDB db; Attribute metric_attr = db.create_attribute("metric.attr", CALI_TYPE_INT, CALI_ATTR_ASVALUE); - Attribute reg_a_attr = db.create_attribute("reg_a", CALI_TYPE_STRING, CALI_ATTR_NESTED); - Attribute reg_b_attr = db.create_attribute("reg_b", CALI_TYPE_STRING, CALI_ATTR_NESTED); - Attribute reg_c_attr = db.create_attribute("reg_c", CALI_TYPE_STRING, CALI_ATTR_DEFAULT); + Attribute reg_a_attr = db.create_attribute("reg_a", CALI_TYPE_STRING, CALI_ATTR_NESTED); + Attribute reg_b_attr = db.create_attribute("reg_b", CALI_TYPE_STRING, CALI_ATTR_NESTED); + Attribute reg_c_attr = db.create_attribute("reg_c", CALI_TYPE_STRING, CALI_ATTR_DEFAULT); IdMap idmap; @@ -71,7 +71,7 @@ TEST(FlatExclusiveRegionProfileTest, GivenRegion) std::map reg_profile; double total_reg = 0.0; - double total = 0.0; + double total = 0.0; std::tie(reg_profile, total_reg, total) = rp.result(); diff --git a/src/reader/test/test_flatinclusiveregionprofile.cpp b/src/reader/test/test_flatinclusiveregionprofile.cpp index b8ea08f8..3a3209eb 100644 --- a/src/reader/test/test_flatinclusiveregionprofile.cpp +++ b/src/reader/test/test_flatinclusiveregionprofile.cpp @@ -13,9 +13,9 @@ TEST(FlatInclusiveRegionProfileTest, NestedRegion) CaliperMetadataDB db; Attribute metric_attr = db.create_attribute("metric.attr", CALI_TYPE_INT, CALI_ATTR_ASVALUE); - Attribute reg_a_attr = db.create_attribute("reg_a", CALI_TYPE_STRING, CALI_ATTR_NESTED); - Attribute reg_b_attr = db.create_attribute("reg_b", CALI_TYPE_STRING, CALI_ATTR_NESTED); - Attribute reg_c_attr = db.create_attribute("reg_c", CALI_TYPE_STRING, CALI_ATTR_DEFAULT); + Attribute reg_a_attr = db.create_attribute("reg_a", CALI_TYPE_STRING, CALI_ATTR_NESTED); + Attribute reg_b_attr = db.create_attribute("reg_b", CALI_TYPE_STRING, CALI_ATTR_NESTED); + Attribute reg_c_attr = db.create_attribute("reg_c", CALI_TYPE_STRING, CALI_ATTR_DEFAULT); IdMap idmap; @@ -33,7 +33,7 @@ TEST(FlatInclusiveRegionProfileTest, NestedRegion) std::map reg_profile; double total_reg = 0.0; - double total = 0.0; + double total = 0.0; std::tie(reg_profile, total_reg, total) = rp.result(); @@ -51,9 +51,9 @@ TEST(FlatInclusiveRegionProfileTest, GivenRegion) CaliperMetadataDB db; Attribute metric_attr = db.create_attribute("metric.attr", CALI_TYPE_INT, CALI_ATTR_ASVALUE); - Attribute reg_a_attr = db.create_attribute("reg_a", CALI_TYPE_STRING, CALI_ATTR_NESTED); - Attribute reg_b_attr = db.create_attribute("reg_b", CALI_TYPE_STRING, CALI_ATTR_NESTED); - Attribute reg_c_attr = db.create_attribute("reg_c", CALI_TYPE_STRING, CALI_ATTR_DEFAULT); + Attribute reg_a_attr = db.create_attribute("reg_a", CALI_TYPE_STRING, CALI_ATTR_NESTED); + Attribute reg_b_attr = db.create_attribute("reg_b", CALI_TYPE_STRING, CALI_ATTR_NESTED); + Attribute reg_c_attr = db.create_attribute("reg_c", CALI_TYPE_STRING, CALI_ATTR_DEFAULT); IdMap idmap; @@ -71,7 +71,7 @@ TEST(FlatInclusiveRegionProfileTest, GivenRegion) std::map reg_profile; double total_reg = 0.0; - double total = 0.0; + double total = 0.0; std::tie(reg_profile, total_reg, total) = rp.result(); diff --git a/src/reader/test/test_metadb.cpp b/src/reader/test/test_metadb.cpp index 7ad09726..7ceb1767 100644 --- a/src/reader/test/test_metadb.cpp +++ b/src/reader/test/test_metadb.cpp @@ -79,7 +79,7 @@ TEST(MetaDBTest, SetGlobal) Attribute g_str_attr = db.create_attribute("global.str", CALI_TYPE_STRING, CALI_ATTR_GLOBAL); Attribute g_int_attr = db.create_attribute("global.int", CALI_TYPE_INT, CALI_ATTR_GLOBAL); Attribute g_val_attr = db.create_attribute("global.val", CALI_TYPE_INT, CALI_ATTR_GLOBAL | CALI_ATTR_ASVALUE); - Attribute no_g_attr = db.create_attribute("noglobal", CALI_TYPE_INT, CALI_ATTR_DEFAULT); + Attribute no_g_attr = db.create_attribute("noglobal", CALI_TYPE_INT, CALI_ATTR_DEFAULT); Variant v_str_a(CALI_TYPE_STRING, "a", 1); Variant v_str_b(CALI_TYPE_STRING, "b", 1); @@ -155,7 +155,7 @@ TEST(MetadataDBTest, AliasesAndUnits) CaliperMetadataDB db; std::map aliases = { std::make_pair("x.attr", "x alias") }; - std::map units = { std::make_pair("x.attr", "x unit") }; + std::map units = { std::make_pair("x.attr", "x unit") }; db.add_attribute_aliases(aliases); db.add_attribute_units(units); @@ -163,7 +163,7 @@ TEST(MetadataDBTest, AliasesAndUnits) Attribute attr = db.create_attribute("x.attr", CALI_TYPE_INT, CALI_ATTR_DEFAULT); Attribute alias_attr = db.get_attribute("attribute.alias"); - Attribute unit_attr = db.get_attribute("attribute.unit"); + Attribute unit_attr = db.get_attribute("attribute.unit"); EXPECT_EQ(attr.get(alias_attr).to_string(), "x alias"); EXPECT_EQ(attr.get(unit_attr).to_string(), "x unit"); diff --git a/src/reader/test/test_nestedexclusiveregionprofile.cpp b/src/reader/test/test_nestedexclusiveregionprofile.cpp index 9f75433c..55f6e5de 100644 --- a/src/reader/test/test_nestedexclusiveregionprofile.cpp +++ b/src/reader/test/test_nestedexclusiveregionprofile.cpp @@ -13,9 +13,9 @@ TEST(NestedExclusiveRegionProfileTest, NestedRegion) CaliperMetadataDB db; Attribute metric_attr = db.create_attribute("metric.attr", CALI_TYPE_INT, CALI_ATTR_ASVALUE); - Attribute reg_a_attr = db.create_attribute("reg_a", CALI_TYPE_STRING, CALI_ATTR_NESTED); - Attribute reg_b_attr = db.create_attribute("reg_b", CALI_TYPE_STRING, CALI_ATTR_NESTED); - Attribute reg_c_attr = db.create_attribute("reg_c", CALI_TYPE_STRING, CALI_ATTR_DEFAULT); + Attribute reg_a_attr = db.create_attribute("reg_a", CALI_TYPE_STRING, CALI_ATTR_NESTED); + Attribute reg_b_attr = db.create_attribute("reg_b", CALI_TYPE_STRING, CALI_ATTR_NESTED); + Attribute reg_c_attr = db.create_attribute("reg_c", CALI_TYPE_STRING, CALI_ATTR_DEFAULT); IdMap idmap; @@ -35,7 +35,7 @@ TEST(NestedExclusiveRegionProfileTest, NestedRegion) std::map reg_profile; double total_reg = 0.0; - double total = 0.0; + double total = 0.0; std::tie(reg_profile, total_reg, total) = rp.result(); @@ -54,9 +54,9 @@ TEST(NestedExclusiveRegionProfileTest, GivenRegion) CaliperMetadataDB db; Attribute metric_attr = db.create_attribute("metric.attr", CALI_TYPE_INT, CALI_ATTR_ASVALUE); - Attribute reg_a_attr = db.create_attribute("reg_a", CALI_TYPE_STRING, CALI_ATTR_NESTED); - Attribute reg_b_attr = db.create_attribute("reg_b", CALI_TYPE_STRING, CALI_ATTR_NESTED); - Attribute reg_c_attr = db.create_attribute("reg_c", CALI_TYPE_STRING, CALI_ATTR_DEFAULT); + Attribute reg_a_attr = db.create_attribute("reg_a", CALI_TYPE_STRING, CALI_ATTR_NESTED); + Attribute reg_b_attr = db.create_attribute("reg_b", CALI_TYPE_STRING, CALI_ATTR_NESTED); + Attribute reg_c_attr = db.create_attribute("reg_c", CALI_TYPE_STRING, CALI_ATTR_DEFAULT); IdMap idmap; @@ -74,7 +74,7 @@ TEST(NestedExclusiveRegionProfileTest, GivenRegion) std::map reg_profile; double total_reg = 0.0; - double total = 0.0; + double total = 0.0; std::tie(reg_profile, total_reg, total) = rp.result(); diff --git a/src/reader/test/test_nestedinclusiveregionprofile.cpp b/src/reader/test/test_nestedinclusiveregionprofile.cpp index d19d4513..81701d5e 100644 --- a/src/reader/test/test_nestedinclusiveregionprofile.cpp +++ b/src/reader/test/test_nestedinclusiveregionprofile.cpp @@ -13,9 +13,9 @@ TEST(NestedInclusiveRegionProfileTest, NestedRegion) CaliperMetadataDB db; Attribute metric_attr = db.create_attribute("metric.attr", CALI_TYPE_INT, CALI_ATTR_ASVALUE); - Attribute reg_a_attr = db.create_attribute("reg_a", CALI_TYPE_STRING, CALI_ATTR_NESTED); - Attribute reg_b_attr = db.create_attribute("reg_b", CALI_TYPE_STRING, CALI_ATTR_NESTED); - Attribute reg_c_attr = db.create_attribute("reg_c", CALI_TYPE_STRING, CALI_ATTR_DEFAULT); + Attribute reg_a_attr = db.create_attribute("reg_a", CALI_TYPE_STRING, CALI_ATTR_NESTED); + Attribute reg_b_attr = db.create_attribute("reg_b", CALI_TYPE_STRING, CALI_ATTR_NESTED); + Attribute reg_c_attr = db.create_attribute("reg_c", CALI_TYPE_STRING, CALI_ATTR_DEFAULT); IdMap idmap; @@ -35,7 +35,7 @@ TEST(NestedInclusiveRegionProfileTest, NestedRegion) std::map reg_profile; double total_reg = 0.0; - double total = 0.0; + double total = 0.0; std::tie(reg_profile, total_reg, total) = rp.result(); @@ -54,9 +54,9 @@ TEST(NestedInclusiveRegionProfileTest, GivenRegion) CaliperMetadataDB db; Attribute metric_attr = db.create_attribute("metric.attr", CALI_TYPE_INT, CALI_ATTR_ASVALUE); - Attribute reg_a_attr = db.create_attribute("reg_a", CALI_TYPE_STRING, CALI_ATTR_NESTED); - Attribute reg_b_attr = db.create_attribute("reg_b", CALI_TYPE_STRING, CALI_ATTR_NESTED); - Attribute reg_c_attr = db.create_attribute("reg_c", CALI_TYPE_STRING, CALI_ATTR_DEFAULT); + Attribute reg_a_attr = db.create_attribute("reg_a", CALI_TYPE_STRING, CALI_ATTR_NESTED); + Attribute reg_b_attr = db.create_attribute("reg_b", CALI_TYPE_STRING, CALI_ATTR_NESTED); + Attribute reg_c_attr = db.create_attribute("reg_c", CALI_TYPE_STRING, CALI_ATTR_DEFAULT); IdMap idmap; @@ -74,7 +74,7 @@ TEST(NestedInclusiveRegionProfileTest, GivenRegion) std::map reg_profile; double total_reg = 0.0; - double total = 0.0; + double total = 0.0; std::tie(reg_profile, total_reg, total) = rp.result(); diff --git a/src/reader/test/test_preprocessor.cpp b/src/reader/test/test_preprocessor.cpp index 4a9376be..bd6e107e 100644 --- a/src/reader/test/test_preprocessor.cpp +++ b/src/reader/test/test_preprocessor.cpp @@ -42,8 +42,8 @@ QuerySpec::PreprocessSpec make_spec(const std::string& target, const QuerySpec:: { QuerySpec::PreprocessSpec spec; - spec.target = target; - spec.op = op; + spec.target = target; + spec.op = op; spec.cond.op = QuerySpec::Condition::None; return spec; @@ -59,8 +59,8 @@ QuerySpec::PreprocessSpec make_spec_with_cond( { QuerySpec::PreprocessSpec spec; - spec.target = target; - spec.op = op; + spec.target = target; + spec.op = op; spec.cond.op = cond; if (cond_attr) spec.cond.attr_name = cond_attr; @@ -121,7 +121,7 @@ TEST(PreprocessorTest, Ratio) EXPECT_EQ(d_attr.type(), CALI_TYPE_DOUBLE); EXPECT_TRUE(d_attr.store_as_value()); - auto res = ::make_dict_from_entrylist(out); + auto res = ::make_dict_from_entrylist(out); auto d_it = res.find(d_attr.id()); auto s_it = res.find(s_attr.id()); @@ -171,7 +171,7 @@ TEST(PreprocessorTest, Scale) EXPECT_EQ(d_attr.type(), CALI_TYPE_DOUBLE); EXPECT_TRUE(d_attr.store_as_value()); - auto res = ::make_dict_from_entrylist(out); + auto res = ::make_dict_from_entrylist(out); auto d_it = res.find(d_attr.id()); auto h_it = res.find(h_attr.id()); @@ -221,7 +221,7 @@ TEST(PreprocessorTest, First) EXPECT_EQ(vao_attr.type(), CALI_TYPE_INT); EXPECT_EQ(vbo_attr.type(), CALI_TYPE_INT); - auto res = ::make_dict_from_entrylist(out); + auto res = ::make_dict_from_entrylist(out); auto a_it = res.find(vao_attr.id()); auto b_it = res.find(vbo_attr.id()); @@ -261,7 +261,7 @@ TEST(PreprocessorTest, Truncate) Preprocessor pp(spec); EntryList out = pp.process(db, rec); - Attribute v_attr = db.get_attribute("val"); + Attribute v_attr = db.get_attribute("val"); Attribute t6_attr = db.get_attribute("valt6"); Attribute td_attr = db.get_attribute("valtd"); @@ -271,7 +271,7 @@ TEST(PreprocessorTest, Truncate) EXPECT_EQ(td_attr.type(), CALI_TYPE_DOUBLE); EXPECT_TRUE(td_attr.store_as_value()); - auto res = ::make_dict_from_entrylist(out); + auto res = ::make_dict_from_entrylist(out); auto t6_it = res.find(t6_attr.id()); auto td_it = res.find(td_attr.id()); @@ -321,7 +321,7 @@ TEST(PreprocessorTest, Chain) EXPECT_EQ(d_attr.type(), CALI_TYPE_DOUBLE); EXPECT_TRUE(d_attr.store_as_value()); - auto res = ::make_dict_from_entrylist(out); + auto res = ::make_dict_from_entrylist(out); auto d_it = res.find(d_attr.id()); auto t_it = res.find(t_attr.id()); @@ -374,7 +374,7 @@ TEST(PreprocessorTest, Conditions) EXPECT_FALSE(vbo_attr); EXPECT_EQ(vao_attr.type(), CALI_TYPE_INT); - auto res = ::make_dict_from_entrylist(out); + auto res = ::make_dict_from_entrylist(out); auto a_it = res.find(vao_attr.id()); ASSERT_NE(a_it, res.end()) << "val.a.out attribute not found\n"; @@ -417,7 +417,7 @@ TEST(PreprocessorTest, SumKernel) EXPECT_EQ(vao_attr.type(), CALI_TYPE_INT); EXPECT_EQ(vso_attr.type(), CALI_TYPE_INT); - auto res = ::make_dict_from_entrylist(out); + auto res = ::make_dict_from_entrylist(out); auto a_it = res.find(vao_attr.id()); auto s_it = res.find(vso_attr.id()); diff --git a/src/services/Services.cpp b/src/services/Services.cpp index eef8dd29..1f73fe88 100644 --- a/src/services/Services.cpp +++ b/src/services/Services.cpp @@ -28,7 +28,7 @@ namespace std::string get_name_from_spec(const char* name_or_spec) { // try to parse the given string as spec, otherwise return it as-is - bool ok = false; + bool ok = false; auto dict = StringConverter(name_or_spec).rec_dict(&ok); if (!ok) @@ -80,7 +80,7 @@ class ServicesManager auto service_itr = m_services.find(name); if (service_itr == m_services.end()) return std::string(); - auto dict = StringConverter(service_itr->second.name_or_spec).rec_dict(); + auto dict = StringConverter(service_itr->second.name_or_spec).rec_dict(); auto spec_itr = dict.find("description"); return spec_itr != dict.end() ? spec_itr->second.to_string() : std::string(); } @@ -91,7 +91,7 @@ class ServicesManager if (service_itr == m_services.end()) return os; - auto dict = StringConverter(service_itr->second.name_or_spec).rec_dict(); + auto dict = StringConverter(service_itr->second.name_or_spec).rec_dict(); auto spec_itr = dict.find("description"); if (spec_itr != dict.end()) os << ' ' << spec_itr->second.to_string() << '\n'; @@ -106,7 +106,7 @@ class ServicesManager auto list = spec_itr->second.rec_list(); for (const auto& s : list) { auto cfg_dict = s.rec_dict(); - auto it = cfg_dict.find("name"); + auto it = cfg_dict.find("name"); if (it == cfg_dict.end()) continue; @@ -198,7 +198,7 @@ ConfigSet init_config_from_spec(RuntimeConfig config, const char* spec) { RuntimeConfig::config_entry_list_t list; - auto dict = StringConverter(spec).rec_dict(); + auto dict = StringConverter(spec).rec_dict(); auto spec_itr = dict.find("config"); if (spec_itr != dict.end()) { for (const auto& e : spec_itr->second.rec_list()) { diff --git a/src/services/adiak/test/test_adiak.cpp b/src/services/adiak/test/test_adiak.cpp index 7e5b9a0c..5e572fd0 100644 --- a/src/services/adiak/test/test_adiak.cpp +++ b/src/services/adiak/test/test_adiak.cpp @@ -128,8 +128,8 @@ TEST(AdiakServiceTest, AdiakImportCategoryFilter) chn.events().pre_flush_evt(&c, &chn, SnapshotView()); - Attribute do_import_attr_1 = c.get_attribute("do.import.1"); - Attribute do_import_attr_2 = c.get_attribute("do.import.2"); + Attribute do_import_attr_1 = c.get_attribute("do.import.1"); + Attribute do_import_attr_2 = c.get_attribute("do.import.2"); Attribute do_not_import_attr = c.get_attribute("do.not.import"); EXPECT_EQ(do_import_attr_1.type(), CALI_TYPE_INT); diff --git a/src/services/aggregate/Aggregate.cpp b/src/services/aggregate/Aggregate.cpp index 3497e403..82631a87 100644 --- a/src/services/aggregate/Aggregate.cpp +++ b/src/services/aggregate/Aggregate.cpp @@ -99,7 +99,7 @@ class Aggregate tdb_list->prev = tdb; tdb->next = tdb_list; - tdb_list = tdb; + tdb_list = tdb; } return tdb; @@ -152,7 +152,7 @@ class Aggregate const int prop = CALI_ATTR_ASVALUE | CALI_ATTR_SCOPE_THREAD | CALI_ATTR_SKIP_EVENTS; info.count_attr = c->create_attribute("count", CALI_TYPE_UINT, prop); - info.slot_attr = c->create_attribute("aggregate.slot", CALI_TYPE_UINT, prop); + info.slot_attr = c->create_attribute("aggregate.slot", CALI_TYPE_UINT, prop); } void flush_cb(Caliper* c, Channel* chn, SnapshotFlushFn proc_fn) @@ -186,11 +186,11 @@ class Aggregate tdb = tdb_list; } - size_t num_entries = 0; - size_t num_kernels = 0; + size_t num_entries = 0; + size_t num_kernels = 0; size_t bytes_reserved = 0; - size_t num_dropped = 0; - size_t max_hash_len = 0; + size_t num_dropped = 0; + size_t max_hash_len = 0; while (tdb) { tdb->stopped.store(true); @@ -355,7 +355,7 @@ class Aggregate tdb_lock.unlock(); info.implicit_grouping = true; - info.group_nested = false; + info.group_nested = false; key_attribute_names = config.get("key").to_stringlist(","); apply_key_config(); diff --git a/src/services/aggregate/AggregationDB.cpp b/src/services/aggregate/AggregationDB.cpp index 3f653f6a..3b5cb855 100644 --- a/src/services/aggregate/AggregationDB.cpp +++ b/src/services/aggregate/AggregationDB.cpp @@ -73,7 +73,7 @@ struct AggregateKernel { histogram[0] += histogram[ii]; } for (int ii = shift + 1; ii < CALI_AGG_HISTOGRAM_BINS; ii++) { - int jj = ii - shift; + int jj = ii - shift; histogram[jj] = histogram[ii]; } for (int jj = CALI_AGG_HISTOGRAM_BINS - shift; jj < CALI_AGG_HISTOGRAM_BINS; jj++) { @@ -123,7 +123,7 @@ struct AggregationDB::AggregationDBImpl { continue; cali_id_t attr_id = attr.id(); - size_t count = 0; + size_t count = 0; for (const Node* node = e.node(); node; node = node->parent()) if (node->attribute() == attr_id) @@ -149,9 +149,9 @@ struct AggregationDB::AggregationDBImpl { AggregateEntry* find_or_create_entry(SnapshotView key, std::size_t hash, std::size_t num_aggr_attrs, bool can_alloc) { - hash = hash % m_hashmap.size(); + hash = hash % m_hashmap.size(); size_t key_len = key.size(); - size_t count = 0; + size_t count = 0; for (std::size_t idx = m_hashmap[hash]; idx != 0; idx = m_entries[idx].next_entry_idx) { AggregateEntry* e = &m_entries[idx]; @@ -180,11 +180,11 @@ struct AggregationDB::AggregationDBImpl { AggregateEntry e; - e.count = 0; - e.key_idx = key_idx; - e.key_len = key_len; - e.kernels_idx = kernels_idx; - e.num_kernels = num_aggr_attrs; + e.count = 0; + e.key_idx = key_idx; + e.key_len = key_len; + e.kernels_idx = kernels_idx; + e.num_kernels = num_aggr_attrs; e.next_entry_idx = m_hashmap[hash]; size_t entry_idx = m_entries.size(); @@ -328,11 +328,11 @@ struct AggregationDB::AggregationDBImpl { AggregateEntry e; - e.count = 0; - e.key_idx = 0; - e.key_len = 1; - e.kernels_idx = 0; - e.num_kernels = 0; + e.count = 0; + e.key_idx = 0; + e.key_len = 1; + e.kernels_idx = 0; + e.num_kernels = 0; e.next_entry_idx = 0; m_entries.push_back(e); diff --git a/src/services/alloc/AllocService.cpp b/src/services/alloc/AllocService.cpp index e06c5090..3058c7f1 100644 --- a/src/services/alloc/AllocService.cpp +++ b/src/services/alloc/AllocService.cpp @@ -184,9 +184,9 @@ class AllocService info.start_addr = reinterpret_cast(ptr); info.total_size = total_size; - info.v_uid = Variant(cali_make_variant_from_uint(++g_alloc_uid)); - info.elem_size = elem_size; - info.num_elems = total_size / elem_size; + info.v_uid = Variant(cali_make_variant_from_uint(++g_alloc_uid)); + info.elem_size = elem_size; + info.num_elems = total_size / elem_size; Variant v_label(label); @@ -196,7 +196,7 @@ class AllocService root_node = c->make_tree_entry(extra_attrs[i], extra_vals[i], root_node); info.alloc_label_node = c->make_tree_entry(mem_alloc_attr, v_label, root_node); - info.free_label_node = c->make_tree_entry(mem_free_attr, v_label, root_node); + info.free_label_node = c->make_tree_entry(mem_free_attr, v_label, root_node); std::fill_n(info.addr_label_nodes, MAX_ADDRESS_ATTRIBUTES, nullptr); @@ -219,7 +219,7 @@ class AllocService std::lock_guard g(g_hwm_lock); g_active_mem += total_size; - g_hwm = std::max(g_hwm, g_active_mem); + g_hwm = std::max(g_hwm, g_active_mem); g_region_hwm = std::max(g_region_hwm, g_active_mem); } @@ -314,7 +314,7 @@ class AllocService { std::lock_guard g(g_hwm_lock); - hwm = g_region_hwm; + hwm = g_region_hwm; g_region_hwm = g_active_mem; } @@ -454,9 +454,9 @@ class AllocService ConfigSet config = services::init_config_from_spec(chn->config(), s_spec); - g_resolve_addresses = config.get("resolve_addresses").to_bool(); - g_track_allocations = config.get("track_allocations").to_bool(); - g_record_active_mem = config.get("record_active_mem").to_bool(); + g_resolve_addresses = config.get("resolve_addresses").to_bool(); + g_track_allocations = config.get("track_allocations").to_bool(); + g_record_active_mem = config.get("record_active_mem").to_bool(); g_record_highwatermark = config.get("record_highwatermark").to_bool(); } diff --git a/src/services/alloc/SplayTree.hpp b/src/services/alloc/SplayTree.hpp index 556f8d33..248a9ec5 100644 --- a/src/services/alloc/SplayTree.hpp +++ b/src/services/alloc/SplayTree.hpp @@ -71,38 +71,38 @@ class SplayTree void rotate_left(STNode* node) { if (node->left) { - node->left->parent = node->parent; + node->left->parent = node->parent; node->left->handedness = RIGHT; } - STNode* npp = node->parent->parent; + STNode* npp = node->parent->parent; HAND np_hand = node->parent->handedness; - node->parent->parent = node; + node->parent->parent = node; node->parent->handedness = LEFT; - node->parent->right = node->left; + node->parent->right = node->left; - node->left = node->parent; - node->parent = npp; + node->left = node->parent; + node->parent = npp; node->handedness = (npp ? np_hand : NA); } void rotate_right(STNode* node) { if (node->right) { - node->right->parent = node->parent; + node->right->parent = node->parent; node->right->handedness = LEFT; } - STNode* npp = node->parent->parent; + STNode* npp = node->parent->parent; HAND np_hand = node->parent->handedness; - node->parent->parent = node; + node->parent->parent = node; node->parent->handedness = RIGHT; - node->parent->left = node->right; + node->parent->left = node->right; - node->right = node->parent; - node->parent = npp; + node->right = node->parent; + node->parent = npp; node->handedness = (npp ? np_hand : NA); } @@ -168,17 +168,17 @@ class SplayTree SplayTree ltree(node->left); if (ltree) { - ltree.m_root->parent = nullptr; + ltree.m_root->parent = nullptr; ltree.m_root->handedness = NA; - STNode* lMax = ltree.m_root->findMax(); + STNode* lMax = ltree.m_root->findMax(); ltree.splay(lMax); - m_root = lMax; + m_root = lMax; m_root->right = node->right; if (m_root->right) m_root->right->parent = m_root; } else if (node->right) { - m_root = node->right; - m_root->parent = nullptr; + m_root = node->right; + m_root->parent = nullptr; m_root->handedness = NA; } else { m_root = nullptr; diff --git a/src/services/callpath/Callpath.cpp b/src/services/callpath/Callpath.cpp index f6cc78d9..a6cb21b5 100644 --- a/src/services/callpath/Callpath.cpp +++ b/src/services/callpath/Callpath.cpp @@ -104,7 +104,7 @@ class Callpath // store path from top to bottom if (use_addr) { - uint64_t uint = ip; + uint64_t uint = ip; v_addr[MAX_PATH - (n + 1)] = Variant(CALI_TYPE_ADDR, &uint, sizeof(uint64_t)); } if (use_name) { @@ -138,7 +138,7 @@ class Callpath char* debuginfopath = nullptr; Dwfl_Callbacks callbacks; - callbacks.find_elf = dwfl_linux_proc_find_elf; + callbacks.find_elf = dwfl_linux_proc_find_elf; callbacks.find_debuginfo = dwfl_standard_find_debuginfo; callbacks.debuginfo_path = &debuginfopath; @@ -162,14 +162,14 @@ class Callpath unw_word_t ip; unw_get_reg(&unw_cursor, UNW_REG_IP, &ip); - Dwfl_Module* mod = dwfl_addrmodule(dwfl, ip); + Dwfl_Module* mod = dwfl_addrmodule(dwfl, ip); Dwarf_Addr start = 0; - Dwarf_Addr end = 0; + Dwarf_Addr end = 0; dwfl_module_info(mod, nullptr, &start, &end, nullptr, nullptr, nullptr, nullptr); caliper_start_addr = start; - caliper_end_addr = end; + caliper_end_addr = end; if (Log::verbosity() >= 2) { std::ostringstream os; @@ -188,9 +188,9 @@ class Callpath { ConfigSet config = services::init_config_from_spec(chn->config(), s_spec); - use_name = config.get("use_name").to_bool(); - use_addr = config.get("use_address").to_bool(); - skip_frames = config.get("skip_frames").to_uint(); + use_name = config.get("use_name").to_bool(); + use_addr = config.get("use_address").to_bool(); + skip_frames = config.get("skip_frames").to_uint(); skip_internal = config.get("skip_internal").to_bool(); Attribute symbol_class_attr = c->get_attribute("class.symboladdress"); diff --git a/src/services/cupti/Cupti.cpp b/src/services/cupti/Cupti.cpp index 34ff7238..1e88c02d 100644 --- a/src/services/cupti/Cupti.cpp +++ b/src/services/cupti/Cupti.cpp @@ -97,8 +97,8 @@ class CuptiService void handle_stream_event(CUcontext context, CUstream stream, const Attribute& name_attr, const Variant& v_name) { uint32_t context_id = 0; - uint32_t stream_id = 0; - uint32_t device_id = 0; + uint32_t stream_id = 0; + uint32_t device_id = 0; if (cuptiGetDeviceId(context, &device_id) != CUPTI_SUCCESS) return; @@ -124,7 +124,7 @@ class CuptiService void handle_context_event(CUcontext context, const Attribute& name_attr, const Variant& v_name) { uint32_t context_id = 0; - uint32_t device_id = 0; + uint32_t device_id = 0; if (cuptiGetDeviceId(context, &device_id) != CUPTI_SUCCESS) return; @@ -338,14 +338,14 @@ class CuptiService cupti_info.driver_attr = c->create_attribute("cupti.driverAPI", CALI_TYPE_STRING, CALI_ATTR_NESTED, 1, &subs_attr, &v_true); cupti_info.resource_attr = c->create_attribute("cupti.resource", CALI_TYPE_STRING, CALI_ATTR_SKIP_EVENTS); - cupti_info.sync_attr = c->create_attribute("cupti.sync", CALI_TYPE_STRING, CALI_ATTR_SKIP_EVENTS); + cupti_info.sync_attr = c->create_attribute("cupti.sync", CALI_TYPE_STRING, CALI_ATTR_SKIP_EVENTS); cupti_info.nvtx_range_attr = c->create_attribute("nvtx.range", CALI_TYPE_STRING, CALI_ATTR_NESTED, 1, &subs_attr, &v_true); cupti_info.context_attr = c->create_attribute("cupti.contextID", CALI_TYPE_UINT, CALI_ATTR_SKIP_EVENTS); - cupti_info.symbol_attr = c->create_attribute("cupti.symbolName", CALI_TYPE_STRING, CALI_ATTR_SKIP_EVENTS); - cupti_info.device_attr = c->create_attribute("cupti.deviceID", CALI_TYPE_UINT, CALI_ATTR_SKIP_EVENTS); - cupti_info.stream_attr = c->create_attribute("cupti.streamID", CALI_TYPE_UINT, CALI_ATTR_SKIP_EVENTS); + cupti_info.symbol_attr = c->create_attribute("cupti.symbolName", CALI_TYPE_STRING, CALI_ATTR_SKIP_EVENTS); + cupti_info.device_attr = c->create_attribute("cupti.deviceID", CALI_TYPE_UINT, CALI_ATTR_SKIP_EVENTS); + cupti_info.stream_attr = c->create_attribute("cupti.streamID", CALI_TYPE_UINT, CALI_ATTR_SKIP_EVENTS); } bool register_callback_domains() diff --git a/src/services/cupti/CuptiEventSampling.h b/src/services/cupti/CuptiEventSampling.h index 50176fb9..b67a8418 100644 --- a/src/services/cupti/CuptiEventSampling.h +++ b/src/services/cupti/CuptiEventSampling.h @@ -39,7 +39,7 @@ class EventSampling Attribute m_event_attr; unsigned m_num_snapshots = 0; - unsigned m_num_reads = 0; + unsigned m_num_reads = 0; bool m_enabled = false; diff --git a/src/services/cupti/CuptiTrace.cpp b/src/services/cupti/CuptiTrace.cpp index a1f09739..7383f429 100644 --- a/src/services/cupti/CuptiTrace.cpp +++ b/src/services/cupti/CuptiTrace.cpp @@ -79,27 +79,27 @@ class CuptiTraceService std::map device_info_map; - size_t buffer_size = 1 * 1024 * 1024; + size_t buffer_size = 1 * 1024 * 1024; size_t buffer_size_used = 0; ActivityBuffer* retired_buffers_list = nullptr; std::mutex retired_buffers_list_lock; - unsigned num_buffers_empty = 0; + unsigned num_buffers_empty = 0; unsigned num_buffers_allocated = 0; unsigned num_buffers_completed = 0; - unsigned num_dropped_records = 0; + unsigned num_dropped_records = 0; unsigned num_correlation_recs = 0; - unsigned num_device_recs = 0; - unsigned num_kernel_recs = 0; - unsigned num_driver_recs = 0; - unsigned num_memcpy_recs = 0; - unsigned num_runtime_recs = 0; - unsigned num_uvm_recs = 0; - unsigned num_unknown_recs = 0; - - unsigned num_correlations_found = 0; + unsigned num_device_recs = 0; + unsigned num_kernel_recs = 0; + unsigned num_driver_recs = 0; + unsigned num_memcpy_recs = 0; + unsigned num_runtime_recs = 0; + unsigned num_uvm_recs = 0; + unsigned num_unknown_recs = 0; + + unsigned num_correlations_found = 0; unsigned num_correlations_missed = 0; unsigned num_snapshot_flushes = 0; @@ -123,8 +123,8 @@ class CuptiTraceService Attribute uvm_access_type_attr; bool record_host_timestamp = false; - bool record_host_duration = false; - bool flush_on_snapshot = false; + bool record_host_duration = false; + bool flush_on_snapshot = false; Attribute flush_trigger_attr; @@ -153,7 +153,7 @@ class CuptiTraceService { *buffer = new uint8_t[s_instance->buffer_size]; - *size = s_instance->buffer_size; + *size = s_instance->buffer_size; *max_num_recs = 0; ++s_instance->num_buffers_allocated; @@ -171,7 +171,7 @@ class CuptiTraceService if (retired_buffers_list) retired_buffers_list->prev = acb; - acb->next = retired_buffers_list; + acb->next = retired_buffers_list; retired_buffers_list = acb; ++num_buffers_completed; @@ -293,7 +293,7 @@ class CuptiTraceService DeviceInfo info; - info.id = device->id; + info.id = device->id; info.name = device->name; info.uuid = device->uuid; @@ -485,9 +485,9 @@ class CuptiTraceService attr[1] = uvm_kind_attr; attr[2] = fault_address_attr; - data[0] = Variant("uvm"); - data[1] = Variant(get_uvm_counter_kind_string(uvm->counterKind)); - data[2] = Variant(CALI_TYPE_ADDR, &uvm->address, sizeof(void*)); + data[0] = Variant("uvm"); + data[1] = Variant(get_uvm_counter_kind_string(uvm->counterKind)); + data[2] = Variant(CALI_TYPE_ADDR, &uvm->address, sizeof(void*)); size_t n = 3; switch (uvm->counterKind) { @@ -668,7 +668,7 @@ class CuptiTraceService { std::lock_guard g(retired_buffers_list_lock); - acb = retired_buffers_list; + acb = retired_buffers_list; retired_buffers_list = nullptr; } @@ -732,7 +732,7 @@ class CuptiTraceService << std::endl; unitfmt_result bytes_reserved = unitfmt(num_buffers_completed * buffer_size, unitfmt_bytes); - unitfmt_result bytes_used = unitfmt(buffer_size_used, unitfmt_bytes); + unitfmt_result bytes_used = unitfmt(buffer_size_used, unitfmt_bytes); Log(1).stream() << chn->name() << ": cuptitrace: Allocated " << num_buffers_allocated << " buffers (" << bytes_reserved.val << bytes_reserved.symbol << " reserved, " << bytes_used.val @@ -761,29 +761,29 @@ class CuptiTraceService size_t n = 0; if (config.get("uvm_transfers").to_bool()) { - umcfg[n].scope = CUPTI_ACTIVITY_UNIFIED_MEMORY_COUNTER_SCOPE_PROCESS_SINGLE_DEVICE; - umcfg[n].kind = CUPTI_ACTIVITY_UNIFIED_MEMORY_COUNTER_KIND_BYTES_TRANSFER_HTOD; + umcfg[n].scope = CUPTI_ACTIVITY_UNIFIED_MEMORY_COUNTER_SCOPE_PROCESS_SINGLE_DEVICE; + umcfg[n].kind = CUPTI_ACTIVITY_UNIFIED_MEMORY_COUNTER_KIND_BYTES_TRANSFER_HTOD; umcfg[n].deviceId = 0; - umcfg[n].enable = 1; + umcfg[n].enable = 1; ++n; - umcfg[n].scope = CUPTI_ACTIVITY_UNIFIED_MEMORY_COUNTER_SCOPE_PROCESS_SINGLE_DEVICE; - umcfg[n].kind = CUPTI_ACTIVITY_UNIFIED_MEMORY_COUNTER_KIND_BYTES_TRANSFER_DTOH; + umcfg[n].scope = CUPTI_ACTIVITY_UNIFIED_MEMORY_COUNTER_SCOPE_PROCESS_SINGLE_DEVICE; + umcfg[n].kind = CUPTI_ACTIVITY_UNIFIED_MEMORY_COUNTER_KIND_BYTES_TRANSFER_DTOH; umcfg[n].deviceId = 0; - umcfg[n].enable = 1; + umcfg[n].enable = 1; ++n; } if (config.get("uvm_pagefaults").to_bool()) { - umcfg[n].scope = CUPTI_ACTIVITY_UNIFIED_MEMORY_COUNTER_SCOPE_PROCESS_SINGLE_DEVICE; - umcfg[n].kind = CUPTI_ACTIVITY_UNIFIED_MEMORY_COUNTER_KIND_CPU_PAGE_FAULT_COUNT; + umcfg[n].scope = CUPTI_ACTIVITY_UNIFIED_MEMORY_COUNTER_SCOPE_PROCESS_SINGLE_DEVICE; + umcfg[n].kind = CUPTI_ACTIVITY_UNIFIED_MEMORY_COUNTER_KIND_CPU_PAGE_FAULT_COUNT; umcfg[n].deviceId = 0; - umcfg[n].enable = 1; + umcfg[n].enable = 1; ++n; - umcfg[n].scope = CUPTI_ACTIVITY_UNIFIED_MEMORY_COUNTER_SCOPE_PROCESS_SINGLE_DEVICE; - umcfg[n].kind = CUPTI_ACTIVITY_UNIFIED_MEMORY_COUNTER_KIND_GPU_PAGE_FAULT; + umcfg[n].scope = CUPTI_ACTIVITY_UNIFIED_MEMORY_COUNTER_SCOPE_PROCESS_SINGLE_DEVICE; + umcfg[n].kind = CUPTI_ACTIVITY_UNIFIED_MEMORY_COUNTER_KIND_GPU_PAGE_FAULT; umcfg[n].deviceId = 0; - umcfg[n].enable = 1; + umcfg[n].enable = 1; ++n; } @@ -913,7 +913,7 @@ class CuptiTraceService if (flush_on_snapshot) { std::string attr_name = config.get("flush_trigger").to_string(); - flush_trigger_attr = c->get_attribute(attr_name); + flush_trigger_attr = c->get_attribute(attr_name); if (!flush_trigger_attr) chn->events().create_attr_evt.connect([attr_name](Caliper* c, Channel*, const Attribute& attr) { @@ -946,7 +946,7 @@ class CuptiTraceService CuptiTraceService(Caliper* c, Channel* chn) { - Attribute unit_attr = c->create_attribute("time.unit", CALI_TYPE_STRING, CALI_ATTR_SKIP_EVENTS); + Attribute unit_attr = c->create_attribute("time.unit", CALI_TYPE_STRING, CALI_ATTR_SKIP_EVENTS); Attribute addr_class_attr = c->get_attribute("class.memoryaddress"); Variant nsec_val(CALI_TYPE_STRING, "nsec", 4); Variant true_val(true); @@ -1009,7 +1009,7 @@ class CuptiTraceService ConfigSet config = services::init_config_from_spec(chn->config(), s_spec); record_host_timestamp = config.get("snapshot_timestamps").to_bool(); - record_host_duration = config.get("snapshot_duration").to_bool(); + record_host_duration = config.get("snapshot_duration").to_bool(); if (record_host_duration || record_host_timestamp) { int hide_offset = record_host_timestamp ? 0 : CALI_ATTR_HIDDEN; diff --git a/src/services/env/EnvironmentInfo.cpp b/src/services/env/EnvironmentInfo.cpp index 2f98897b..d19a6a15 100644 --- a/src/services/env/EnvironmentInfo.cpp +++ b/src/services/env/EnvironmentInfo.cpp @@ -94,7 +94,7 @@ void read_time(Caliper* c, Channel* chn, ConfigSet& config) { Attribute starttime_attr = c->create_attribute("env.starttime", CALI_TYPE_STRING, CALI_ATTR_GLOBAL); - time_t t = time(NULL); + time_t t = time(NULL); struct tm* tmp = localtime(&t); if (!tmp) diff --git a/src/services/event/EventTrigger.cpp b/src/services/event/EventTrigger.cpp index f922715e..3d92806a 100644 --- a/src/services/event/EventTrigger.cpp +++ b/src/services/event/EventTrigger.cpp @@ -73,7 +73,7 @@ class EventTrigger if (str == "phase") { region_level = phase_attr.level(); } else { - bool ok = false; + bool ok = false; int level = StringConverter(str).to_int(&ok); if (!ok || level < 0 || level > 7) { @@ -175,7 +175,7 @@ class EventTrigger // Construct the trigger info entry Attribute attrs[2] = { trigger_begin_attr, begin_attr }; - Variant vals[2] = { Variant(attr.id()), value }; + Variant vals[2] = { Variant(attr.id()), value }; FixedSizeSnapshotRecord<2> trigger_info; @@ -212,7 +212,7 @@ class EventTrigger // Construct the trigger info entry Attribute attrs[2] = { trigger_set_attr, set_attr }; - Variant vals[2] = { Variant(attr.id()), value }; + Variant vals[2] = { Variant(attr.id()), value }; FixedSizeSnapshotRecord<2> trigger_info; @@ -250,7 +250,7 @@ class EventTrigger // Construct the trigger info entry with previous level Attribute attrs[3] = { trigger_end_attr, end_attr, region_count_attr }; - Variant vals[3] = { Variant(attr.id()), value, cali_make_variant_from_uint(1) }; + Variant vals[3] = { Variant(attr.id()), value, cali_make_variant_from_uint(1) }; FixedSizeSnapshotRecord<3> trigger_info; @@ -285,7 +285,7 @@ class EventTrigger ConfigSet cfg = services::init_config_from_spec(channel->config(), s_spec); - trigger_attr_names = cfg.get("trigger").to_stringlist(",:"); + trigger_attr_names = cfg.get("trigger").to_stringlist(",:"); enable_snapshot_info = cfg.get("enable_snapshot_info").to_bool(); parse_region_level(channel, cfg.get("region_level").to_string()); diff --git a/src/services/io/CurIOus/include/curious/curious.h b/src/services/io/CurIOus/include/curious/curious.h index cc9af0b9..e5872547 100644 --- a/src/services/io/CurIOus/include/curious/curious.h +++ b/src/services/io/CurIOus/include/curious/curious.h @@ -23,7 +23,7 @@ typedef int curious_t; // Indicates what API an IO function originally came from // (each should be a power of two, so that they can be properly or-ed together) typedef enum curious_api { - CURIOUS_POSIX = 0x1, + CURIOUS_POSIX = 0x1, CURIOUS_CSTDIO = 0x2, } curious_api_t; @@ -47,8 +47,8 @@ typedef int curious_apis_t; // Indicates what type of I/O operation the callback should be triggered by, and recieve data from typedef enum curious_callback_category { - CURIOUS_READ_CALLBACK = 0x0, - CURIOUS_WRITE_CALLBACK = 0x2, + CURIOUS_READ_CALLBACK = 0x0, + CURIOUS_WRITE_CALLBACK = 0x2, CURIOUS_METADATA_CALLBACK = 0x4, } curious_callback_category_t; diff --git a/src/services/io/CurIOus/src/callbacks.c b/src/services/io/CurIOus/src/callbacks.c index 81e05afe..12ec2356 100644 --- a/src/services/io/CurIOus/src/callbacks.c +++ b/src/services/io/CurIOus/src/callbacks.c @@ -32,8 +32,8 @@ int curious_register_callback( curious_callback_data_t data; //initialise feilds - data.callback = callback; - data.usr_args = usr_args; + data.callback = callback; + data.usr_args = usr_args; data.curious_inst = curious_inst; //add record to the part of the registry corresponding to its type @@ -48,7 +48,7 @@ int curious_register_callback( void curious_deregister_callbacks(curious_t curious_inst) { for (int i = 0; i < CURIOUS_CALLBACK_TYPE_COUNT; ++i) { - curious_dynamic_array_t* callbacks = callback_registry + i; + curious_dynamic_array_t* callbacks = callback_registry + i; int block_size = 0; for (int j = 0; j <= callbacks->last_el; ++j) { curious_callback_data_t* data = (curious_callback_data_t*) (get_from_curious_dynamic_array(callbacks, j)); diff --git a/src/services/io/CurIOus/src/curious.c b/src/services/io/CurIOus/src/curious.c index 180c7f27..e59080f2 100644 --- a/src/services/io/CurIOus/src/curious.c +++ b/src/services/io/CurIOus/src/curious.c @@ -6,7 +6,7 @@ #include "file_registry.h" #include "mount_tree.h" -static curious_t next_inst = 0; +static curious_t next_inst = 0; static int active_insts = 0; static curious_apis_t wrapped_apis = 0; diff --git a/src/services/io/CurIOus/src/dynamic_array.c b/src/services/io/CurIOus/src/dynamic_array.c index ee3042a2..23b0860d 100644 --- a/src/services/io/CurIOus/src/dynamic_array.c +++ b/src/services/io/CurIOus/src/dynamic_array.c @@ -10,9 +10,9 @@ void create_curious_dynamic_array(curious_dynamic_array_t* self, int len, size_t //and ensures that the next index is 0 self->last_el = -1; - self->len = len; + self->len = len; self->el_size = el_size; - self->array = malloc(len * el_size); + self->array = malloc(len * el_size); } void destroy_curious_dynamic_array(curious_dynamic_array_t* self, free_f destroy_el) diff --git a/src/services/io/CurIOus/src/file_registry.c b/src/services/io/CurIOus/src/file_registry.c index 7d9e8ca2..ca777d78 100644 --- a/src/services/io/CurIOus/src/file_registry.c +++ b/src/services/io/CurIOus/src/file_registry.c @@ -31,8 +31,8 @@ void destroy_curious_file_record(curious_file_record_t* record) // We allocated space for the path string when we duplicated it free(record->path); - record->path = NULL; - record->filesystem = NULL; + record->path = NULL; + record->filesystem = NULL; record->mount_point = NULL; } @@ -47,7 +47,7 @@ int curious_register_file_by_fd(int fd) // Assume we have at most a 6 digit file descriptor, since we can spare a few bytes #define DIGITS 6 char fd_path[] = "/proc/self/fd/\0 "; - size_t len = strlen(fd_path); + size_t len = strlen(fd_path); // We make the assumption that the mount will be in the first 256 bytes, // since that's longer than any line in /proc/mounts @@ -93,15 +93,15 @@ int curious_register_file(const char* path, int fd, char* filesystem, char* moun curious_file_record_t new_record; // ...and intialise its fields - new_record.path = strdup(path); - new_record.filesystem = filesystem; + new_record.path = strdup(path); + new_record.filesystem = filesystem; new_record.mount_point = mount_point; //Ditto for a blank record to fill any extra space created //by adding this file record curious_file_record_t blank_record; - blank_record.path = NULL; - blank_record.filesystem = NULL; + blank_record.path = NULL; + blank_record.filesystem = NULL; blank_record.mount_point = NULL; set_in_curious_dynamic_array(&file_registry, &new_record, &blank_record, fd); @@ -110,8 +110,8 @@ int curious_register_file(const char* path, int fd, char* filesystem, char* moun } else { // ...all we need to do is intialise the feilds, // since we already have space for a record where we need it - cur_record->path = strdup(path); - cur_record->filesystem = filesystem; + cur_record->path = strdup(path); + cur_record->filesystem = filesystem; cur_record->mount_point = mount_point; } @@ -125,7 +125,7 @@ int curious_deregister_file(int fd) //printf("deregistering file %s on %s filesystem as %d\n", cur_record->path, cur_record->filesystem, fd); free(cur_record->path); - cur_record->path = NULL; + cur_record->path = NULL; cur_record->filesystem = NULL; return 0; diff --git a/src/services/io/CurIOus/src/mount_tree.c b/src/services/io/CurIOus/src/mount_tree.c index 6c32ec19..7c1d33f8 100644 --- a/src/services/io/CurIOus/src/mount_tree.c +++ b/src/services/io/CurIOus/src/mount_tree.c @@ -69,8 +69,8 @@ void create_mount_tree(mount_tree_t* self, char* name, char* full_path, char* fi { //printf("registering %s mount at %s\n", filesystem, full_path); - self->name = strdup(name); - self->full_path = strdup(full_path); + self->name = strdup(name); + self->full_path = strdup(full_path); self->filesystem = strdup(filesystem); create_curious_dynamic_array(&self->children, 0, sizeof(mount_tree_t)); } @@ -131,8 +131,8 @@ void add_mount(char* full_path, char* filesystem) return; } - char* name = NULL; - char* path_copy = strdup(full_path); + char* name = NULL; + char* path_copy = strdup(full_path); mount_tree_t* parent_mount = get_mount(path_copy, &name); if (NULL == parent_mount) { @@ -166,7 +166,7 @@ void curious_get_filesystem(const char* path, char** filesystem, char** mount_po // if we can't resolve the absolute path, we can't find the proper mount if (NULL == path_copy) { - *filesystem = NULL; + *filesystem = NULL; *mount_point = NULL; return; } @@ -179,7 +179,7 @@ void curious_get_filesystem(const char* path, char** filesystem, char** mount_po // strdup and realpath both allocate a string, so we need to free it free(path_copy); - *filesystem = mount->filesystem; + *filesystem = mount->filesystem; *mount_point = mount->full_path; } diff --git a/src/services/io/CurIOus/src/wrappers.c b/src/services/io/CurIOus/src/wrappers.c index 0ffb038a..a80e1be1 100644 --- a/src/services/io/CurIOus/src/wrappers.c +++ b/src/services/io/CurIOus/src/wrappers.c @@ -77,48 +77,48 @@ static size_t wrapped_fwrite(void* ptr, size_t size, size_t nmemb, FILE* stream) // Note that the handles need not be intialised, just defined io_function_data_t io_fns[CURIOUS_FUNCTION_COUNT] = { - [CURIOUS_READ_ID] = { CURIOUS_POSIX, 0 }, - [CURIOUS_WRITE_ID] = { CURIOUS_POSIX, 0 }, - [CURIOUS_OPEN_ID] = { CURIOUS_POSIX, 0 }, - [CURIOUS_CLOSE_ID] = { CURIOUS_POSIX, 0 }, - [CURIOUS_STAT_ID] = { CURIOUS_POSIX, 0 }, - [CURIOUS__STAT_ID] = { CURIOUS_POSIX, 0 }, - [CURIOUS_LSTAT_ID] = { CURIOUS_POSIX, 0 }, - [CURIOUS__LSTAT_ID] = { CURIOUS_POSIX, 0 }, - [CURIOUS_XSTAT_ID] = { CURIOUS_POSIX, 0 }, - [CURIOUS__XSTAT_ID] = { CURIOUS_POSIX, 0 }, - [CURIOUS_XSTAT64_ID] = { CURIOUS_POSIX, 0 }, - [CURIOUS__XSTAT64_ID] = { CURIOUS_POSIX, 0 }, - [CURIOUS_LXSTAT_ID] = { CURIOUS_POSIX, 0 }, - [CURIOUS__LXSTAT_ID] = { CURIOUS_POSIX, 0 }, - [CURIOUS_LXSTAT64_ID] = { CURIOUS_POSIX, 0 }, + [CURIOUS_READ_ID] = { CURIOUS_POSIX, 0 }, + [CURIOUS_WRITE_ID] = { CURIOUS_POSIX, 0 }, + [CURIOUS_OPEN_ID] = { CURIOUS_POSIX, 0 }, + [CURIOUS_CLOSE_ID] = { CURIOUS_POSIX, 0 }, + [CURIOUS_STAT_ID] = { CURIOUS_POSIX, 0 }, + [CURIOUS__STAT_ID] = { CURIOUS_POSIX, 0 }, + [CURIOUS_LSTAT_ID] = { CURIOUS_POSIX, 0 }, + [CURIOUS__LSTAT_ID] = { CURIOUS_POSIX, 0 }, + [CURIOUS_XSTAT_ID] = { CURIOUS_POSIX, 0 }, + [CURIOUS__XSTAT_ID] = { CURIOUS_POSIX, 0 }, + [CURIOUS_XSTAT64_ID] = { CURIOUS_POSIX, 0 }, + [CURIOUS__XSTAT64_ID] = { CURIOUS_POSIX, 0 }, + [CURIOUS_LXSTAT_ID] = { CURIOUS_POSIX, 0 }, + [CURIOUS__LXSTAT_ID] = { CURIOUS_POSIX, 0 }, + [CURIOUS_LXSTAT64_ID] = { CURIOUS_POSIX, 0 }, [CURIOUS__LXSTAT64_ID] = { CURIOUS_POSIX, 0 }, - [CURIOUS_FSTAT_ID] = { CURIOUS_POSIX, 0 }, - [CURIOUS__FSTAT_ID] = { CURIOUS_POSIX, 0 }, - [CURIOUS_FXSTAT_ID] = { CURIOUS_POSIX, 0 }, - [CURIOUS__FXSTAT_ID] = { CURIOUS_POSIX, 0 }, - [CURIOUS_FXSTAT64_ID] = { CURIOUS_POSIX, 0 }, + [CURIOUS_FSTAT_ID] = { CURIOUS_POSIX, 0 }, + [CURIOUS__FSTAT_ID] = { CURIOUS_POSIX, 0 }, + [CURIOUS_FXSTAT_ID] = { CURIOUS_POSIX, 0 }, + [CURIOUS__FXSTAT_ID] = { CURIOUS_POSIX, 0 }, + [CURIOUS_FXSTAT64_ID] = { CURIOUS_POSIX, 0 }, [CURIOUS__FXSTAT64_ID] = { CURIOUS_POSIX, 0 }, - [CURIOUS_FOPEN_ID] = { CURIOUS_CSTDIO, 0 }, - [CURIOUS_FOPEN64_ID] = { CURIOUS_CSTDIO, 0 }, - [CURIOUS_FDOPEN_ID] = { CURIOUS_CSTDIO, 0 }, - [CURIOUS_FREOPEN_ID] = { CURIOUS_CSTDIO, 0 }, - [CURIOUS_FCLOSE_ID] = { CURIOUS_CSTDIO, 0 }, - [CURIOUS_PRINTF_ID] = { CURIOUS_CSTDIO, 0 }, - [CURIOUS_FPRINTF_ID] = { CURIOUS_CSTDIO, 0 }, - [CURIOUS_VPRINTF_ID] = { CURIOUS_CSTDIO, 0 }, - [CURIOUS_VFPRINTF_ID] = { CURIOUS_CSTDIO, 0 }, + [CURIOUS_FOPEN_ID] = { CURIOUS_CSTDIO, 0 }, + [CURIOUS_FOPEN64_ID] = { CURIOUS_CSTDIO, 0 }, + [CURIOUS_FDOPEN_ID] = { CURIOUS_CSTDIO, 0 }, + [CURIOUS_FREOPEN_ID] = { CURIOUS_CSTDIO, 0 }, + [CURIOUS_FCLOSE_ID] = { CURIOUS_CSTDIO, 0 }, + [CURIOUS_PRINTF_ID] = { CURIOUS_CSTDIO, 0 }, + [CURIOUS_FPRINTF_ID] = { CURIOUS_CSTDIO, 0 }, + [CURIOUS_VPRINTF_ID] = { CURIOUS_CSTDIO, 0 }, + [CURIOUS_VFPRINTF_ID] = { CURIOUS_CSTDIO, 0 }, /* [CURIOUS_SCANF_ID] = { CURIOUS_CSTDIO }, [CURIOUS_FSCANF_ID] = { CURIOUS_CSTDIO }, [CURIOUS_VSCANF_ID] = { CURIOUS_CSTDIO }, [CURIOUS_VFSCANF_ID] = { CURIOUS_CSTDIO }, */ - [CURIOUS_FGETC_ID] = { CURIOUS_CSTDIO, 0 }, - [CURIOUS_FGETS_ID] = { CURIOUS_CSTDIO, 0 }, + [CURIOUS_FGETC_ID] = { CURIOUS_CSTDIO, 0 }, + [CURIOUS_FGETS_ID] = { CURIOUS_CSTDIO, 0 }, [CURIOUS_GETCHAR_ID] = { CURIOUS_CSTDIO, 0 }, //[CURIOUS_GETS_ID] = { CURIOUS_CSTDIO }, - [CURIOUS_FREAD_ID] = { CURIOUS_CSTDIO, 0 }, + [CURIOUS_FREAD_ID] = { CURIOUS_CSTDIO, 0 }, [CURIOUS_FWRITE_ID] = { CURIOUS_CSTDIO, 0 }, }; @@ -131,47 +131,47 @@ io_function_data_t io_fns[CURIOUS_FUNCTION_COUNT] = { static gotcha_binding_t bindings[CURIOUS_FUNCTION_COUNT] = { [CURIOUS_READ_ID] = GET_BINDING(read, READ), // GET_BINDING(read,READ), expands to { "read", read_wrapper, &io_fns[CURIOUS_READ_ID].handle } - [CURIOUS_WRITE_ID] = GET_BINDING(write, WRITE), - [CURIOUS_OPEN_ID] = GET_BINDING(open, OPEN), - [CURIOUS_CLOSE_ID] = GET_BINDING(close, CLOSE), - [CURIOUS_STAT_ID] = GET_BINDING(stat, STAT), - [CURIOUS__STAT_ID] = { "__stat", (void*) wrapped_stat, &io_fns[CURIOUS_STAT_ID].handle }, - [CURIOUS_LSTAT_ID] = GET_BINDING(lstat, LSTAT), - [CURIOUS__LSTAT_ID] = { "__lstat", (void*) wrapped_lstat, &io_fns[CURIOUS_LSTAT_ID].handle }, - [CURIOUS_XSTAT_ID] = GET_BINDING(xstat, XSTAT), - [CURIOUS__XSTAT_ID] = { "__xstat", (void*) wrapped_xstat, &io_fns[CURIOUS_XSTAT_ID].handle }, - [CURIOUS_XSTAT64_ID] = GET_BINDING(xstat64, XSTAT64), - [CURIOUS__XSTAT64_ID] = { "__xstat64", (void*) wrapped_xstat64, &io_fns[CURIOUS_XSTAT64_ID].handle }, - [CURIOUS_LXSTAT_ID] = GET_BINDING(lxstat, LXSTAT), - [CURIOUS__LXSTAT_ID] = { "__lxstat", (void*) wrapped_lxstat, &io_fns[CURIOUS_LXSTAT_ID].handle }, - [CURIOUS_LXSTAT64_ID] = GET_BINDING(lxstat64, LXSTAT64), + [CURIOUS_WRITE_ID] = GET_BINDING(write, WRITE), + [CURIOUS_OPEN_ID] = GET_BINDING(open, OPEN), + [CURIOUS_CLOSE_ID] = GET_BINDING(close, CLOSE), + [CURIOUS_STAT_ID] = GET_BINDING(stat, STAT), + [CURIOUS__STAT_ID] = { "__stat", (void*) wrapped_stat, &io_fns[CURIOUS_STAT_ID].handle }, + [CURIOUS_LSTAT_ID] = GET_BINDING(lstat, LSTAT), + [CURIOUS__LSTAT_ID] = { "__lstat", (void*) wrapped_lstat, &io_fns[CURIOUS_LSTAT_ID].handle }, + [CURIOUS_XSTAT_ID] = GET_BINDING(xstat, XSTAT), + [CURIOUS__XSTAT_ID] = { "__xstat", (void*) wrapped_xstat, &io_fns[CURIOUS_XSTAT_ID].handle }, + [CURIOUS_XSTAT64_ID] = GET_BINDING(xstat64, XSTAT64), + [CURIOUS__XSTAT64_ID] = { "__xstat64", (void*) wrapped_xstat64, &io_fns[CURIOUS_XSTAT64_ID].handle }, + [CURIOUS_LXSTAT_ID] = GET_BINDING(lxstat, LXSTAT), + [CURIOUS__LXSTAT_ID] = { "__lxstat", (void*) wrapped_lxstat, &io_fns[CURIOUS_LXSTAT_ID].handle }, + [CURIOUS_LXSTAT64_ID] = GET_BINDING(lxstat64, LXSTAT64), [CURIOUS__LXSTAT64_ID] = { "__lxstat64", (void*) wrapped_lxstat64, &io_fns[CURIOUS_LXSTAT64_ID].handle }, - [CURIOUS_FSTAT_ID] = GET_BINDING(fstat, FSTAT), - [CURIOUS__FSTAT_ID] = { "__fstat", (void*) wrapped_fstat, &io_fns[CURIOUS_FSTAT_ID].handle }, - [CURIOUS_FXSTAT_ID] = GET_BINDING(fxstat, FXSTAT), - [CURIOUS__FXSTAT_ID] = { "__fxstat", (void*) wrapped_fxstat, &io_fns[CURIOUS_FXSTAT_ID].handle }, - [CURIOUS_FXSTAT64_ID] = GET_BINDING(fxstat64, FXSTAT64), + [CURIOUS_FSTAT_ID] = GET_BINDING(fstat, FSTAT), + [CURIOUS__FSTAT_ID] = { "__fstat", (void*) wrapped_fstat, &io_fns[CURIOUS_FSTAT_ID].handle }, + [CURIOUS_FXSTAT_ID] = GET_BINDING(fxstat, FXSTAT), + [CURIOUS__FXSTAT_ID] = { "__fxstat", (void*) wrapped_fxstat, &io_fns[CURIOUS_FXSTAT_ID].handle }, + [CURIOUS_FXSTAT64_ID] = GET_BINDING(fxstat64, FXSTAT64), [CURIOUS__FXSTAT64_ID] = { "__fxstat64", (void*) wrapped_fxstat64, &io_fns[CURIOUS_FXSTAT64_ID].handle }, - [CURIOUS_FOPEN_ID] = GET_BINDING(fopen, FOPEN), - [CURIOUS_FOPEN64_ID] = { "fopen64", (void*) wrapped_fopen, &io_fns[CURIOUS_FOPEN64_ID].handle }, - [CURIOUS_FDOPEN_ID] = GET_BINDING(fdopen, FDOPEN), - [CURIOUS_FREOPEN_ID] = GET_BINDING(freopen, FREOPEN), - [CURIOUS_FCLOSE_ID] = GET_BINDING(fclose, FCLOSE), - [CURIOUS_PRINTF_ID] = GET_BINDING(printf, PRINTF), - [CURIOUS_FPRINTF_ID] = GET_BINDING(fprintf, FPRINTF), - [CURIOUS_VPRINTF_ID] = GET_BINDING(vprintf, VPRINTF), - [CURIOUS_VFPRINTF_ID] = GET_BINDING(vfprintf, VFPRINTF), + [CURIOUS_FOPEN_ID] = GET_BINDING(fopen, FOPEN), + [CURIOUS_FOPEN64_ID] = { "fopen64", (void*) wrapped_fopen, &io_fns[CURIOUS_FOPEN64_ID].handle }, + [CURIOUS_FDOPEN_ID] = GET_BINDING(fdopen, FDOPEN), + [CURIOUS_FREOPEN_ID] = GET_BINDING(freopen, FREOPEN), + [CURIOUS_FCLOSE_ID] = GET_BINDING(fclose, FCLOSE), + [CURIOUS_PRINTF_ID] = GET_BINDING(printf, PRINTF), + [CURIOUS_FPRINTF_ID] = GET_BINDING(fprintf, FPRINTF), + [CURIOUS_VPRINTF_ID] = GET_BINDING(vprintf, VPRINTF), + [CURIOUS_VFPRINTF_ID] = GET_BINDING(vfprintf, VFPRINTF), /* [CURIOUS_SCANF_ID] = GET_BINDING(scanf,SCANF), [CURIOUS_FSCANF_ID] = GET_BINDING(fscanf,FSCANF), [CURIOUS_VSCANF_ID] = GET_BINDING(vscanf,VSCANF), [CURIOUS_VFSCANF_ID] = GET_BINDING(vfscanf,VFSCANF), */ - [CURIOUS_FGETC_ID] = GET_BINDING(fgetc, FGETC), - [CURIOUS_FGETS_ID] = GET_BINDING(fgets, FGETS), + [CURIOUS_FGETC_ID] = GET_BINDING(fgetc, FGETC), + [CURIOUS_FGETS_ID] = GET_BINDING(fgets, FGETS), [CURIOUS_GETCHAR_ID] = GET_BINDING(getchar, GETCHAR), //[CURIOUS_GETS_ID] = GET_BINDING(gets,GETS), - [CURIOUS_FREAD_ID] = GET_BINDING(fread, FREAD), + [CURIOUS_FREAD_ID] = GET_BINDING(fread, FREAD), [CURIOUS_FWRITE_ID] = GET_BINDING(fwrite, FWRITE), }; @@ -226,17 +226,17 @@ ssize_t wrapped_read(int fd, void* buf, size_t count) char* mount_point; curious_file_record_t* record = get_curious_file_record(fd); if (NULL == record) { - filesystem = NULL; + filesystem = NULL; mount_point = NULL; } else { - filesystem = record->filesystem; + filesystem = record->filesystem; mount_point = record->mount_point; } curious_read_record_t io_args = { - .bytes_read = 0, - .call_count = 0, - .filesystem = filesystem, + .bytes_read = 0, + .call_count = 0, + .filesystem = filesystem, .mount_point = mount_point, .function_id = CURIOUS_READ_ID, }; @@ -270,25 +270,25 @@ ssize_t wrapped_write(int fd, const void* buf, size_t count) char* mount_point; curious_file_record_t* record = get_curious_file_record(fd); if (NULL == record) { - filesystem = NULL; + filesystem = NULL; mount_point = NULL; } else { - filesystem = record->filesystem; + filesystem = record->filesystem; mount_point = record->mount_point; } curious_write_record_t io_args = { .bytes_written = 0, - .call_count = 0, - .filesystem = filesystem, - .mount_point = mount_point, - .function_id = CURIOUS_WRITE_ID, + .call_count = 0, + .filesystem = filesystem, + .mount_point = mount_point, + .function_id = CURIOUS_WRITE_ID, }; curious_call_callbacks(CURIOUS_WRITE_CALLBACK, &io_args); // Call the original, saving the result... io_args.bytes_written = orig_write(fd, buf, count); - io_args.call_count = 1; + io_args.call_count = 1; //...for the pot callbacks to use curious_call_callbacks(CURIOUS_WRITE_CALLBACK | CURIOUS_POST_CALLBACK, &io_args); @@ -306,7 +306,7 @@ int wrapped_open(const char* pathname, int flags, mode_t mode) WRAPPER_ENTER(open); curious_metadata_record_t io_args = { - .call_count = 0, + .call_count = 0, .function_id = CURIOUS_OPEN_ID, }; @@ -346,23 +346,23 @@ int wrapped_close(int fd) char* mount_point; curious_file_record_t* record = get_curious_file_record(fd); if (NULL == record) { - filesystem = NULL; + filesystem = NULL; mount_point = NULL; } else { - filesystem = record->filesystem; + filesystem = record->filesystem; mount_point = record->mount_point; } curious_metadata_record_t io_args = { - .call_count = 0, - .filesystem = filesystem, + .call_count = 0, + .filesystem = filesystem, .mount_point = mount_point, .function_id = CURIOUS_CLOSE_ID, }; curious_call_callbacks(CURIOUS_METADATA_CALLBACK, &io_args); // Call the original, saving the result... - int return_val = orig_close(fd); + int return_val = orig_close(fd); io_args.call_count = 1; //...for the pot callbacks to use @@ -386,7 +386,7 @@ int wrapped_stat(const char* path, struct stat* buf) // Only call callbacks the first time around if (1 == wrapper_call_depth && wrappers_enabled) { curious_metadata_record_t io_args = { - .call_count = 0, + .call_count = 0, .function_id = CURIOUS_STAT_ID, }; @@ -395,7 +395,7 @@ int wrapped_stat(const char* path, struct stat* buf) curious_call_callbacks(CURIOUS_METADATA_CALLBACK, &io_args); // Call the original, saving the result... - int return_val = orig_stat(path, buf); + int return_val = orig_stat(path, buf); io_args.call_count = 1; //...for the pot callbacks to use @@ -419,7 +419,7 @@ int wrapped_lstat(const char* path, struct stat* buf) // Only call callbacks the first time around if (1 == wrapper_call_depth && wrappers_enabled) { curious_metadata_record_t io_args = { - .call_count = 0, + .call_count = 0, .function_id = CURIOUS_LSTAT_ID, }; @@ -428,7 +428,7 @@ int wrapped_lstat(const char* path, struct stat* buf) curious_call_callbacks(CURIOUS_METADATA_CALLBACK, &io_args); // Call the original, saving the result... - int return_val = orig_lstat(path, buf); + int return_val = orig_lstat(path, buf); io_args.call_count = 1; //...for the pot callbacks to use @@ -452,7 +452,7 @@ int wrapped_xstat(int vers, const char* path, struct stat* buf) // Only call callbacks the first time around if (1 == wrapper_call_depth && wrappers_enabled) { curious_metadata_record_t io_args = { - .call_count = 0, + .call_count = 0, .function_id = CURIOUS_XSTAT_ID, }; @@ -461,7 +461,7 @@ int wrapped_xstat(int vers, const char* path, struct stat* buf) curious_call_callbacks(CURIOUS_METADATA_CALLBACK, &io_args); // Call the original, saving the result... - int return_val = orig_xstat(vers, path, buf); + int return_val = orig_xstat(vers, path, buf); io_args.call_count = 1; //...for the pot callbacks to use @@ -485,7 +485,7 @@ int wrapped_xstat64(int vers, const char* path, struct stat* buf) // Only call callbacks the first time around if (1 == wrapper_call_depth && wrappers_enabled) { curious_metadata_record_t io_args = { - .call_count = 0, + .call_count = 0, .function_id = CURIOUS_XSTAT64_ID, }; @@ -494,7 +494,7 @@ int wrapped_xstat64(int vers, const char* path, struct stat* buf) curious_call_callbacks(CURIOUS_METADATA_CALLBACK, &io_args); // Call the original, saving the result... - int return_val = orig_xstat64(vers, path, buf); + int return_val = orig_xstat64(vers, path, buf); io_args.call_count = 1; //...for the pot callbacks to use @@ -518,7 +518,7 @@ int wrapped_lxstat(int vers, const char* path, struct stat* buf) // Only call callbacks the first time around if (1 == wrapper_call_depth && wrappers_enabled) { curious_metadata_record_t io_args = { - .call_count = 0, + .call_count = 0, .function_id = CURIOUS_LXSTAT_ID, }; @@ -527,7 +527,7 @@ int wrapped_lxstat(int vers, const char* path, struct stat* buf) curious_call_callbacks(CURIOUS_METADATA_CALLBACK, &io_args); // Call the original, saving the result... - int return_val = orig_lxstat(vers, path, buf); + int return_val = orig_lxstat(vers, path, buf); io_args.call_count = 1; //...for the pot callbacks to use @@ -551,7 +551,7 @@ int wrapped_lxstat64(int vers, const char* path, struct stat* buf) // Only call callbacks the first time around if (1 == wrapper_call_depth && wrappers_enabled) { curious_metadata_record_t io_args = { - .call_count = 0, + .call_count = 0, .function_id = CURIOUS_LXSTAT64_ID, }; @@ -560,7 +560,7 @@ int wrapped_lxstat64(int vers, const char* path, struct stat* buf) curious_call_callbacks(CURIOUS_METADATA_CALLBACK, &io_args); // Call the original, saving the result... - int return_val = orig_lxstat64(vers, path, buf); + int return_val = orig_lxstat64(vers, path, buf); io_args.call_count = 1; //...for the pot callbacks to use @@ -587,23 +587,23 @@ int wrapped_fstat(int fd, struct stat* buf) char* mount_point; curious_file_record_t* record = get_curious_file_record(fd); if (NULL == record) { - filesystem = NULL; + filesystem = NULL; mount_point = NULL; } else { - filesystem = record->filesystem; + filesystem = record->filesystem; mount_point = record->mount_point; } curious_metadata_record_t io_args = { - .call_count = 0, - .filesystem = filesystem, + .call_count = 0, + .filesystem = filesystem, .mount_point = mount_point, .function_id = CURIOUS_FSTAT_ID, }; curious_call_callbacks(CURIOUS_METADATA_CALLBACK, &io_args); // Call the original, saving the result... - int return_val = orig_fstat(fd, buf); + int return_val = orig_fstat(fd, buf); io_args.call_count = 1; //...for the pot callbacks to use @@ -630,23 +630,23 @@ int wrapped_fxstat(int vers, int fd, struct stat* buf) char* mount_point; curious_file_record_t* record = get_curious_file_record(fd); if (NULL == record) { - filesystem = NULL; + filesystem = NULL; mount_point = NULL; } else { - filesystem = record->filesystem; + filesystem = record->filesystem; mount_point = record->mount_point; } curious_metadata_record_t io_args = { - .call_count = 0, - .filesystem = filesystem, + .call_count = 0, + .filesystem = filesystem, .mount_point = mount_point, .function_id = CURIOUS_FXSTAT_ID, }; curious_call_callbacks(CURIOUS_METADATA_CALLBACK, &io_args); // Call the original, saving the result... - int return_val = orig_fxstat(vers, fd, buf); + int return_val = orig_fxstat(vers, fd, buf); io_args.call_count = 1; //...for the pot callbacks to use @@ -673,23 +673,23 @@ int wrapped_fxstat64(int vers, int fd, struct stat* buf) char* mount_point; curious_file_record_t* record = get_curious_file_record(fd); if (NULL == record) { - filesystem = NULL; + filesystem = NULL; mount_point = NULL; } else { - filesystem = record->filesystem; + filesystem = record->filesystem; mount_point = record->mount_point; } curious_metadata_record_t io_args = { - .call_count = 0, - .filesystem = filesystem, + .call_count = 0, + .filesystem = filesystem, .mount_point = mount_point, .function_id = CURIOUS_FXSTAT64_ID, }; curious_call_callbacks(CURIOUS_METADATA_CALLBACK, &io_args); // Call the original, saving the result... - int return_val = orig_fxstat64(vers, fd, buf); + int return_val = orig_fxstat64(vers, fd, buf); io_args.call_count = 1; //...for the pot callbacks to use @@ -714,7 +714,7 @@ FILE* wrapped_fopen(const char* path, const char* mode) // might be necessary in order to handle relative paths_ curious_metadata_record_t io_args = { - .call_count = 0, + .call_count = 0, .function_id = CURIOUS_FOPEN_ID, }; @@ -753,23 +753,23 @@ FILE* wrapped_fdopen(int fd, const char* mode) char* mount_point; curious_file_record_t* record = get_curious_file_record(fd); if (NULL == record) { - filesystem = NULL; + filesystem = NULL; mount_point = NULL; } else { - filesystem = record->filesystem; + filesystem = record->filesystem; mount_point = record->mount_point; } curious_metadata_record_t io_args = { - .call_count = 0, - .filesystem = filesystem, + .call_count = 0, + .filesystem = filesystem, .mount_point = mount_point, .function_id = CURIOUS_FDOPEN_ID, }; curious_call_callbacks(CURIOUS_METADATA_CALLBACK, &io_args); // Call the original, saving the result... - FILE* file = orig_fdopen(fd, mode); + FILE* file = orig_fdopen(fd, mode); io_args.call_count = 1; //...for the pot callbacks to use @@ -794,7 +794,7 @@ FILE* wrapped_freopen(const char* path, const char* mode, FILE* stream) // might be necessary in order to handle relative paths_ curious_metadata_record_t io_args = { - .call_count = 0, + .call_count = 0, .function_id = CURIOUS_FREOPEN_ID, }; @@ -832,25 +832,25 @@ int wrapped_fclose(FILE* fp) char* mount_point; curious_file_record_t* record = get_curious_file_record(fileno(fp)); if (NULL == record) { - filesystem = NULL; + filesystem = NULL; mount_point = NULL; } else { - filesystem = record->filesystem; + filesystem = record->filesystem; mount_point = record->mount_point; } curious_deregister_file(fileno(fp)); curious_metadata_record_t io_args = { - .call_count = 0, - .filesystem = filesystem, + .call_count = 0, + .filesystem = filesystem, .mount_point = mount_point, .function_id = CURIOUS_FCLOSE_ID, }; curious_call_callbacks(CURIOUS_METADATA_CALLBACK, &io_args); // Call the original, saving the result... - int return_val = orig_fclose(fp); + int return_val = orig_fclose(fp); io_args.call_count = 1; //...for the pot callbacks to use @@ -881,24 +881,24 @@ int wrapped_printf(const char* format, ...) char* mount_point; curious_file_record_t* record = get_curious_file_record(STDOUT_FILENO); if (NULL == record) { - filesystem = NULL; + filesystem = NULL; mount_point = NULL; } else { - filesystem = record->filesystem; + filesystem = record->filesystem; mount_point = record->mount_point; } curious_write_record_t io_args = { .bytes_written = 0, - .call_count = 0, - .filesystem = filesystem, - .mount_point = mount_point, - .function_id = CURIOUS_PRINTF_ID, + .call_count = 0, + .filesystem = filesystem, + .mount_point = mount_point, + .function_id = CURIOUS_PRINTF_ID, }; curious_call_callbacks(CURIOUS_WRITE_CALLBACK, &io_args); // Call the original, saving the result... - int return_val = orig_vprintf(format, args); + int return_val = orig_vprintf(format, args); io_args.call_count = 1; if (return_val > 0) { io_args.bytes_written = return_val; @@ -932,24 +932,24 @@ int wrapped_fprintf(FILE* stream, const char* format, ...) char* mount_point; curious_file_record_t* record = get_curious_file_record(fileno(stream)); if (NULL == record) { - filesystem = NULL; + filesystem = NULL; mount_point = NULL; } else { - filesystem = record->filesystem; + filesystem = record->filesystem; mount_point = record->mount_point; } curious_write_record_t io_args = { .bytes_written = 0, - .call_count = 0, - .filesystem = filesystem, - .mount_point = mount_point, - .function_id = CURIOUS_FPRINTF_ID, + .call_count = 0, + .filesystem = filesystem, + .mount_point = mount_point, + .function_id = CURIOUS_FPRINTF_ID, }; curious_call_callbacks(CURIOUS_WRITE_CALLBACK, &io_args); // Call the original, saving the result... - int return_val = orig_vfprintf(stream, format, args); + int return_val = orig_vfprintf(stream, format, args); io_args.call_count = 1; if (return_val > 0) { io_args.bytes_written = return_val; @@ -979,24 +979,24 @@ int wrapped_vprintf(const char* format, va_list ap) char* mount_point; curious_file_record_t* record = get_curious_file_record(STDOUT_FILENO); if (NULL == record) { - filesystem = NULL; + filesystem = NULL; mount_point = NULL; } else { - filesystem = record->filesystem; + filesystem = record->filesystem; mount_point = record->mount_point; } curious_write_record_t io_args = { .bytes_written = 0, - .call_count = 0, - .filesystem = filesystem, - .mount_point = mount_point, - .function_id = CURIOUS_VPRINTF_ID, + .call_count = 0, + .filesystem = filesystem, + .mount_point = mount_point, + .function_id = CURIOUS_VPRINTF_ID, }; curious_call_callbacks(CURIOUS_WRITE_CALLBACK, &io_args); // Call the original, saving the result... - int return_val = orig_vprintf(format, ap); + int return_val = orig_vprintf(format, ap); io_args.call_count = 1; if (return_val > 0) { io_args.bytes_written = return_val; @@ -1026,24 +1026,24 @@ int wrapped_vfprintf(FILE* stream, const char* format, va_list ap) char* mount_point; curious_file_record_t* record = get_curious_file_record(fileno(stream)); if (NULL == record) { - filesystem = NULL; + filesystem = NULL; mount_point = NULL; } else { - filesystem = record->filesystem; + filesystem = record->filesystem; mount_point = record->mount_point; } curious_write_record_t io_args = { .bytes_written = 0, - .call_count = 0, - .filesystem = filesystem, - .mount_point = mount_point, - .function_id = CURIOUS_VFPRINTF_ID, + .call_count = 0, + .filesystem = filesystem, + .mount_point = mount_point, + .function_id = CURIOUS_VFPRINTF_ID, }; curious_call_callbacks(CURIOUS_WRITE_CALLBACK, &io_args); // Call the original, saving the result... - int return_val = orig_vfprintf(stream, format, ap); + int return_val = orig_vfprintf(stream, format, ap); io_args.call_count = 1; if (return_val > 0) { io_args.bytes_written = return_val; @@ -1240,24 +1240,24 @@ int wrapped_fgetc(FILE* stream) char* mount_point; curious_file_record_t* record = get_curious_file_record(fileno(stream)); if (NULL == record) { - filesystem = NULL; + filesystem = NULL; mount_point = NULL; } else { - filesystem = record->filesystem; + filesystem = record->filesystem; mount_point = record->mount_point; } curious_read_record_t io_args = { - .bytes_read = 0, - .call_count = 0, - .filesystem = filesystem, + .bytes_read = 0, + .call_count = 0, + .filesystem = filesystem, .mount_point = mount_point, .function_id = CURIOUS_FGETC_ID, }; curious_call_callbacks(CURIOUS_READ_CALLBACK, &io_args); // Call the original, saving the result... - int return_val = orig_fgetc(stream); + int return_val = orig_fgetc(stream); io_args.call_count = 1; if (EOF != return_val) { io_args.bytes_read = 1; @@ -1287,24 +1287,24 @@ char* wrapped_fgets(char* s, int size, FILE* stream) char* mount_point; curious_file_record_t* record = get_curious_file_record(fileno(stream)); if (NULL == record) { - filesystem = NULL; + filesystem = NULL; mount_point = NULL; } else { - filesystem = record->filesystem; + filesystem = record->filesystem; mount_point = record->mount_point; } curious_read_record_t io_args = { - .bytes_read = 0, - .call_count = 0, - .filesystem = filesystem, + .bytes_read = 0, + .call_count = 0, + .filesystem = filesystem, .mount_point = mount_point, .function_id = CURIOUS_FGETS_ID, }; curious_call_callbacks(CURIOUS_READ_CALLBACK, &io_args); // Call the original, saving the result... - char* return_val = orig_fgets(s, size, stream); + char* return_val = orig_fgets(s, size, stream); io_args.call_count = 1; if (NULL != return_val) { io_args.bytes_read = strlen(return_val); @@ -1334,24 +1334,24 @@ int wrapped_getchar(void) char* mount_point; curious_file_record_t* record = get_curious_file_record(STDIN_FILENO); if (NULL == record) { - filesystem = NULL; + filesystem = NULL; mount_point = NULL; } else { - filesystem = record->filesystem; + filesystem = record->filesystem; mount_point = record->mount_point; } curious_read_record_t io_args = { - .bytes_read = 0, - .call_count = 0, - .filesystem = filesystem, + .bytes_read = 0, + .call_count = 0, + .filesystem = filesystem, .mount_point = mount_point, .function_id = CURIOUS_GETCHAR_ID, }; curious_call_callbacks(CURIOUS_READ_CALLBACK, &io_args); // Call the original, saving the result... - int return_val = orig_getchar(); + int return_val = orig_getchar(); io_args.call_count = 1; if (EOF != return_val) { io_args.bytes_read = 1; @@ -1429,24 +1429,24 @@ size_t wrapped_fread(void* ptr, size_t size, size_t nmemb, FILE* stream) char* mount_point; curious_file_record_t* record = get_curious_file_record(fileno(stream)); if (NULL == record) { - filesystem = NULL; + filesystem = NULL; mount_point = NULL; } else { - filesystem = record->filesystem; + filesystem = record->filesystem; mount_point = record->mount_point; } curious_read_record_t io_args = { - .bytes_read = 0, - .call_count = 0, - .filesystem = filesystem, + .bytes_read = 0, + .call_count = 0, + .filesystem = filesystem, .mount_point = mount_point, .function_id = CURIOUS_FREAD_ID, }; curious_call_callbacks(CURIOUS_READ_CALLBACK, &io_args); // Call the original, saving the result... - size_t return_val = orig_fread(ptr, size, nmemb, stream); + size_t return_val = orig_fread(ptr, size, nmemb, stream); io_args.call_count = 1; if (0 < return_val) { io_args.bytes_read = return_val * size; @@ -1476,24 +1476,24 @@ size_t wrapped_fwrite(void* ptr, size_t size, size_t nmemb, FILE* stream) char* mount_point; curious_file_record_t* record = get_curious_file_record(fileno(stream)); if (NULL == record) { - filesystem = NULL; + filesystem = NULL; mount_point = NULL; } else { - filesystem = record->filesystem; + filesystem = record->filesystem; mount_point = record->mount_point; } curious_write_record_t io_args = { .bytes_written = 0, - .call_count = 0, - .filesystem = filesystem, - .mount_point = mount_point, - .function_id = CURIOUS_FWRITE_ID, + .call_count = 0, + .filesystem = filesystem, + .mount_point = mount_point, + .function_id = CURIOUS_FWRITE_ID, }; curious_call_callbacks(CURIOUS_WRITE_CALLBACK, &io_args); // Call the original, saving the result... - size_t return_val = orig_fwrite(ptr, size, nmemb, stream); + size_t return_val = orig_fwrite(ptr, size, nmemb, stream); io_args.call_count = 1; if (0 < return_val) { io_args.bytes_written = return_val * size; diff --git a/src/services/io/IOService.cpp b/src/services/io/IOService.cpp index 378dcba4..8cc8da17 100644 --- a/src/services/io/IOService.cpp +++ b/src/services/io/IOService.cpp @@ -95,7 +95,7 @@ void handle_io(curious_callback_type_t type, void* usr_data, Record* record) // get a Caliper instance - Caliper c = Caliper::sigsafe_instance(); + Caliper c = Caliper::sigsafe_instance(); auto data = static_cast(usr_data); // If we got a Caliper instance successfully... @@ -110,7 +110,7 @@ void handle_io(curious_callback_type_t type, void* usr_data, Record* record) // ...or begining of the I/O region, as appropriate } else { - Variant filesystem_var = make_variant(record->filesystem); + Variant filesystem_var = make_variant(record->filesystem); Variant mount_point_var = make_variant(record->mount_point); c.begin(io_mount_point_attr, mount_point_var); @@ -129,7 +129,7 @@ void init_curious_in_channel(Caliper* c, Channel* channel) channel->events().subscribe_attribute(c, channel, io_region_attr); curious_t curious_inst = curious_init(CURIOUS_ALL_APIS); - auto data = std::unique_ptr(new user_data_t { curious_inst, *channel }); + auto data = std::unique_ptr(new user_data_t { curious_inst, *channel }); curious_register_callback( curious_inst, diff --git a/src/services/kokkos/types.hpp b/src/services/kokkos/types.hpp index 7937235d..f190220f 100644 --- a/src/services/kokkos/types.hpp +++ b/src/services/kokkos/types.hpp @@ -13,16 +13,16 @@ struct SpaceHandle { char name[64]; }; -using init_callback = util::callback; +using init_callback = util::callback; using finalize_callback = util::callback; using begin_kernel_callback = util::callback; -using end_kernel_callback = util::callback; +using end_kernel_callback = util::callback; using push_region_callback = util::callback; -using pop_region_callback = util::callback; +using pop_region_callback = util::callback; -using allocation_callback = util::callback; +using allocation_callback = util::callback; using deallocation_callback = util::callback; using begin_deep_copy_callback = util::callback< @@ -30,7 +30,7 @@ using begin_deep_copy_callback = util::callback< using end_deep_copy_callback = util::callback; using begin_fence_callback = util::callback; -using end_fence_callback = util::callback; +using end_fence_callback = util::callback; struct callbacks { diff --git a/src/services/ldms/LdmsForwarder.cpp b/src/services/ldms/LdmsForwarder.cpp index 5ac8d738..ef7ed3b0 100644 --- a/src/services/ldms/LdmsForwarder.cpp +++ b/src/services/ldms/LdmsForwarder.cpp @@ -82,13 +82,13 @@ ldms_t setup_connection(const char* xprt, const char* host, const char* port, co host = hostname; } if (!timeout) { - ts.tv_sec = time(NULL) + 5; + ts.tv_sec = time(NULL) + 5; ts.tv_nsec = 0; } else { int to = atoi(timeout); if (to <= 0) to = 5; - ts.tv_sec = time(NULL) + to; + ts.tv_sec = time(NULL) + to; ts.tv_nsec = 0; } @@ -115,10 +115,10 @@ ldms_t setup_connection(const char* xprt, const char* host, const char* port, co void caliper_ldms_connector_initialize() { const char* env_ldms_stream = getenv("CALIPER_LDMS_STREAM"); - const char* env_ldms_xprt = getenv("CALIPER_LDMS_XPRT"); - const char* env_ldms_host = getenv("CALIPER_LDMS_HOST"); - const char* env_ldms_port = getenv("CALIPER_LDMS_PORT"); - const char* env_ldms_auth = getenv("CALIPER_LDMS_AUTH"); + const char* env_ldms_xprt = getenv("CALIPER_LDMS_XPRT"); + const char* env_ldms_host = getenv("CALIPER_LDMS_HOST"); + const char* env_ldms_port = getenv("CALIPER_LDMS_PORT"); + const char* env_ldms_auth = getenv("CALIPER_LDMS_AUTH"); /* Check/set LDMS transport type */ if (!env_ldms_xprt || !env_ldms_host || !env_ldms_port || !env_ldms_auth) { @@ -160,14 +160,14 @@ void write_ldms_record(int mpi_rank, RegionProfile& profile) double total_time = 0; int buffer_size = 4096; - char* buffer = (char*) malloc(sizeof(char) * buffer_size); + char* buffer = (char*) malloc(sizeof(char) * buffer_size); - const char* env_ldms_jobid_str = getenv("SLURM_JOB_ID"); - const char* env_ldms_procid = getenv("SLURM_PROCID"); - const char* env_ldms_slurm_nodelist = getenv("SLURM_JOB_NODELIST"); + const char* env_ldms_jobid_str = getenv("SLURM_JOB_ID"); + const char* env_ldms_procid = getenv("SLURM_PROCID"); + const char* env_ldms_slurm_nodelist = getenv("SLURM_JOB_NODELIST"); const char* env_ldms_caliper_verbose_str = getenv("CALIPER_LDMS_VERBOSE"); - int env_ldms_jobid = env_ldms_jobid_str == NULL ? 0 : atoi(env_ldms_jobid_str); + int env_ldms_jobid = env_ldms_jobid_str == NULL ? 0 : atoi(env_ldms_jobid_str); int env_ldms_caliper_verbose = env_ldms_caliper_verbose_str == NULL ? 0 : atoi(env_ldms_caliper_verbose_str); std::tie(region_times, std::ignore, total_time) = profile.inclusive_region_times(); @@ -233,7 +233,7 @@ class LdmsForwarder void snapshot(Caliper* c, Channel*) { - Entry e = c->get(c->get_attribute("mpi.rank")); + Entry e = c->get(c->get_attribute("mpi.rank")); int rank = e.empty() ? -1 : e.value().to_int(); write_ldms_record(rank, profile); diff --git a/src/services/libpfm/Libpfm.cpp b/src/services/libpfm/Libpfm.cpp index 42e2488f..344c08a6 100644 --- a/src/services/libpfm/Libpfm.cpp +++ b/src/services/libpfm/Libpfm.cpp @@ -104,13 +104,13 @@ class LibpfmService std::vector sample_attributes_strvec; uint64_t sample_attributes = 0; - uint64_t signals_received = 0; - uint64_t samples_produced = 0; - uint64_t bad_samples = 0; - uint64_t null_events = 0; + uint64_t signals_received = 0; + uint64_t samples_produced = 0; + uint64_t bad_samples = 0; + uint64_t null_events = 0; uint64_t null_cali_instances = 0; - unsigned event_read_fail = 0; - unsigned event_reset_fail = 0; + unsigned event_read_fail = 0; + unsigned event_reset_fail = 0; /* * libpfm sampling variables @@ -135,7 +135,7 @@ class LibpfmService static Channel sC; static LibpfmService* sI; - const int signum = SIGIO; + const int signum = SIGIO; const int buffer_pages = 1; static pid_t gettid(void) { return (pid_t) syscall(__NR_gettid); } @@ -217,7 +217,7 @@ class LibpfmService void setup_process_events(Caliper* c) { int check_num_events = 0; - perf_event_desc_t* check_fds = NULL; + perf_event_desc_t* check_fds = NULL; int ret = perf_setup_list_events(events_string.c_str(), &check_fds, &check_num_events); if (ret || !check_num_events) @@ -248,7 +248,7 @@ class LibpfmService sT.tid = gettid(); // Get perf_event from string - sT.fds = NULL; + sT.fds = NULL; sT.num_events = 0; perf_setup_list_events(events_string.c_str(), &sT.fds, &sT.num_events); @@ -256,15 +256,15 @@ class LibpfmService for (i = 0; i < sT.num_events; i++) { // Set up perf_event - sT.fds[i].hw.disabled = 1; + sT.fds[i].hw.disabled = 1; sT.fds[i].hw.read_format = record_counters ? PERF_FORMAT_SCALE : 0; if (enable_sampling) { sT.fds[i].hw.wakeup_events = 1; - sT.fds[i].hw.sample_type = sample_attributes; + sT.fds[i].hw.sample_type = sample_attributes; sT.fds[i].hw.sample_period = sampling_period_list[i]; - sT.fds[i].hw.precise_ip = precise_ip_list[i]; - sT.fds[i].hw.config1 = config1_list[i]; + sT.fds[i].hw.precise_ip = precise_ip_list[i]; + sT.fds[i].hw.config1 = config1_list[i]; } sT.fds[i].fd = fd = perf_event_open(&sT.fds[i].hw, sT.tid, -1, -1, 0); @@ -277,8 +277,8 @@ class LibpfmService Log(0).stream() << "libpfm: fcntl SETFL failed" << std::endl; fown_ex.type = F_OWNER_TID; - fown_ex.pid = sT.tid; - ret = fcntl(fd, F_SETOWN_EX, (unsigned long) &fown_ex); + fown_ex.pid = sT.tid; + ret = fcntl(fd, F_SETOWN_EX, (unsigned long) &fown_ex); if (ret) Log(0).stream() << "libpfm: fcntl SETOWN failed" << std::endl; @@ -302,8 +302,8 @@ class LibpfmService sigemptyset(&set); sa.sa_sigaction = sigio_handler; - sa.sa_mask = set; - sa.sa_flags = SA_SIGINFO; + sa.sa_mask = set; + sa.sa_flags = SA_SIGINFO; if (sigaction(signum, &sa, NULL) != 0) Log(0).stream() << "libpfm: sigaction failed" << std::endl; @@ -355,7 +355,7 @@ class LibpfmService int end_thread_sampling() { - int ret = 0; + int ret = 0; size_t pgsz = sysconf(_SC_PAGESIZE); for (int i = 0; i < sT.num_events; i++) { @@ -372,7 +372,7 @@ class LibpfmService pfm_terminate(); sT.num_events = 0; - sT.fds = nullptr; + sT.fds = nullptr; return ret; } @@ -385,7 +385,7 @@ class LibpfmService record_counters = config.get("record_counters").to_bool(); events_string = config.get("events").to_string(); - event_list = StringConverter(events_string).to_stringlist(); + event_list = StringConverter(events_string).to_stringlist(); size_t events_listed = event_list.size(); @@ -459,8 +459,8 @@ class LibpfmService } sampling_period_strvec = config.get("sample_period").to_stringlist(); - precise_ip_strvec = config.get("precise_ip").to_stringlist(); - config1_strvec = config.get("config1").to_stringlist(); + precise_ip_strvec = config.get("precise_ip").to_stringlist(); + config1_strvec = config.get("config1").to_stringlist(); if (events_listed != sampling_period_strvec.size() || events_listed != precise_ip_strvec.size() || events_listed != config1_strvec.size()) { @@ -642,10 +642,10 @@ class LibpfmService uint64_t data_src = it->value().to_uint(); std::string mem_lvl = datasource_mem_lvl(data_src); - std::string hit = datasource_mem_hit(data_src); - std::string op = datasource_mem_op(data_src); - std::string snoop = datasource_mem_snoop(data_src); - std::string tlb = datasource_mem_tlb(data_src); + std::string hit = datasource_mem_hit(data_src); + std::string op = datasource_mem_op(data_src); + std::string snoop = datasource_mem_snoop(data_src); + std::string tlb = datasource_mem_tlb(data_src); Node* node = nullptr; diff --git a/src/services/libpfm/perf_postprocessing.cpp b/src/services/libpfm/perf_postprocessing.cpp index 80e08f10..7a673843 100644 --- a/src/services/libpfm/perf_postprocessing.cpp +++ b/src/services/libpfm/perf_postprocessing.cpp @@ -3,18 +3,18 @@ #include const std::string s_invalid = "Invalid"; -const std::string s_na = "Not Available"; +const std::string s_na = "Not Available"; -const std::string s_mem_lvl_l1 = "L1"; -const std::string s_mem_lvl_lfb = "LFB"; -const std::string s_mem_lvl_l2 = "L2"; -const std::string s_mem_lvl_l3 = "L3"; -const std::string s_mem_lvl_loc_ram = "Local RAM"; +const std::string s_mem_lvl_l1 = "L1"; +const std::string s_mem_lvl_lfb = "LFB"; +const std::string s_mem_lvl_l2 = "L2"; +const std::string s_mem_lvl_l3 = "L3"; +const std::string s_mem_lvl_loc_ram = "Local RAM"; const std::string s_mem_lvl_rem_ram1 = "Remote RAM 1 Hop"; const std::string s_mem_lvl_rem_ram2 = "Remote RAM 2 Hops"; -const std::string s_mem_lvl_cce1 = "Remote Cache 1 Hops"; -const std::string s_mem_lvl_cce2 = "Remote Cache 2 Hops"; -const std::string s_mem_lvl_io = "I/O Memory"; +const std::string s_mem_lvl_cce1 = "Remote Cache 1 Hops"; +const std::string s_mem_lvl_cce2 = "Remote Cache 2 Hops"; +const std::string s_mem_lvl_io = "I/O Memory"; const std::string s_mem_lvl_uncached = "Uncached Memory"; const std::string datasource_mem_lvl(uint64_t data_src) @@ -49,7 +49,7 @@ const std::string datasource_mem_lvl(uint64_t data_src) return s_invalid; } -const std::string s_mem_lvl_hit = "Hit"; +const std::string s_mem_lvl_hit = "Hit"; const std::string s_mem_lvl_miss = "Miss"; const std::string datasource_mem_hit(uint64_t datasource) @@ -66,11 +66,11 @@ const std::string datasource_mem_hit(uint64_t datasource) return s_invalid; } -const std::string s_mem_op_na = "Load"; -const std::string s_mem_op_load = "Load"; -const std::string s_mem_op_store = "Store"; +const std::string s_mem_op_na = "Load"; +const std::string s_mem_op_load = "Load"; +const std::string s_mem_op_store = "Store"; const std::string s_mem_op_pfetch = "Prefetch"; -const std::string s_mem_op_exec = "Exec"; +const std::string s_mem_op_exec = "Exec"; const std::string datasource_mem_op(uint64_t datasource) { @@ -91,7 +91,7 @@ const std::string datasource_mem_op(uint64_t datasource) } const std::string s_mem_snoop_none = "None"; -const std::string s_mem_snoop_hit = "Hit"; +const std::string s_mem_snoop_hit = "Hit"; const std::string s_mem_snoop_miss = "Miss"; const std::string s_mem_snoop_hitm = "Hit Modified"; @@ -113,12 +113,12 @@ const std::string datasource_mem_snoop(uint64_t datasource) return s_invalid; } -const std::string s_mem_tlb_hit = "Hit"; +const std::string s_mem_tlb_hit = "Hit"; const std::string s_mem_tlb_miss = "Miss"; -const std::string s_mem_tlb_l1 = "L1"; -const std::string s_mem_tlb_l2 = "L2"; -const std::string s_mem_tlb_wk = "Hardware Walker"; -const std::string s_mem_tlb_os = "OS Fault Handler"; +const std::string s_mem_tlb_l1 = "L1"; +const std::string s_mem_tlb_l2 = "L2"; +const std::string s_mem_tlb_wk = "Hardware Walker"; +const std::string s_mem_tlb_os = "OS Fault Handler"; const std::string datasource_mem_tlb(uint64_t datasource) { diff --git a/src/services/libpfm/perf_util.c b/src/services/libpfm/perf_util.c index 49db35e2..1794a93e 100644 --- a/src/services/libpfm/perf_util.c +++ b/src/services/libpfm/perf_util.c @@ -96,16 +96,16 @@ int perf_setup_argv_events(const char** argv, perf_event_desc_t** fds, int* num_ goto error; } - fd[num].name = strdup(*argv); + fd[num].name = strdup(*argv); fd[num].group_leader = group_leader; - fd[num].idx = arg.idx; - fd[num].cpu = arg.cpu; + fd[num].idx = arg.idx; + fd[num].cpu = arg.cpu; num++; argv++; } *num_fds = num; - *fds = fd; + *fds = fd; return 0; error: perf_free_fds(fd, num); @@ -142,12 +142,12 @@ int perf_setup_list_events(const char* ev, perf_event_desc_t** fd, int* num_fds) i = 0; q = events; while ((p = strchr(q, ','))) { - *p = '\0'; + *p = '\0'; argv[i++] = q; - q = p + 1; + q = p + 1; } argv[i++] = q; - argv[i] = NULL; + argv[i] = NULL; ret = perf_setup_argv_events(argv, fd, num_fds); free(argv); @@ -190,7 +190,7 @@ int perf_get_group_nevents(perf_event_desc_t* fds, int num, int idx) int perf_read_buffer(perf_event_desc_t* hw, void* buf, size_t sz) { - struct perf_event_mmap_page* hdr = hw->buf; + struct perf_event_mmap_page* hdr = hw->buf; size_t pgmsk = hw->pgmsk; void* data; unsigned long tail; @@ -401,7 +401,7 @@ int perf_display_sample(perf_event_desc_t* fds, int num_fds, int idx, struct per hw = fds + idx; type = hw->hw.sample_type; - fmt = hw->hw.read_format; + fmt = hw->hw.read_format; if (type & PERF_SAMPLE_IDENTIFIER) { ret = perf_read_buffer_64(hw, &val64); @@ -420,7 +420,7 @@ int perf_display_sample(perf_event_desc_t* fds, int num_fds, int idx, struct per */ if (type & PERF_SAMPLE_IP) { const char* xtra = " "; - ret = perf_read_buffer_64(hw, &val64); + ret = perf_read_buffer_64(hw, &val64); if (ret) { warnx("cannot read IP"); return -1; @@ -571,7 +571,7 @@ int perf_display_sample(perf_event_desc_t* fds, int num_fds, int idx, struct per values[2] = time_running; while (nr--) { grp.id = -1; - ret = perf_read_buffer_64(hw, &grp.value); + ret = perf_read_buffer_64(hw, &grp.value); if (ret) { warnx("cannot read group value"); return -1; @@ -648,7 +648,7 @@ int perf_display_sample(perf_event_desc_t* fds, int num_fds, int idx, struct per values[0] = val64; values[1] = time_enabled; values[2] = time_running; - val64 = perf_scale(values); + val64 = perf_scale(values); fprintf(fp, "\t%'" PRIu64 " %s %s\n", val64, fds[0].name, time_running != time_enabled ? ", scaled" : ""); } @@ -808,7 +808,7 @@ int perf_read_sample( hw = fds + idx; type = hw->hw.sample_type; - fmt = hw->hw.read_format; + fmt = hw->hw.read_format; if (type & PERF_SAMPLE_IDENTIFIER) { ret = perf_read_buffer_64(hw, &val64); @@ -966,7 +966,7 @@ int perf_read_sample( values[2] = time_running; while (nr--) { grp.id = -1; - ret = perf_read_buffer_64(hw, &grp.value); + ret = perf_read_buffer_64(hw, &grp.value); if (ret) { fprintf(ferr, "libpfm: cannot read group value"); return -1; @@ -1039,7 +1039,7 @@ int perf_read_sample( values[0] = val64; values[1] = time_enabled; values[2] = time_running; - val64 = perf_scale(values); + val64 = perf_scale(values); // fprintf(fp, "\t%'"PRIu64" %s %s\n", // val64, fds[0].name, diff --git a/src/services/libpfm/perf_util.h b/src/services/libpfm/perf_util.h index 24a85df5..e13e75cd 100644 --- a/src/services/libpfm/perf_util.h +++ b/src/services/libpfm/perf_util.h @@ -128,10 +128,10 @@ static inline uint64_t perf_scale_delta(uint64_t* values, uint64_t* prev_values) pval[0] = prev_values[0]; pval[1] = prev_values[1]; pval[2] = prev_values[2]; - val[0] = values[0]; - val[1] = values[1]; - val[2] = values[2]; - res = (uint64_t) (((val[0] - pval[0]) * (val[1] - pval[1]) / (val[2] - pval[2]))); + val[0] = values[0]; + val[1] = values[1]; + val[2] = values[2]; + res = (uint64_t) (((val[0] - pval[0]) * (val[1] - pval[1]) / (val[2] - pval[2]))); } return res; } diff --git a/src/services/memusage/MemStatService.cpp b/src/services/memusage/MemStatService.cpp index 9b53682f..5917df01 100644 --- a/src/services/memusage/MemStatService.cpp +++ b/src/services/memusage/MemStatService.cpp @@ -23,7 +23,7 @@ namespace inline std::array parse_statm(const char* buf, ssize_t max) { std::array numbers = { 0, 0, 0, 0, 0, 0 }; - int nn = 0; + int nn = 0; for (ssize_t n = 0; n < max && nn < 6; ++n) { char c = buf[n]; diff --git a/src/services/monitor/LoopMonitor.cpp b/src/services/monitor/LoopMonitor.cpp index 13cb4bc8..6d92aeba 100644 --- a/src/services/monitor/LoopMonitor.cpp +++ b/src/services/monitor/LoopMonitor.cpp @@ -61,11 +61,11 @@ class LoopMonitor { Entry data[] = { { num_iterations_attr, Variant(num_iterations) }, { start_iteration_attr, Variant(start_iteration) } }; - size_t n = start_iteration >= 0 ? 2 : 1; + size_t n = start_iteration >= 0 ? 2 : 1; c->push_snapshot(channel, SnapshotView(n, data)); start_iteration = -1; - num_iterations = 0; + num_iterations = 0; ++num_snapshots; last_snapshot_time = std::chrono::high_resolution_clock::now(); @@ -138,8 +138,8 @@ class LoopMonitor ConfigSet config = services::init_config_from_spec(channel->config(), s_spec); iteration_interval = config.get("iteration_interval").to_int(); - time_interval = config.get("time_interval").to_double(); - target_loops = config.get("target_loops").to_stringlist(); + time_interval = config.get("time_interval").to_double(); + target_loops = config.get("target_loops").to_stringlist(); } public: diff --git a/src/services/monitor/RegionMonitor.cpp b/src/services/monitor/RegionMonitor.cpp index b5d7f078..bc3608cd 100644 --- a/src/services/monitor/RegionMonitor.cpp +++ b/src/services/monitor/RegionMonitor.cpp @@ -56,7 +56,7 @@ class RegionMonitor SnapshotBuilder tmp; c->pull_snapshot(channel, SnapshotView(), tmp); m_measuring = true; - m_skip = 1; + m_skip = 1; } } } @@ -79,7 +79,7 @@ class RegionMonitor if (!node) return; - auto now = std::chrono::high_resolution_clock::now(); + auto now = std::chrono::high_resolution_clock::now(); auto prev = m_time_stack.back(); m_time_stack.pop_back(); @@ -120,7 +120,7 @@ class RegionMonitor RegionMonitor(Caliper*, Channel* channel) : m_measuring(false), m_skip(0), m_num_measured(0) { ConfigSet config = services::init_config_from_spec(channel->config(), s_spec); - m_min_interval = config.get("time_interval").to_double(); + m_min_interval = config.get("time_interval").to_double(); } public: diff --git a/src/services/monitor/Timeseries.cpp b/src/services/monitor/Timeseries.cpp index 87bf6732..be6887aa 100644 --- a/src/services/monitor/Timeseries.cpp +++ b/src/services/monitor/Timeseries.cpp @@ -106,7 +106,7 @@ class TimeseriesService { std::string profile_cfg_str = "timeseries.profile"; - ConfigSet cfg = services::init_config_from_spec(channel->config(), s_spec); + ConfigSet cfg = services::init_config_from_spec(channel->config(), s_spec); std::string profile_opts = cfg.get("profile.options").to_string(); if (profile_opts.size() > 0) profile_cfg_str.append("(").append(profile_opts).append(")"); diff --git a/src/services/mpireport/MpiReport.cpp b/src/services/mpireport/MpiReport.cpp index e1725628..086673a9 100644 --- a/src/services/mpireport/MpiReport.cpp +++ b/src/services/mpireport/MpiReport.cpp @@ -41,7 +41,7 @@ class MpiReport // check if we can use MPI int initialized = 0; - int finalized = 0; + int finalized = 0; PMPI_Initialized(&initialized); PMPI_Finalized(&finalized); diff --git a/src/services/mpit/MpitServiceMPI.cpp b/src/services/mpit/MpitServiceMPI.cpp index 21af2a72..edecf088 100644 --- a/src/services/mpit/MpitServiceMPI.cpp +++ b/src/services/mpit/MpitServiceMPI.cpp @@ -88,7 +88,7 @@ std::vector pvar_selection; std::vector pvars; MPI_T_pvar_session pvar_session; -unsigned num_pvars_read = 0; +unsigned num_pvars_read = 0; unsigned num_pvars_read_error = 0; //Arrays storing last values of PVARs. This is a hack. Only in place because current MPI implementations do not @@ -453,8 +453,8 @@ void do_mpit_allocate_pvar_handles(Caliper* c) char namebuf[NAME_LEN] = { 0 }; char descbuf[NAME_LEN] = { 0 }; - int namelen = NAME_LEN; - int desclen = NAME_LEN; + int namelen = NAME_LEN; + int desclen = NAME_LEN; MPI_T_enum enumtype; @@ -516,7 +516,7 @@ void do_mpit_allocate_pvar_handles(Caliper* c) int count; MPI_Comm comm = MPI_COMM_WORLD; - ret = MPI_T_pvar_handle_alloc(pvar_session, index, &comm, &handle, &count); + ret = MPI_T_pvar_handle_alloc(pvar_session, index, &comm, &handle, &count); if (ret == MPI_SUCCESS) { pvi.handles.push_back(handle); @@ -526,7 +526,7 @@ void do_mpit_allocate_pvar_handles(Caliper* c) } comm = MPI_COMM_SELF; - ret = MPI_T_pvar_handle_alloc(pvar_session, index, &comm, &handle, &count); + ret = MPI_T_pvar_handle_alloc(pvar_session, index, &comm, &handle, &count); if (ret == MPI_SUCCESS) { pvi.handles.push_back(handle); diff --git a/src/services/mpiwrap/MpiPattern.cpp b/src/services/mpiwrap/MpiPattern.cpp index a54bbeff..9cdd23e3 100644 --- a/src/services/mpiwrap/MpiPattern.cpp +++ b/src/services/mpiwrap/MpiPattern.cpp @@ -104,9 +104,9 @@ struct MpiPattern::MpiPatternImpl { int total_send_count = 0; int total_recv_count = 0; int total_coll_count = 0; - int total_send_size = 0; - int total_recv_size = 0; - int total_coll_size = 0; + int total_send_size = 0; + int total_recv_size = 0; + int total_coll_size = 0; std::set unique_src_ranks; std::set unique_dest_ranks; @@ -132,12 +132,12 @@ struct MpiPattern::MpiPatternImpl { { RequestInfo info; - info.op = RequestInfo::Send; + info.op = RequestInfo::Send; info.is_persistent = true; - info.target = dest; - info.tag = tag; - info.count = count; - info.type = type; + info.target = dest; + info.tag = tag; + info.count = count; + info.type = type; PMPI_Type_size(type, &info.size); info.size *= count; @@ -178,12 +178,12 @@ struct MpiPattern::MpiPatternImpl { { RequestInfo info; - info.op = RequestInfo::Recv; + info.op = RequestInfo::Recv; info.is_persistent = false; - info.target = src; - info.tag = tag; - info.type = type; - info.count = count; + info.target = src; + info.tag = tag; + info.type = type; + info.count = count; std::lock_guard g(req_map_lock); @@ -203,13 +203,13 @@ struct MpiPattern::MpiPatternImpl { { RequestInfo info; - info.op = RequestInfo::Recv; + info.op = RequestInfo::Recv; info.is_persistent = true; - info.target = src; - info.tag = tag; - info.type = type; - info.count = count; - info.size = 0; + info.target = src; + info.tag = tag; + info.type = type; + info.count = count; + info.size = 0; std::lock_guard g(req_map_lock); @@ -280,9 +280,9 @@ struct MpiPattern::MpiPatternImpl { total_send_count = 0; total_recv_count = 0; total_coll_count = 0; - total_recv_size = 0; - total_send_size = 0; - total_coll_size = 0; + total_recv_size = 0; + total_send_size = 0; + total_coll_size = 0; unique_dest_ranks.clear(); unique_src_ranks.clear(); diff --git a/src/services/mpiwrap/MpiTracing.cpp b/src/services/mpiwrap/MpiTracing.cpp index eda6cbdf..24cb5b4e 100644 --- a/src/services/mpiwrap/MpiTracing.cpp +++ b/src/services/mpiwrap/MpiTracing.cpp @@ -167,7 +167,7 @@ struct MpiTracing::MpiTracingImpl { if (it != comm_map.end()) return it->second; - Node* node = make_comm_entry(c, comm); + Node* node = make_comm_entry(c, comm); comm_map[comm] = node; return node; @@ -200,13 +200,13 @@ struct MpiTracing::MpiTracingImpl { { RequestInfo info; - info.op = RequestInfo::Send; + info.op = RequestInfo::Send; info.is_persistent = true; - info.target = dest; - info.tag = tag; - info.count = count; - info.type = type; - info.comm_node = lookup_comm(c, comm); + info.target = dest; + info.tag = tag; + info.count = count; + info.type = type; + info.comm_node = lookup_comm(c, comm); PMPI_Type_size(type, &info.size); info.size *= count; @@ -250,13 +250,13 @@ struct MpiTracing::MpiTracingImpl { { RequestInfo info; - info.op = RequestInfo::Recv; + info.op = RequestInfo::Recv; info.is_persistent = false; - info.target = src; - info.tag = tag; - info.type = type; - info.count = count; - info.comm_node = lookup_comm(c, comm); + info.target = src; + info.tag = tag; + info.type = type; + info.count = count; + info.comm_node = lookup_comm(c, comm); std::lock_guard g(req_map_lock); @@ -276,14 +276,14 @@ struct MpiTracing::MpiTracingImpl { { RequestInfo info; - info.op = RequestInfo::Recv; + info.op = RequestInfo::Recv; info.is_persistent = true; - info.target = src; - info.tag = tag; - info.type = type; - info.count = count; - info.comm_node = lookup_comm(c, comm); - info.size = 0; + info.target = src; + info.tag = tag; + info.type = type; + info.count = count; + info.comm_node = lookup_comm(c, comm); + info.size = 0; std::lock_guard g(req_map_lock); diff --git a/src/services/nvtx/Nvtx.cpp b/src/services/nvtx/Nvtx.cpp index 20eedbe2..5f4285ea 100644 --- a/src/services/nvtx/Nvtx.cpp +++ b/src/services/nvtx/Nvtx.cpp @@ -41,7 +41,7 @@ class NvtxBinding : public AnnotationBinding uint32_t get_attribute_color(const Attribute& attr) { cali_id_t color_attr_id = m_color_attr.id(); - const Node* node = nullptr; + const Node* node = nullptr; for (node = attr.node()->first_child(); node; node = node->next_sibling()) if (node->attribute() == color_attr_id) @@ -53,7 +53,7 @@ class NvtxBinding : public AnnotationBinding uint32_t get_value_color(const Variant& value) { std::string valstr = value.to_string(); - uint32_t color = s_colors[0]; + uint32_t color = s_colors[0]; { std::lock_guard g(m_color_map_mutex); @@ -110,10 +110,10 @@ class NvtxBinding : public AnnotationBinding { nvtxEventAttributes_t eventAttrib = { 0 }; - eventAttrib.version = NVTX_VERSION; - eventAttrib.size = NVTX_EVENT_ATTRIB_STRUCT_SIZE; - eventAttrib.colorType = NVTX_COLOR_ARGB; - eventAttrib.color = get_color(attr, value); + eventAttrib.version = NVTX_VERSION; + eventAttrib.size = NVTX_EVENT_ATTRIB_STRUCT_SIZE; + eventAttrib.colorType = NVTX_COLOR_ARGB; + eventAttrib.color = get_color(attr, value); eventAttrib.messageType = NVTX_MESSAGE_TYPE_ASCII; eventAttrib.message.ascii = (value.type() == CALI_TYPE_STRING ? static_cast(value.data()) : value.to_string().c_str()); diff --git a/src/services/ompt/OmptService.cpp b/src/services/ompt/OmptService.cpp index 936db524..c95cca28 100644 --- a/src/services/ompt/OmptService.cpp +++ b/src/services/ompt/OmptService.cpp @@ -26,11 +26,11 @@ struct OmptAPI { bool init(ompt_function_lookup_t lookup) { - set_callback = (ompt_set_callback_t) (*lookup)("ompt_set_callback"); - get_state = (ompt_get_state_t) (*lookup)("ompt_get_state"); + set_callback = (ompt_set_callback_t) (*lookup)("ompt_set_callback"); + get_state = (ompt_get_state_t) (*lookup)("ompt_get_state"); enumerate_states = (ompt_enumerate_states_t) (*lookup)("ompt_enumerate_states"); - get_proc_id = (ompt_get_proc_id_t) (*lookup)("ompt_get_proc_id"); - finalize_tool = (ompt_finalize_tool_t) (*lookup)("ompt_finalize_tool"); + get_proc_id = (ompt_get_proc_id_t) (*lookup)("ompt_get_proc_id"); + finalize_tool = (ompt_finalize_tool_t) (*lookup)("ompt_finalize_tool"); if (!set_callback || !get_state || !enumerate_states || !get_proc_id || !finalize_tool) return false; @@ -291,7 +291,7 @@ void create_attributes(Caliper* c) c->create_attribute("omp.sync", CALI_TYPE_STRING, CALI_ATTR_SCOPE_THREAD, 1, &subscription_attr, &v_true); work_attr = c->create_attribute("omp.work", CALI_TYPE_STRING, CALI_ATTR_SCOPE_THREAD, 1, &subscription_attr, &v_true); - state_attr = c->create_attribute("omp.state", CALI_TYPE_STRING, CALI_ATTR_SCOPE_THREAD | CALI_ATTR_SKIP_EVENTS); + state_attr = c->create_attribute("omp.state", CALI_TYPE_STRING, CALI_ATTR_SCOPE_THREAD | CALI_ATTR_SKIP_EVENTS); proc_id_attr = c->create_attribute( "omp.proc.id", CALI_TYPE_INT, diff --git a/src/services/papi/Papi.cpp b/src/services/papi/Papi.cpp index e0dc34a0..959e5fd8 100644 --- a/src/services/papi/Papi.cpp +++ b/src/services/papi/Papi.cpp @@ -104,7 +104,7 @@ class PapiService } int code = PAPI_NULL; - int ret = PAPI_event_name_to_code(namebuf, &code); + int ret = PAPI_event_name_to_code(namebuf, &code); if (ret != PAPI_OK) { print_papi_error("PAPI_event_name_to_code()", ret); continue; @@ -198,7 +198,7 @@ class PapiService if (ok) { ThreadInfo* td = new ThreadInfo; - td->eventsets = std::move(eventsets); + td->eventsets = std::move(eventsets); { std::lock_guard g(m_thread_lock); @@ -206,7 +206,7 @@ class PapiService if (m_thread_list) m_thread_list->prev = td; - td->next = m_thread_list; + td->next = m_thread_list; m_thread_list = td; m_num_eventsets += static_cast(td->eventsets.size()); @@ -282,7 +282,7 @@ class PapiService void finish_eventset(int eventset) { int state = PAPI_NULL; - int ret = PAPI_state(eventset, &state); + int ret = PAPI_state(eventset, &state); if (ret != PAPI_OK) { print_papi_error("PAPI_state()", ret); return; @@ -429,7 +429,7 @@ class PapiService static void register_papi(Caliper* c, Channel* channel) { - auto cfg = services::init_config_from_spec(channel->config(), s_spec); + auto cfg = services::init_config_from_spec(channel->config(), s_spec); auto eventlist = cfg.get("counters").to_stringlist(","); if (eventlist.empty()) { diff --git a/src/services/pcp/Pcp.cpp b/src/services/pcp/Pcp.cpp index d587b803..92ca0f04 100644 --- a/src/services/pcp/Pcp.cpp +++ b/src/services/pcp/Pcp.cpp @@ -115,8 +115,8 @@ class PcpService std::vector info; for (const std::string& name : names) { - pmID pmid = PM_ID_NULL; - const char* namep = name.data(); + pmID pmid = PM_ID_NULL; + const char* namep = name.data(); int status = pmLookupName(1, &namep, &pmid); if (status != 1) { @@ -166,7 +166,7 @@ class PcpService PcpService(Caliper* c, Channel* channel) { Attribute unit_attr = c->create_attribute("time.unit", CALI_TYPE_STRING, CALI_ATTR_SKIP_EVENTS); - Variant sec_val = Variant("sec"); + Variant sec_val = Variant("sec"); m_timestamp_sec_attr = c->create_attribute( "pcp.timestamp.sec", @@ -257,7 +257,7 @@ class PcpService }; int PcpService::s_num_instances = 0; -int PcpService::s_pcp_context = -1; +int PcpService::s_pcp_context = -1; const ConfigSet::Entry PcpService::s_configdata[] = { { "metrics", diff --git a/src/services/pcp/PcpMemory.cpp b/src/services/pcp/PcpMemory.cpp index 3f6bce9e..c8a62fe9 100644 --- a/src/services/pcp/PcpMemory.cpp +++ b/src/services/pcp/PcpMemory.cpp @@ -55,7 +55,7 @@ std::vector find_counter_attributes(const CaliperMetadataAccessInterf std::pair sum_attributes(const std::vector& rec, const std::vector& attributes) { - double sum = 0.0; + double sum = 0.0; int count = 0; for (const Attribute& a : attributes) { diff --git a/src/services/pthread/PthreadService.cpp b/src/services/pthread/PthreadService.cpp index 8f33e8bd..c48fbc60 100644 --- a/src/services/pthread/PthreadService.cpp +++ b/src/services/pthread/PthreadService.cpp @@ -45,7 +45,7 @@ void* thread_wrapper(void* arg) c.set(id_attr, Variant(cali_make_variant_from_uint(id))); wrapper_args* wrap = static_cast(arg); - void* ret = (*(wrap->fn))(wrap->arg); + void* ret = (*(wrap->fn))(wrap->arg); delete wrap; return ret; diff --git a/src/services/recorder/Recorder.cpp b/src/services/recorder/Recorder.cpp index 739a81c4..a44b828c 100644 --- a/src/services/recorder/Recorder.cpp +++ b/src/services/recorder/Recorder.cpp @@ -49,7 +49,7 @@ void write_output_cb(Caliper* c, Channel* chn, SnapshotView flush_info) { ConfigSet cfg = services::init_config_from_spec(chn->config(), spec); - std::string filename = cfg.get("filename").to_string(); + std::string filename = cfg.get("filename").to_string(); std::string directory = cfg.get("directory").to_string(); if (filename.empty()) diff --git a/src/services/rocprofiler/RocProfiler.cpp b/src/services/rocprofiler/RocProfiler.cpp index ca57e2d2..82a5c7bd 100644 --- a/src/services/rocprofiler/RocProfiler.cpp +++ b/src/services/rocprofiler/RocProfiler.cpp @@ -84,8 +84,8 @@ class RocProfilerService Attribute m_flush_region_attr; - bool m_enable_api_callbacks = false; - bool m_enable_activity_tracing = false; + bool m_enable_api_callbacks = false; + bool m_enable_activity_tracing = false; bool m_enable_snapshot_timestamps = false; unsigned m_num_activity_records = 0; @@ -134,14 +134,14 @@ class RocProfilerService CALI_ATTR_SCOPE_THREAD | CALI_ATTR_ASVALUE | CALI_ATTR_SKIP_EVENTS | CALI_ATTR_AGGREGATABLE ); - m_activity_name_attr = c->create_attribute("rocm.activity", CALI_TYPE_STRING, CALI_ATTR_SKIP_EVENTS); - m_activity_queue_id_attr = c->create_attribute("rocm.activity.queue", CALI_TYPE_UINT, CALI_ATTR_SKIP_EVENTS); + m_activity_name_attr = c->create_attribute("rocm.activity", CALI_TYPE_STRING, CALI_ATTR_SKIP_EVENTS); + m_activity_queue_id_attr = c->create_attribute("rocm.activity.queue", CALI_TYPE_UINT, CALI_ATTR_SKIP_EVENTS); m_activity_device_id_attr = c->create_attribute("rocm.activity.device", CALI_TYPE_UINT, CALI_ATTR_SKIP_EVENTS); - m_activity_bytes_attr = c->create_attribute("rocm.activity.bytes", CALI_TYPE_UINT, CALI_ATTR_SKIP_EVENTS); - m_kernel_name_attr = c->create_attribute("rocm.kernel.name", CALI_TYPE_STRING, CALI_ATTR_SKIP_EVENTS); - m_src_agent_attr = c->create_attribute("rocm.src.agent", CALI_TYPE_UINT, CALI_ATTR_SKIP_EVENTS); - m_dst_agent_attr = c->create_attribute("rocm.dst.agent", CALI_TYPE_UINT, CALI_ATTR_SKIP_EVENTS); - m_agent_attr = c->create_attribute("rocm.agent", CALI_TYPE_UINT, CALI_ATTR_SKIP_EVENTS); + m_activity_bytes_attr = c->create_attribute("rocm.activity.bytes", CALI_TYPE_UINT, CALI_ATTR_SKIP_EVENTS); + m_kernel_name_attr = c->create_attribute("rocm.kernel.name", CALI_TYPE_STRING, CALI_ATTR_SKIP_EVENTS); + m_src_agent_attr = c->create_attribute("rocm.src.agent", CALI_TYPE_UINT, CALI_ATTR_SKIP_EVENTS); + m_dst_agent_attr = c->create_attribute("rocm.dst.agent", CALI_TYPE_UINT, CALI_ATTR_SKIP_EVENTS); + m_agent_attr = c->create_attribute("rocm.agent", CALI_TYPE_UINT, CALI_ATTR_SKIP_EVENTS); m_flush_region_attr = c->create_attribute("rocprofiler.flush", CALI_TYPE_STRING, CALI_ATTR_SCOPE_THREAD | CALI_ATTR_DEFAULT); @@ -285,7 +285,7 @@ class RocProfilerService } else { if (record.phase == ROCPROFILER_CALLBACK_PHASE_ENTER) { const char* name = nullptr; - uint64_t len = 0; + uint64_t len = 0; ROCPROFILER_CALL( rocprofiler_query_callback_tracing_kind_operation_name(record.kind, record.operation, &name, &len) ); @@ -359,8 +359,8 @@ class RocProfilerService { auto config = services::init_config_from_spec(channel->config(), s_spec); - m_enable_api_callbacks = config.get("enable_api_callbacks").to_bool(); - m_enable_activity_tracing = config.get("enable_activity_tracing").to_bool(); + m_enable_api_callbacks = config.get("enable_api_callbacks").to_bool(); + m_enable_activity_tracing = config.get("enable_activity_tracing").to_bool(); m_enable_snapshot_timestamps = config.get("enable_snapshot_timestamps").to_bool(); create_attributes(c); @@ -515,8 +515,8 @@ class RocProfilerService RocProfilerService* RocProfilerService::s_instance = nullptr; -rocprofiler_context_id_t RocProfilerService::hip_api_ctx = {}; -rocprofiler_context_id_t RocProfilerService::activity_ctx = {}; +rocprofiler_context_id_t RocProfilerService::hip_api_ctx = {}; +rocprofiler_context_id_t RocProfilerService::activity_ctx = {}; rocprofiler_context_id_t RocProfilerService::rocprofiler_ctx = {}; rocprofiler_buffer_id_t RocProfilerService::activity_buf = {}; diff --git a/src/services/rocprofiler/RocTX.cpp b/src/services/rocprofiler/RocTX.cpp index 2df6c501..1d7eaf63 100644 --- a/src/services/rocprofiler/RocTX.cpp +++ b/src/services/rocprofiler/RocTX.cpp @@ -59,7 +59,7 @@ class RocTXBinding : public AnnotationBinding if (roctxRangePop() < 0) ++m_num_stack_errors; } else { - bool found = false; + bool found = false; roctx_range_id_t roctx_id = 0; { @@ -69,7 +69,7 @@ class RocTXBinding : public AnnotationBinding if (it != m_range_map.end() && it->second.size() > 0) { roctx_id = it->second.back(); - found = true; + found = true; it->second.pop_back(); } } diff --git a/src/services/roctracer/RocTracer.cpp b/src/services/roctracer/RocTracer.cpp index f8aa7c2e..dbf6da10 100644 --- a/src/services/roctracer/RocTracer.cpp +++ b/src/services/roctracer/RocTracer.cpp @@ -89,11 +89,11 @@ class RocTracerService CALI_ATTR_ASVALUE | CALI_ATTR_SKIP_EVENTS | CALI_ATTR_AGGREGATABLE ); - m_activity_name_attr = c->create_attribute("rocm.activity", CALI_TYPE_STRING, CALI_ATTR_SKIP_EVENTS); - m_activity_queue_id_attr = c->create_attribute("rocm.activity.queue", CALI_TYPE_UINT, CALI_ATTR_SKIP_EVENTS); + m_activity_name_attr = c->create_attribute("rocm.activity", CALI_TYPE_STRING, CALI_ATTR_SKIP_EVENTS); + m_activity_queue_id_attr = c->create_attribute("rocm.activity.queue", CALI_TYPE_UINT, CALI_ATTR_SKIP_EVENTS); m_activity_device_id_attr = c->create_attribute("rocm.activity.device", CALI_TYPE_UINT, CALI_ATTR_SKIP_EVENTS); - m_activity_bytes_attr = c->create_attribute("rocm.activity.bytes", CALI_TYPE_UINT, CALI_ATTR_SKIP_EVENTS); - m_kernel_name_attr = c->create_attribute("rocm.kernel.name", CALI_TYPE_STRING, CALI_ATTR_SKIP_EVENTS); + m_activity_bytes_attr = c->create_attribute("rocm.activity.bytes", CALI_TYPE_UINT, CALI_ATTR_SKIP_EVENTS); + m_kernel_name_attr = c->create_attribute("rocm.kernel.name", CALI_TYPE_STRING, CALI_ATTR_SKIP_EVENTS); m_flush_region_attr = c->create_attribute("roctracer.flush", CALI_TYPE_STRING, CALI_ATTR_DEFAULT); } @@ -158,7 +158,7 @@ class RocTracerService return; auto instance = static_cast(arg); - auto data = static_cast(callback_data); + auto data = static_cast(callback_data); Caliper c; if (data->phase == ACTIVITY_API_PHASE_ENTER) { @@ -249,7 +249,7 @@ class RocTracerService if (!kernel.empty()) { kernel = util::demangle(kernel.c_str()); - node = c.make_tree_entry(instance->m_kernel_name_attr, Variant(kernel.c_str()), node); + node = c.make_tree_entry(instance->m_kernel_name_attr, Variant(kernel.c_str()), node); } if (node) { @@ -308,7 +308,7 @@ class RocTracerService unsigned num_flushed = 0; unsigned num_records = 0; - const roctracer_record_t* record = reinterpret_cast(begin); + const roctracer_record_t* record = reinterpret_cast(begin); const roctracer_record_t* end_record = reinterpret_cast(end); while (record < end_record) { @@ -508,9 +508,9 @@ class RocTracerService { auto config = services::init_config_from_spec(channel->config(), s_spec); - m_enable_tracing = config.get("trace_activities").to_bool(); - m_record_names = config.get("record_kernel_names").to_bool(); - m_record_host_duration = config.get("snapshot_duration").to_bool(); + m_enable_tracing = config.get("trace_activities").to_bool(); + m_record_names = config.get("record_kernel_names").to_bool(); + m_record_host_duration = config.get("snapshot_duration").to_bool(); m_record_host_timestamp = config.get("snapshot_timestamps").to_bool(); create_callback_attributes(c); diff --git a/src/services/roctx/RocTX.cpp b/src/services/roctx/RocTX.cpp index 13c80584..d4d15637 100644 --- a/src/services/roctx/RocTX.cpp +++ b/src/services/roctx/RocTX.cpp @@ -59,7 +59,7 @@ class RocTXBinding : public AnnotationBinding if (roctxRangePop() < 0) ++m_num_stack_errors; } else { - bool found = false; + bool found = false; roctx_range_id_t roctx_id = 0; { @@ -69,7 +69,7 @@ class RocTXBinding : public AnnotationBinding if (it != m_range_map.end() && it->second.size() > 0) { roctx_id = it->second.back(); - found = true; + found = true; it->second.pop_back(); } } diff --git a/src/services/sampler/Sampler.cpp b/src/services/sampler/Sampler.cpp index 5e1207ea..bfdaba36 100644 --- a/src/services/sampler/Sampler.cpp +++ b/src/services/sampler/Sampler.cpp @@ -45,7 +45,7 @@ Attribute ucursor_attr; int nsec_interval = 0; -int n_samples = 0; +int n_samples = 0; int n_processed_samples = 0; Channel channel; @@ -112,7 +112,7 @@ void setup_signal() memset(&act, 0, sizeof(act)); act.sa_sigaction = on_prof; - act.sa_flags = SA_RESTART | SA_SIGINFO; + act.sa_flags = SA_RESTART | SA_SIGINFO; sigaction(SIGPROF, &act, NULL); } @@ -132,9 +132,9 @@ void setup_settimer(Caliper* c) std::memset(&sev, 0, sizeof(sev)); - sev.sigev_notify = SIGEV_THREAD_ID; // Linux-specific! + sev.sigev_notify = SIGEV_THREAD_ID; // Linux-specific! sev._sigev_un._tid = syscall(SYS_gettid); - sev.sigev_signo = SIGPROF; + sev.sigev_signo = SIGPROF; TimerWrap* twrap = new TimerWrap; @@ -145,10 +145,10 @@ void setup_settimer(Caliper* c) struct itimerspec spec; - spec.it_interval.tv_sec = 0; + spec.it_interval.tv_sec = 0; spec.it_interval.tv_nsec = nsec_interval; - spec.it_value.tv_sec = 0; - spec.it_value.tv_nsec = nsec_interval; + spec.it_value.tv_sec = 0; + spec.it_value.tv_nsec = nsec_interval; if (timer_settime(twrap->timer, 0, &spec, NULL) == -1) { Log(0).stream() << "Sampler: timer_settime() failed" << std::endl; @@ -202,7 +202,7 @@ void finish_cb(Caliper* c, Channel* chn) Log(1).stream() << chn->name() << ": Sampler: processed " << n_processed_samples << " samples (" << n_samples << " total, " << n_samples - n_processed_samples << " dropped)." << endl; - n_samples = 0; + n_samples = 0; n_processed_samples = 0; channel = Channel(); @@ -243,7 +243,7 @@ void sampler_register(Caliper* c, Channel* chn) int frequency = config.get("frequency").to_int(); // some sanity checking - frequency = std::min(std::max(frequency, 1), 10000); + frequency = std::min(std::max(frequency, 1), 10000); nsec_interval = 1000000000 / frequency; c->set(chn, c->create_attribute("sample.frequency", CALI_TYPE_INT, CALI_ATTR_GLOBAL), Variant(frequency)); diff --git a/src/services/statistics/Statistics.cpp b/src/services/statistics/Statistics.cpp index a7dd06f8..e99617c6 100644 --- a/src/services/statistics/Statistics.cpp +++ b/src/services/statistics/Statistics.cpp @@ -48,11 +48,11 @@ class Statistics auto vec = c->get_all_attributes(); - unsigned n_global = 0; + unsigned n_global = 0; unsigned n_hidden_ref = 0; unsigned n_hidden_val = 0; - unsigned n_val = 0; - unsigned n_ref = 0; + unsigned n_val = 0; + unsigned n_ref = 0; for (const Attribute& attr : vec) { if (attr.is_hidden()) { diff --git a/src/services/symbollookup/LookupLibdw.cpp b/src/services/symbollookup/LookupLibdw.cpp index ab7233d6..6b827e5e 100644 --- a/src/services/symbollookup/LookupLibdw.cpp +++ b/src/services/symbollookup/LookupLibdw.cpp @@ -26,10 +26,10 @@ Dwfl_Callbacks* get_dwfl_callbacks() static Dwfl_Callbacks callbacks; if (!initialized) { - callbacks.find_elf = dwfl_linux_proc_find_elf; + callbacks.find_elf = dwfl_linux_proc_find_elf; callbacks.find_debuginfo = dwfl_standard_find_debuginfo; callbacks.debuginfo_path = &debuginfopath; - initialized = true; + initialized = true; } return &callbacks; diff --git a/src/services/symbollookup/SymbolLookup.cpp b/src/services/symbollookup/SymbolLookup.cpp index 99e035c9..d8acc8fd 100644 --- a/src/services/symbollookup/SymbolLookup.cpp +++ b/src/services/symbollookup/SymbolLookup.cpp @@ -170,7 +170,7 @@ class SymbolLookup node = c->make_tree_entry(sym_info.line_attr, Variant(static_cast(result.line)), node); if (m_lookup_sourceloc) { std::string tmp = result.file + ":" + std::to_string(result.line); - node = c->make_tree_entry(sym_info.loc_attr, Variant(tmp.c_str()), node); + node = c->make_tree_entry(sym_info.loc_attr, Variant(tmp.c_str()), node); } if (node == parent) @@ -204,7 +204,7 @@ class SymbolLookup return Entry(sym_node); Entry parent = get_symbol_entry(c, Entry(e.node()->parent()), sym_info); - sym_node = perform_lookup(c, e, sym_info, parent.empty() ? &m_root_node : parent.node()); + sym_node = perform_lookup(c, e, sym_info, parent.empty() ? &m_root_node : parent.node()); if (sym_node) c->make_tree_entry(sym_info.sym_node_attr, Variant(sym_node->id()), e.node()); @@ -256,7 +256,7 @@ class SymbolLookup void init_lookup() { m_num_lookups = 0; - m_num_failed = 0; + m_num_failed = 0; } SymbolLookup(Caliper* c, Channel* chn) @@ -268,9 +268,9 @@ class SymbolLookup m_lookup_functions = config.get("lookup_functions").to_bool(); m_lookup_sourceloc = config.get("lookup_sourceloc").to_bool(); - m_lookup_file = config.get("lookup_file").to_bool(); - m_lookup_line = config.get("lookup_line").to_bool(); - m_lookup_mod = config.get("lookup_module").to_bool(); + m_lookup_file = config.get("lookup_file").to_bool(); + m_lookup_line = config.get("lookup_line").to_bool(); + m_lookup_mod = config.get("lookup_module").to_bool(); } public: diff --git a/src/services/sysalloc/SysAllocService.cpp b/src/services/sysalloc/SysAllocService.cpp index 6465e1aa..94441b7e 100644 --- a/src/services/sysalloc/SysAllocService.cpp +++ b/src/services/sysalloc/SysAllocService.cpp @@ -23,20 +23,20 @@ using util::ChannelList; namespace { -gotcha_wrappee_handle_t orig_malloc_handle = 0x0; -gotcha_wrappee_handle_t orig_calloc_handle = 0x0; +gotcha_wrappee_handle_t orig_malloc_handle = 0x0; +gotcha_wrappee_handle_t orig_calloc_handle = 0x0; gotcha_wrappee_handle_t orig_realloc_handle = 0x0; -gotcha_wrappee_handle_t orig_free_handle = 0x0; +gotcha_wrappee_handle_t orig_free_handle = 0x0; void* cali_malloc_wrapper(size_t size); void* cali_calloc_wrapper(size_t num, size_t size); void* cali_realloc_wrapper(void* ptr, size_t size); void cali_free_wrapper(void* ptr); -const char* malloc_str = "malloc"; -const char* calloc_str = "calloc"; +const char* malloc_str = "malloc"; +const char* calloc_str = "calloc"; const char* realloc_str = "realloc"; -const char* free_str = "free"; +const char* free_str = "free"; bool bindings_are_active = false; diff --git a/src/services/tau/tau.cpp b/src/services/tau/tau.cpp index 84e1aae9..0418b93e 100644 --- a/src/services/tau/tau.cpp +++ b/src/services/tau/tau.cpp @@ -30,7 +30,7 @@ class TAUBinding : public cali::AnnotationBinding void initialize(Caliper* c, Channel* chn) { // initialize TAU - int argc = 1; + int argc = 1; const char* dummy = "Caliper Application"; char* argv[1]; argv[0] = const_cast(dummy); diff --git a/src/services/textlog/TextLog.cpp b/src/services/textlog/TextLog.cpp index e5189621..721ecfae 100644 --- a/src/services/textlog/TextLog.cpp +++ b/src/services/textlog/TextLog.cpp @@ -162,8 +162,8 @@ class TextLogService ConfigSet config = services::init_config_from_spec(chn->config(), s_spec); trigger_attr_names = config.get("trigger").to_stringlist(","); - stream_filename = config.get("filename").to_string(); - formatstr = config.get("formatstring").to_string(); + stream_filename = config.get("filename").to_string(); + formatstr = config.get("formatstring").to_string(); } public: diff --git a/src/services/timer/Timer.cpp b/src/services/timer/Timer.cpp index e9572037..55d6a644 100644 --- a/src/services/timer/Timer.cpp +++ b/src/services/timer/Timer.cpp @@ -84,7 +84,7 @@ class TimerService void snapshot_cb(Caliper* c, Channel* chn, SnapshotView info, SnapshotBuilder& rec) { - auto now = clock::now(); + auto now = clock::now(); uint64_t nsec = chrono::duration_cast(now - tstart).count(); rec.append(offset_attr, Variant(nsec)); @@ -130,7 +130,7 @@ class TimerService // Find begin/end event snapshot event info attributes begin_evt_attr = c->get_attribute("cali.event.begin"); - end_evt_attr = c->get_attribute("cali.event.end"); + end_evt_attr = c->get_attribute("cali.event.end"); if (!begin_evt_attr || !end_evt_attr) { if (record_inclusive_duration) @@ -155,11 +155,11 @@ class TimerService TimerService(Caliper* c, Channel* chn) : tstart(clock::now()) { - ConfigSet config = services::init_config_from_spec(chn->config(), s_spec); + ConfigSet config = services::init_config_from_spec(chn->config(), s_spec); record_inclusive_duration = config.get("inclusive_duration").to_bool(); Attribute unit_attr = c->create_attribute("time.unit", CALI_TYPE_STRING, CALI_ATTR_SKIP_EVENTS); - Variant nsec_val = Variant("nsec"); + Variant nsec_val = Variant("nsec"); offset_attr = c->create_attribute( "time.offset.ns", @@ -247,7 +247,7 @@ const char* timestamp_spec = R"json( namespace cali { -CaliperService timer_service = { ::TimerService::s_spec, ::TimerService::timer_register }; +CaliperService timer_service = { ::TimerService::s_spec, ::TimerService::timer_register }; CaliperService timestamp_service = { timestamp_spec, ::TimerService::timer_register }; } // namespace cali diff --git a/src/services/topdown/IntelTopdown.cpp b/src/services/topdown/IntelTopdown.cpp index 0a7a2998..80064bb2 100644 --- a/src/services/topdown/IntelTopdown.cpp +++ b/src/services/topdown/IntelTopdown.cpp @@ -71,7 +71,7 @@ class IntelTopdown bool find_counter_attrs(CaliperMetadataAccessInterface& db) { - const char* list = (level == All ? s_all_counters : s_top_counters); + const char* list = (level == All ? s_all_counters : s_top_counters); auto counters = StringConverter(list).to_stringlist(); for (const auto& s : counters) { @@ -113,10 +113,10 @@ class IntelTopdown { std::vector ret; - Variant v_cpu_clk_unhalted_thread_p = get_val_from_rec(rec, "CPU_CLK_THREAD_UNHALTED:THREAD_P"); - Variant v_uops_retired_retire_slots = get_val_from_rec(rec, "UOPS_RETIRED:RETIRE_SLOTS"); - Variant v_uops_issued_any = get_val_from_rec(rec, "UOPS_ISSUED:ANY"); - Variant v_int_misc_recovery_cycles = get_val_from_rec(rec, "INT_MISC:RECOVERY_CYCLES"); + Variant v_cpu_clk_unhalted_thread_p = get_val_from_rec(rec, "CPU_CLK_THREAD_UNHALTED:THREAD_P"); + Variant v_uops_retired_retire_slots = get_val_from_rec(rec, "UOPS_RETIRED:RETIRE_SLOTS"); + Variant v_uops_issued_any = get_val_from_rec(rec, "UOPS_ISSUED:ANY"); + Variant v_int_misc_recovery_cycles = get_val_from_rec(rec, "INT_MISC:RECOVERY_CYCLES"); Variant v_idq_uops_not_delivered_core = get_val_from_rec(rec, "IDQ_UOPS_NOT_DELIVERED:CORE"); bool is_incomplete = v_cpu_clk_unhalted_thread_p.empty() || v_uops_retired_retire_slots.empty() @@ -131,12 +131,12 @@ class IntelTopdown if (is_incomplete || !is_nonzero || slots < 1.0) return ret; - double retiring = v_uops_retired_retire_slots.to_double() / slots; + double retiring = v_uops_retired_retire_slots.to_double() / slots; double bad_speculation = (v_uops_issued_any.to_double() - v_uops_retired_retire_slots.to_double() + 4.0 * v_int_misc_recovery_cycles.to_double()) / slots; double frontend_bound = v_idq_uops_not_delivered_core.to_double() / slots; - double backend_bound = 1.0 - (retiring + bad_speculation + frontend_bound); + double backend_bound = 1.0 - (retiring + bad_speculation + frontend_bound); ret.reserve(4); ret.push_back(Entry(result_attrs["retiring"], Variant(std::max(retiring, 0.0)))); @@ -151,14 +151,14 @@ class IntelTopdown { std::vector ret; - Variant v_cpu_clk_unhalted_thread_p = get_val_from_rec(rec, "CPU_CLK_THREAD_UNHALTED:THREAD_P"); + Variant v_cpu_clk_unhalted_thread_p = get_val_from_rec(rec, "CPU_CLK_THREAD_UNHALTED:THREAD_P"); Variant v_cycle_activity_stalls_ldm_pending = get_val_from_rec(rec, "CYCLE_ACTIVITY:STALLS_LDM_PENDING"); - Variant v_cycle_activity_cycles_no_execute = get_val_from_rec(rec, "CYCLE_ACTIVITY:CYCLES_NO_EXECUTE"); - Variant v_uops_executed_core_cycles_ge_1 = get_val_from_rec(rec, "UOPS_EXECUTED:CORE_CYCLES_GE_1"); - Variant v_uops_executed_core_cycles_ge_2 = get_val_from_rec(rec, "UOPS_EXECUTED:CORE_CYCLES_GE_2"); - Variant v_mem_load_uops_retired_l3_miss = get_val_from_rec(rec, "MEM_LOAD_UOPS_RETIRED:L3_MISS"); - Variant v_mem_load_uops_retired_l3_hit = get_val_from_rec(rec, "MEM_LOAD_UOPS_RETIRED:L3_HIT"); - Variant v_cycle_activity_stalls_l2_pending = get_val_from_rec(rec, "CYCLE_ACTIVITY:STALLS_L2_PENDING"); + Variant v_cycle_activity_cycles_no_execute = get_val_from_rec(rec, "CYCLE_ACTIVITY:CYCLES_NO_EXECUTE"); + Variant v_uops_executed_core_cycles_ge_1 = get_val_from_rec(rec, "UOPS_EXECUTED:CORE_CYCLES_GE_1"); + Variant v_uops_executed_core_cycles_ge_2 = get_val_from_rec(rec, "UOPS_EXECUTED:CORE_CYCLES_GE_2"); + Variant v_mem_load_uops_retired_l3_miss = get_val_from_rec(rec, "MEM_LOAD_UOPS_RETIRED:L3_MISS"); + Variant v_mem_load_uops_retired_l3_hit = get_val_from_rec(rec, "MEM_LOAD_UOPS_RETIRED:L3_HIT"); + Variant v_cycle_activity_stalls_l2_pending = get_val_from_rec(rec, "CYCLE_ACTIVITY:STALLS_L2_PENDING"); Variant v_cycle_activity_stalls_l1d_pending = get_val_from_rec(rec, "CYCLE_ACTIVITY:STALLS_L1D_PENDING"); bool is_incomplete = v_cpu_clk_unhalted_thread_p.empty() || v_cycle_activity_stalls_ldm_pending.empty() @@ -178,10 +178,10 @@ class IntelTopdown - v_uops_executed_core_cycles_ge_2.to_double()) / clocks; double l3_tot = v_mem_load_uops_retired_l3_hit.to_double() + 7.0 * v_mem_load_uops_retired_l3_miss.to_double(); - double l3_hit_fraction = 0.0; + double l3_hit_fraction = 0.0; double l3_miss_fraction = 0.0; if (l3_tot > 0.0) { - l3_hit_fraction = v_mem_load_uops_retired_l3_hit.to_double() / l3_tot; + l3_hit_fraction = v_mem_load_uops_retired_l3_hit.to_double() / l3_tot; l3_miss_fraction = v_mem_load_uops_retired_l3_miss.to_double() / l3_tot; } double ext_mem_bound = v_cycle_activity_stalls_l2_pending.to_double() * l3_miss_fraction / clocks; @@ -208,12 +208,12 @@ class IntelTopdown std::vector ret; Variant v_cpu_clk_unhalted_thread_p = get_val_from_rec(rec, "CPU_CLK_THREAD_UNHALTED:THREAD_P"); - Variant v_idq_uops_not_delivered = get_val_from_rec(rec, "IDQ_UOPS_NOT_DELIVERED:CYCLES_0_UOPS_DELIV_CORE"); + Variant v_idq_uops_not_delivered = get_val_from_rec(rec, "IDQ_UOPS_NOT_DELIVERED:CYCLES_0_UOPS_DELIV_CORE"); bool is_incomplete = v_cpu_clk_unhalted_thread_p.empty() || v_idq_uops_not_delivered.empty(); double clocks = v_cpu_clk_unhalted_thread_p.to_double(); - double uops = v_idq_uops_not_delivered.to_double(); + double uops = v_idq_uops_not_delivered.to_double(); if (is_incomplete || clocks < 1.0 || uops > clocks) return ret; @@ -232,12 +232,12 @@ class IntelTopdown std::vector ret; Variant v_br_misp_retired_all_branches = get_val_from_rec(rec, "BR_MISP_RETIRED:ALL_BRANCHES"); - Variant v_machine_clears_count = get_val_from_rec(rec, "MACHINE_CLEARS:COUNT"); + Variant v_machine_clears_count = get_val_from_rec(rec, "MACHINE_CLEARS:COUNT"); bool is_incomplete = v_br_misp_retired_all_branches.empty() || v_machine_clears_count.empty(); double br_misp_retired_all_branches = v_br_misp_retired_all_branches.to_double(); - double machine_clears_count = v_machine_clears_count.to_double(); + double machine_clears_count = v_machine_clears_count.to_double(); if (is_incomplete || !(br_misp_retired_all_branches + machine_clears_count > 1.0)) return ret; @@ -332,14 +332,14 @@ class IntelTopdown static void intel_topdown_register(Caliper* c, Channel* channel) { - Level level = Top; + Level level = Top; const char* counters = s_top_counters; auto config = services::init_config_from_spec(channel->config(), s_spec); std::string lvlcfg = config.get("level").to_string(); if (lvlcfg == "all") { - level = All; + level = All; counters = s_all_counters; } else if (lvlcfg != "top") { Log(0).stream() << channel->name() << ": topdown: Unknown level \"" << lvlcfg << "\", skipping topdown" diff --git a/src/services/trace/Trace.cpp b/src/services/trace/Trace.cpp index 42cfcad2..cf83d9c7 100644 --- a/src/services/trace/Trace.cpp +++ b/src/services/trace/Trace.cpp @@ -54,14 +54,14 @@ class Trace } }; - BufferPolicy policy = BufferPolicy::Grow; + BufferPolicy policy = BufferPolicy::Grow; size_t buffersize = 2 * 1024 * 1024; size_t dropped_snapshots = 0; unsigned num_acquired = 0; unsigned num_released = 0; - unsigned num_retired = 0; + unsigned num_retired = 0; Attribute tbuf_attr; @@ -88,7 +88,7 @@ class Trace tbuf_list->prev = tbuf; tbuf->next = tbuf_list; - tbuf_list = tbuf; + tbuf_list = tbuf; ++num_acquired; } @@ -231,7 +231,7 @@ class Trace if (Log::verbosity() > 1) { unitfmt_result bytes_reserved = unitfmt(aggregate_info.reserved, unitfmt_bytes); - unitfmt_result bytes_used = unitfmt(aggregate_info.used, unitfmt_bytes); + unitfmt_result bytes_used = unitfmt(aggregate_info.used, unitfmt_bytes); Log(2).stream() << chn->name() << ": Trace: " << bytes_reserved.val << " " << bytes_reserved.symbol << " reserved, " << bytes_used.val << " " << bytes_used.symbol << " used, " diff --git a/src/services/trace/TraceBufferChunk.cpp b/src/services/trace/TraceBufferChunk.cpp index d1af5ad0..4f8082bc 100644 --- a/src/services/trace/TraceBufferChunk.cpp +++ b/src/services/trace/TraceBufferChunk.cpp @@ -32,7 +32,7 @@ void TraceBufferChunk::append(TraceBufferChunk* chunk) void TraceBufferChunk::reset() { - m_pos = 0; + m_pos = 0; m_nrec = 0; memset(m_data, 0, m_size); diff --git a/src/services/umpire/UmpireStatistics.cpp b/src/services/umpire/UmpireStatistics.cpp index 37167978..bb80bcad 100644 --- a/src/services/umpire/UmpireStatistics.cpp +++ b/src/services/umpire/UmpireStatistics.cpp @@ -52,10 +52,10 @@ class UmpireService SnapshotView context ) { - uint64_t actual_size = alloc.getActualSize(); + uint64_t actual_size = alloc.getActualSize(); uint64_t current_size = alloc.getCurrentSize(); - uint64_t hwm = alloc.getHighWatermark(); - uint64_t count = alloc.getAllocationCount(); + uint64_t hwm = alloc.getHighWatermark(); + uint64_t count = alloc.getAllocationCount(); Attribute attr[] = { m_alloc_name_attr, m_alloc_actual_size_attr, @@ -99,9 +99,9 @@ class UmpireService c->pull_context(context.builder()); } - uint64_t total_size = 0; + uint64_t total_size = 0; uint64_t total_count = 0; - uint64_t total_hwm = 0; + uint64_t total_hwm = 0; auto& rm = umpire::ResourceManager::getInstance(); @@ -148,7 +148,7 @@ class UmpireService void create_attributes(Caliper* c) { - m_alloc_name_attr = c->create_attribute("umpire.alloc.name", CALI_TYPE_STRING, CALI_ATTR_SKIP_EVENTS); + m_alloc_name_attr = c->create_attribute("umpire.alloc.name", CALI_TYPE_STRING, CALI_ATTR_SKIP_EVENTS); m_alloc_current_size_attr = c->create_attribute( "umpire.alloc.current.size", CALI_TYPE_UINT, @@ -191,8 +191,8 @@ class UmpireService auto config = services::init_config_from_spec(channel->config(), s_spec); m_per_allocator_stats = config.get("per_allocator_statistics").to_bool(); - m_record_global_hwm = config.get("record_highwatermarks").to_bool(); - m_filter = config.get("allocator_filter").to_stringlist(); + m_record_global_hwm = config.get("record_highwatermarks").to_bool(); + m_filter = config.get("allocator_filter").to_stringlist(); create_attributes(c); } diff --git a/src/services/util/ChannelList.hpp b/src/services/util/ChannelList.hpp index c3a6f589..33605cdd 100644 --- a/src/services/util/ChannelList.hpp +++ b/src/services/util/ChannelList.hpp @@ -40,7 +40,7 @@ struct ChannelList { (*head)->prev = ret; ret->next = *head; - *head = ret; + *head = ret; } inline static void remove(ChannelList** head, cali::Channel& chn) diff --git a/src/services/variorum/Variorum.cpp b/src/services/variorum/Variorum.cpp index 60173de8..484713a0 100644 --- a/src/services/variorum/Variorum.cpp +++ b/src/services/variorum/Variorum.cpp @@ -35,7 +35,7 @@ std::tuple measure(const std::string& name) { double power_watts; json_t* power_obj = NULL; - char* s = NULL; + char* s = NULL; s = (char*) malloc(800 * sizeof(char)); @@ -50,7 +50,7 @@ std::tuple measure(const std::string& name) // TODO: Assume 1 rank/node for aggregation // Extract and print values from JSON object - power_obj = json_loads(s, JSON_DECODE_ANY, NULL); + power_obj = json_loads(s, JSON_DECODE_ANY, NULL); power_watts = json_real_value(json_object_get(power_obj, name.c_str())); uint64_t val = (uint64_t) power_watts; diff --git a/src/services/vtune/VTuneBindings.cpp b/src/services/vtune/VTuneBindings.cpp index d2507cd2..443ac01d 100644 --- a/src/services/vtune/VTuneBindings.cpp +++ b/src/services/vtune/VTuneBindings.cpp @@ -28,7 +28,7 @@ class ITTBinding : public cali::AnnotationBinding inline __itt_domain* get_itt_domain(const Attribute& attr) { - __itt_domain* domain = nullptr; + __itt_domain* domain = nullptr; cali_id_t attr_id = attr.id(); { @@ -51,7 +51,7 @@ class ITTBinding : public cali::AnnotationBinding { const char* str = static_cast(val.data()); - auto it = s_itt_strings.lower_bound(str); + auto it = s_itt_strings.lower_bound(str); if (it == s_itt_strings.end() || it->first != str) { itt_str = __itt_string_handle_create(str); diff --git a/src/tools/cali-query/query_common.cpp b/src/tools/cali-query/query_common.cpp index 6f22f605..d8cb1b63 100644 --- a/src/tools/cali-query/query_common.cpp +++ b/src/tools/cali-query/query_common.cpp @@ -50,7 +50,7 @@ std::vector parse_arglist(std::istream& is) do { std::string str = util::read_word(is, ",()"); - c = util::read_char(is); + c = util::read_char(is); if (!str.empty() && (c == ',' || c == ')')) ret.push_back(str); @@ -84,7 +84,7 @@ std::pair> parse_functioncall(std::istream& is, co } // read argument list - std::vector args = parse_arglist(is); + std::vector args = parse_arglist(is); int argsize = static_cast(args.size()); if (argsize < defs[retid].min_args || argsize > defs[retid].max_args) { @@ -211,12 +211,12 @@ namespace cali bool QueryArgsParser::parse_args(const Args& args) { - m_spec.filter.selection = QuerySpec::FilterSelection::Default; - m_spec.select.selection = QuerySpec::AttributeSelection::Default; + m_spec.filter.selection = QuerySpec::FilterSelection::Default; + m_spec.select.selection = QuerySpec::AttributeSelection::Default; m_spec.aggregate.selection = QuerySpec::AggregationSelection::None; - m_spec.groupby.selection = QuerySpec::AttributeSelection::None; - m_spec.sort.selection = QuerySpec::SortSelection::Default; - m_spec.format.opt = QuerySpec::FormatSpec::Default; + m_spec.groupby.selection = QuerySpec::AttributeSelection::None; + m_spec.sort.selection = QuerySpec::SortSelection::Default; + m_spec.format.opt = QuerySpec::FormatSpec::Default; m_error = false; m_error_msg.clear(); @@ -228,7 +228,7 @@ bool QueryArgsParser::parse_args(const Args& args) CalQLParser p(q.c_str()); if (p.error()) { - m_error = true; + m_error = true; m_error_msg = p.error_msg(); return false; } else @@ -238,7 +238,7 @@ bool QueryArgsParser::parse_args(const Args& args) std::ifstream in { filename.c_str() }; if (!in) { - m_error = true; + m_error = true; m_error_msg = "cannot open query file " + filename; return false; } @@ -246,7 +246,7 @@ bool QueryArgsParser::parse_args(const Args& args) CalQLParser p(in); if (p.error()) { - m_error = true; + m_error = true; m_error_msg = p.error_msg(); return false; } else @@ -257,7 +257,7 @@ bool QueryArgsParser::parse_args(const Args& args) if (args.is_set("select")) { m_spec.filter.selection = QuerySpec::FilterSelection::List; - m_spec.filter.list = RecordSelector::parse(args.get("select")); + m_spec.filter.list = RecordSelector::parse(args.get("select")); } // setup attribute selection @@ -339,7 +339,7 @@ bool QueryArgsParser::parse_args(const Args& args) ++fmtsig) { // see if a formatting option is set if (args.is_set(fmtsig->name)) { - m_spec.format.opt = QuerySpec::FormatSpec::User; + m_spec.format.opt = QuerySpec::FormatSpec::User; m_spec.format.formatter = *fmtsig; // Find formatter args (if any) @@ -349,7 +349,7 @@ bool QueryArgsParser::parse_args(const Args& args) // NOTE: This check isn't complete yet. if (m_spec.format.kwargs.size() < static_cast(fmtsig->min_args)) { - m_error = true; + m_error = true; m_error_msg = std::string("Insufficient arguments for formatter ") + fmtsig->name; return false; @@ -369,7 +369,7 @@ void print_caliquery_help(const Args& args, const char* usage, const ConfigManag if (helpopt == "configs" || helpopt == "recipes") { std::cout << "Available config recipes:\n"; auto list = mgr.available_config_specs(); - size_t len = 0; + size_t len = 0; for (const auto& s : list) len = std::max(len, s.size()); for (const auto& s : list) { @@ -380,7 +380,7 @@ void print_caliquery_help(const Args& args, const char* usage, const ConfigManag std::cout << "Available services:\n"; services::add_default_service_specs(); auto list = services::get_available_services(); - size_t len = 0; + size_t len = 0; for (const auto& s : list) len = std::max(len, s.size()); for (const auto& s : list) { @@ -413,7 +413,7 @@ void print_caliquery_help(const Args& args, const char* usage, const ConfigManag } else if (!helpopt.empty()) { { auto cfgs = mgr.available_config_specs(); - auto it = std::find(cfgs.begin(), cfgs.end(), helpopt); + auto it = std::find(cfgs.begin(), cfgs.end(), helpopt); if (it != cfgs.end()) { std::cout << mgr.get_documentation_for_spec(helpopt.c_str()) << "\n"; return; @@ -423,7 +423,7 @@ void print_caliquery_help(const Args& args, const char* usage, const ConfigManag { services::add_default_service_specs(); auto srvs = services::get_available_services(); - auto it = std::find(srvs.begin(), srvs.end(), helpopt); + auto it = std::find(srvs.begin(), srvs.end(), helpopt); if (it != srvs.end()) { services::print_service_documentation(std::cout << *it << " service:\n", helpopt); return; diff --git a/src/tools/cali-stat/cali-stat.cpp b/src/tools/cali-stat/cali-stat.cpp index 2157a249..998d9261 100644 --- a/src/tools/cali-stat/cali-stat.cpp +++ b/src/tools/cali-stat/cali-stat.cpp @@ -85,7 +85,7 @@ class ReuseStat if (it == mS->reuse.end()) { S::ReuseInfo info; - info.nodes = 1; + info.nodes = 1; info.data[node->data().to_string()] = 1; mS->reuse.insert(make_pair(node->attribute(), info)); @@ -134,7 +134,7 @@ class CaliStreamStat ostringstream os; const char* postfix[] = { "", "KiB", "MiB", "GiB" }; - int p = 0; + int p = 0; for (; size > 1024 && p < 3; ++p) size /= 1024; diff --git a/src/tools/util/Args.cpp b/src/tools/util/Args.cpp index 18ebceb3..c918d6f2 100644 --- a/src/tools/util/Args.cpp +++ b/src/tools/util/Args.cpp @@ -165,7 +165,7 @@ struct Args::ArgsImpl { void print_available_options(ostream& os) const { - const string::size_type pad = 2; + const string::size_type pad = 2; string::size_type max_longopt = m_longopt_prefix.size(); // Get max longopt+argument info size for padding @@ -178,7 +178,7 @@ struct Args::ArgsImpl { } const string opt_sep(", "); - const char* whitespace = " "; + const char* whitespace = " "; const string::size_type maxwhitespace = strlen(whitespace); for (const Table& opt : m_options) { diff --git a/test/cali-annotation-perftest.cpp b/test/cali-annotation-perftest.cpp index be1bb248..caa4d8fb 100644 --- a/test/cali-annotation-perftest.cpp +++ b/test/cali-annotation-perftest.cpp @@ -201,8 +201,8 @@ int main(int argc, char* argv[]) cfg.tree_width = std::stoi(args.get("width", "20")); cfg.tree_depth = std::stoi(args.get("depth", "10")); - cfg.iter = std::stoi(args.get("iterations", "100000")); - cfg.channels = std::max(std::stoi(args.get("channels", "1")), 1); + cfg.iter = std::stoi(args.get("iterations", "100000")); + cfg.channels = std::max(std::stoi(args.get("channels", "1")), 1); // set global attributes before other Caliper initialization record_globals(cfg, threads, extra_kv); @@ -212,7 +212,7 @@ int main(int argc, char* argv[]) // --- print info bool print_csv = args.is_set("csv"); - bool quiet = args.is_set("quiet"); + bool quiet = args.is_set("quiet"); if (!quiet && !print_csv) std::cout << "cali-annotation-perftest:" @@ -242,7 +242,7 @@ int main(int argc, char* argv[]) pre_cfg.tree_width = 1; pre_cfg.tree_depth = 0; - pre_cfg.iter = 100 * threads; + pre_cfg.iter = 100 * threads; mgr.stop(); run(pre_cfg); diff --git a/test/cali-flush-perftest.cpp b/test/cali-flush-perftest.cpp index b0dc3d32..ecf030dd 100644 --- a/test/cali-flush-perftest.cpp +++ b/test/cali-flush-perftest.cpp @@ -102,10 +102,10 @@ int main(int argc, char* argv[]) Config cfg; - cfg.iter = std::stoi(args.get("iterations", "100000")); - cfg.nxtra = std::stoi(args.get("xtra", "2")); + cfg.iter = std::stoi(args.get("iterations", "100000")); + cfg.nxtra = std::stoi(args.get("xtra", "2")); cfg.channels = std::stoi(args.get("channels", "1")); - cfg.write = args.is_set("write"); + cfg.write = args.is_set("write"); cali_set_global_int_byname("flush-perftest.iterations", cfg.iter); cali_set_global_int_byname("flush-perftest.nxtra", cfg.nxtra); diff --git a/test/cali-wrap.cpp b/test/cali-wrap.cpp index 87bb506f..37401c6a 100644 --- a/test/cali-wrap.cpp +++ b/test/cali-wrap.cpp @@ -31,8 +31,8 @@ auto doWorkWrapped = cali::wrap_function_and_args("doWork", doWork); int main(int argc, char* argv[]) { - constexpr int data_size = 1000000; - constexpr int iterations = 10; + constexpr int data_size = 1000000; + constexpr int iterations = 10; int data_size_increment = data_size / iterations; cali::wrap("Program", [&]() { int* inArray; diff --git a/test/ci_app_tests/ci_test_alloc.c b/test/ci_app_tests/ci_test_alloc.c index fa1d664a..87d93879 100644 --- a/test/ci_app_tests/ci_test_alloc.c +++ b/test/ci_app_tests/ci_test_alloc.c @@ -37,10 +37,10 @@ void ci_test_alloc() cali_datatracker_track_dimensional(A, "test_alloc_A", sizeof(int), (const size_t[]) { 42 }, 1); cali_id_t attrs[2] = { ptr_in_attr, ptr_out_attr }; - int scope = CALI_SCOPE_PROCESS | CALI_SCOPE_THREAD; + int scope = CALI_SCOPE_PROCESS | CALI_SCOPE_THREAD; cali_begin_byname("test_alloc.allocated.0"); - int* A_inside = A; + int* A_inside = A; int* A_outside = A - 1; cali_variant_t v_p_i = cali_make_variant(CALI_TYPE_ADDR, &A_inside, sizeof(int*)); diff --git a/test/ci_app_tests/ci_test_alloc_hooks.c b/test/ci_app_tests/ci_test_alloc_hooks.c index 1f7de561..abfe68f6 100644 --- a/test/ci_app_tests/ci_test_alloc_hooks.c +++ b/test/ci_app_tests/ci_test_alloc_hooks.c @@ -17,16 +17,16 @@ void test_allocation(void* ptr, size_t size) { cali_begin_byname("test_alloc.allocated.0"); - int* ptr_inside = ptr; + int* ptr_inside = ptr; int* ptr_outside = ptr - 1; - cali_variant_t v_p_i = cali_make_variant(CALI_TYPE_ADDR, &ptr_inside, sizeof(void*)); - cali_variant_t v_p_o = cali_make_variant(CALI_TYPE_ADDR, &ptr_outside, sizeof(void*)); + cali_variant_t v_p_i = cali_make_variant(CALI_TYPE_ADDR, &ptr_inside, sizeof(void*)); + cali_variant_t v_p_o = cali_make_variant(CALI_TYPE_ADDR, &ptr_outside, sizeof(void*)); cali_push_snapshot(scope, 2, attrs, (const cali_variant_t[]) { v_p_i, v_p_o }); cali_end_byname("test_alloc.allocated.0"); cali_begin_byname("test_alloc.allocated.1"); - ptr_inside = ptr + size - 1; + ptr_inside = ptr + size - 1; ptr_outside = ptr + size; v_p_i = cali_make_variant(CALI_TYPE_ADDR, &ptr_inside, sizeof(void*)); @@ -41,10 +41,10 @@ void test_free(void* ptr) cali_begin_byname("test_alloc.freed"); free(ptr); - int* ptr_inside = ptr; + int* ptr_inside = ptr; int* ptr_outside = ptr - 1; - cali_variant_t v_p_i = cali_make_variant(CALI_TYPE_ADDR, &ptr_inside, sizeof(void*)); - cali_variant_t v_p_o = cali_make_variant(CALI_TYPE_ADDR, &ptr_outside, sizeof(void*)); + cali_variant_t v_p_i = cali_make_variant(CALI_TYPE_ADDR, &ptr_inside, sizeof(void*)); + cali_variant_t v_p_o = cali_make_variant(CALI_TYPE_ADDR, &ptr_outside, sizeof(void*)); cali_push_snapshot(scope, 2, attrs, (const cali_variant_t[]) { v_p_i, v_p_o }); cali_end_byname("test_alloc.freed"); @@ -79,7 +79,7 @@ void ci_test_alloc() int* A = (int*) malloc(sizeof(int) * 42); int* C = (int*) calloc(42, sizeof(int)); int* R = (int*) malloc(sizeof(int) * 100); - R = (int*) realloc(R, sizeof(int) * 42); + R = (int*) realloc(R, sizeof(int) * 42); cali_begin_byname("test_alloc.malloc_hook"); test_allocation(A, sizeof(int) * 42); diff --git a/test/ci_app_tests/ci_test_binding.cpp b/test/ci_app_tests/ci_test_binding.cpp index 16d99aed..81cf950c 100644 --- a/test/ci_app_tests/ci_test_binding.cpp +++ b/test/ci_app_tests/ci_test_binding.cpp @@ -22,7 +22,7 @@ class TestBinding : public AnnotationBinding void initialize(Caliper* c, Channel*) { - m_my_attr = c->create_attribute("testbinding", CALI_TYPE_STRING, CALI_ATTR_UNALIGNED); + m_my_attr = c->create_attribute("testbinding", CALI_TYPE_STRING, CALI_ATTR_UNALIGNED); m_prop_attr = c->create_attribute("testproperty", CALI_TYPE_INT, CALI_ATTR_DEFAULT); } @@ -76,7 +76,7 @@ int main(int argc, const char** argv) AnnotationBinding::make_binding(&c, &channel); - Attribute nested_attr = c.create_attribute("binding.nested", CALI_TYPE_STRING, CALI_ATTR_NESTED); + Attribute nested_attr = c.create_attribute("binding.nested", CALI_TYPE_STRING, CALI_ATTR_NESTED); Attribute default_attr = c.create_attribute("binding.default", CALI_TYPE_STRING, CALI_ATTR_DEFAULT); c.begin(nested_attr, Variant(CALI_TYPE_STRING, "outer", 6)); diff --git a/test/ci_app_tests/ci_test_c_ann.c b/test/ci_app_tests/ci_test_c_ann.c index 355e1e3b..771025a4 100644 --- a/test/ci_app_tests/ci_test_c_ann.c +++ b/test/ci_app_tests/ci_test_c_ann.c @@ -45,7 +45,7 @@ int main(int argc, char* argv[]) cali_begin_byname("ci_test_c_ann.meta-attr"); cali_id_t meta_attr = cali_create_attribute("meta-attr", CALI_TYPE_INT, CALI_ATTR_DEFAULT); - cali_variant_t meta_val = cali_make_variant_from_int(47); + cali_variant_t meta_val = cali_make_variant_from_int(47); cali_id_t test_attr = cali_create_attribute_with_metadata( "test-attr-with-metadata",