diff --git a/CARET_trace/include/caret_trace/container_traits.hpp b/CARET_trace/include/caret_trace/container_traits.hpp old mode 100755 new mode 100644 index 6ccda646..ae522a1c --- a/CARET_trace/include/caret_trace/container_traits.hpp +++ b/CARET_trace/include/caret_trace/container_traits.hpp @@ -18,7 +18,7 @@ /// @brief Type traits for container. /// @tparam ...Args Container types. -template +template class ContainerTraits { public: diff --git a/CARET_trace/include/caret_trace/data_container.hpp b/CARET_trace/include/caret_trace/data_container.hpp old mode 100755 new mode 100644 index da31c31a..b111e93c --- a/CARET_trace/include/caret_trace/data_container.hpp +++ b/CARET_trace/include/caret_trace/data_container.hpp @@ -184,10 +184,10 @@ class DataContainer : public DataContainerInterface /// @param ...args Data to be stored. /// @return True, data was stored to pending set. /// @return False, data was stored to set. - template + template bool store_add_callback_group(Args... args) { - return add_callback_group_->store(args ...); + return add_callback_group_->store(args...); } /// @brief Store data for add_callback_group_static_executor trace points. @@ -195,10 +195,10 @@ class DataContainer : public DataContainerInterface /// @param ...args Data to be stored. /// @return True, data was stored to pending set. /// @return False, data was stored to set. - template + template bool store_add_callback_group_static_executor(Args... args) { - return add_callback_group_static_executor_->store(args ...); + return add_callback_group_static_executor_->store(args...); } /// @brief Store data for callback_group_add_client trace points. @@ -206,10 +206,10 @@ class DataContainer : public DataContainerInterface /// @param ...args Data to be stored. /// @return True, data was stored to pending set. /// @return False, data was stored to set. - template + template bool store_callback_group_add_client(Args... args) { - return callback_group_add_client_->store(args ...); + return callback_group_add_client_->store(args...); } /// @brief Store data for callback_group_add_service trace points. @@ -217,10 +217,10 @@ class DataContainer : public DataContainerInterface /// @param ...args Data to be stored. /// @return True, data was stored to pending set. /// @return False, data was stored to set. - template + template bool store_callback_group_add_service(Args... args) { - return callback_group_add_service_->store(args ...); + return callback_group_add_service_->store(args...); } /// @brief Store data for callback_group_add_subscription trace points. @@ -228,10 +228,10 @@ class DataContainer : public DataContainerInterface /// @param ...args Data to be stored. /// @return True, data was stored to pending set. /// @return False, data was stored to set. - template + template bool store_callback_group_add_subscription(Args... args) { - return callback_group_add_subscription_->store(args ...); + return callback_group_add_subscription_->store(args...); } /// @brief Store data for callback_group_add_timer trace points. @@ -239,10 +239,10 @@ class DataContainer : public DataContainerInterface /// @param ...args Data to be stored. /// @return True, data was stored to pending set. /// @return False, data was stored to set. - template + template bool store_callback_group_add_timer(Args... args) { - return callback_group_add_timer_->store(args ...); + return callback_group_add_timer_->store(args...); } /// @brief Store data for construct_executor trace points. @@ -250,10 +250,10 @@ class DataContainer : public DataContainerInterface /// @param ...args Data to be stored. /// @return True, data was stored to pending set. /// @return False, data was stored to set. - template + template bool store_construct_executor(Args... args) { - return construct_executor_->store(args ...); + return construct_executor_->store(args...); } /// @brief Store data for construct_static_executor trace points. @@ -261,10 +261,10 @@ class DataContainer : public DataContainerInterface /// @param ...args Data to be stored. /// @return True, data was stored to pending set. /// @return False, data was stored to set. - template + template bool store_construct_static_executor(Args... args) { - return construct_static_executor_->store(args ...); + return construct_static_executor_->store(args...); } /// @brief Store data for rcl_node_init trace points. @@ -272,10 +272,10 @@ class DataContainer : public DataContainerInterface /// @param ...args Data to be stored. /// @return True, data was stored to pending set. /// @return False, data was stored to set. - template + template bool store_rcl_node_init(Args... args) { - return rcl_node_init_->store(args ...); + return rcl_node_init_->store(args...); } /// @brief Store data for rcl_init trace points. @@ -283,10 +283,10 @@ class DataContainer : public DataContainerInterface /// @param ...args Data to be stored. /// @return True, data was stored to pending set. /// @return False, data was stored to set. - template + template bool store_rcl_init(Args... args) { - return rcl_init_->store(args ...); + return rcl_init_->store(args...); } /// @brief Store data for rcl_subscription_init trace points. @@ -294,10 +294,10 @@ class DataContainer : public DataContainerInterface /// @param ...args Data to be stored. /// @return True, data was stored to pending set. /// @return False, data was stored to set. - template + template bool store_rcl_subscription_init(Args... args) { - return rcl_subscription_init_->store(args ...); + return rcl_subscription_init_->store(args...); } /// @brief Store data for rclcpp_callback_register trace points. @@ -305,10 +305,10 @@ class DataContainer : public DataContainerInterface /// @param ...args Data to be stored. /// @return True, data was stored to pending set. /// @return False, data was stored to set. - template + template bool store_rclcpp_callback_register(Args... args) { - return rclcpp_callback_register_->store(args ...); + return rclcpp_callback_register_->store(args...); } /// @brief Store data for rclcpp_subscription_init trace points. @@ -316,10 +316,10 @@ class DataContainer : public DataContainerInterface /// @param ...args Data to be stored. /// @return True, data was stored to pending set. /// @return False, data was stored to set. - template + template bool store_rclcpp_subscription_init(Args... args) { - return rclcpp_subscription_init_->store(args ...); + return rclcpp_subscription_init_->store(args...); } /// @brief Store data for rclcpp_subscription_callback_added trace points. @@ -327,10 +327,10 @@ class DataContainer : public DataContainerInterface /// @param ...args Data to be stored. /// @return True, data was stored to pending set. /// @return False, data was stored to set. - template + template bool store_rclcpp_subscription_callback_added(Args... args) { - return rclcpp_subscription_callback_added_->store(args ...); + return rclcpp_subscription_callback_added_->store(args...); } /// @brief Store data for rclcpp_timer_callback_added trace points. @@ -338,10 +338,10 @@ class DataContainer : public DataContainerInterface /// @param ...args Data to be stored. /// @return True, data was stored to pending set. /// @return False, data was stored to set. - template + template bool store_rclcpp_timer_callback_added(Args... args) { - return rclcpp_timer_callback_added_->store(args ...); + return rclcpp_timer_callback_added_->store(args...); } /// @brief Store data for rclcpp_timer_link_node trace points. @@ -349,10 +349,10 @@ class DataContainer : public DataContainerInterface /// @param ...args Data to be stored. /// @return True, data was stored to pending set. /// @return False, data was stored to set. - template + template bool store_rclcpp_timer_link_node(Args... args) { - return rclcpp_timer_link_node_->store(args ...); + return rclcpp_timer_link_node_->store(args...); } /// @brief Store data for rcl_timer_init trace points. @@ -360,10 +360,10 @@ class DataContainer : public DataContainerInterface /// @param ...args Data to be stored. /// @return True, data was stored to pending set. /// @return False, data was stored to set. - template + template bool store_rcl_timer_init(Args... args) { - return rcl_timer_init_->store(args ...); + return rcl_timer_init_->store(args...); } /// @brief Store data for rcl_publisher_init trace points. @@ -371,10 +371,10 @@ class DataContainer : public DataContainerInterface /// @param ...args Data to be stored. /// @return True, data was stored to pending set. /// @return False, data was stored to set. - template + template bool store_rcl_publisher_init(Args... args) { - return rcl_publisher_init_->store(args ...); + return rcl_publisher_init_->store(args...); } /// @brief Store data for rcl_client_init trace points. @@ -382,10 +382,10 @@ class DataContainer : public DataContainerInterface /// @param ...args Data to be stored. /// @return True, data was stored to pending set. /// @return False, data was stored to set. - template + template bool store_rcl_client_init(Args... args) { - return rcl_client_init_->store(args ...); + return rcl_client_init_->store(args...); } /// @brief Store data for rclcpp_service_callback_added trace points. @@ -393,10 +393,10 @@ class DataContainer : public DataContainerInterface /// @param ...args Data to be stored. /// @return True, data was stored to pending set. /// @return False, data was stored to set. - template + template bool store_rclcpp_service_callback_added(Args... args) { - return rclcpp_service_callback_added_->store(args ...); + return rclcpp_service_callback_added_->store(args...); } /// @brief Store data for rcl_service_init trace points. @@ -404,10 +404,10 @@ class DataContainer : public DataContainerInterface /// @param ...args Data to be stored. /// @return True, data was stored to pending set. /// @return False, data was stored to set. - template + template bool store_rcl_service_init(Args... args) { - return rcl_service_init_->store(args ...); + return rcl_service_init_->store(args...); } /// @brief Store data for rmw_implementation trace points. @@ -415,10 +415,10 @@ class DataContainer : public DataContainerInterface /// @param ...args Data to be stored. /// @return True, data was stored to pending set. /// @return False, data was stored to set. - template + template bool store_rmw_implementation(Args... args) { - return rmw_implementation_->store(args ...); + return rmw_implementation_->store(args...); } /// @brief Assign recording function for add_callback_group trace points. diff --git a/CARET_trace/include/caret_trace/keys_set.hpp b/CARET_trace/include/caret_trace/keys_set.hpp old mode 100755 new mode 100644 index 00525f32..028c1b14 --- a/CARET_trace/include/caret_trace/keys_set.hpp +++ b/CARET_trace/include/caret_trace/keys_set.hpp @@ -22,14 +22,14 @@ #include /// @private -template +template struct if_ { using type = Then; }; /// @private -template +template struct if_ { using type = Else; @@ -74,21 +74,18 @@ class HashableKeys public: /// @brief Construct an instance. /// @param key1 first argument. - explicit HashableKeys(T1 key1) - : key1_(key1) {} + explicit HashableKeys(T1 key1) : key1_(key1) {} /// @brief Construct an instance. /// @param key1 first argument. /// @param key2 second argument. - HashableKeys(T1 key1, T2 key2) - : key1_(key1), key2_(key2) {} + HashableKeys(T1 key1, T2 key2) : key1_(key1), key2_(key2) {} /// @brief Construct an instance. /// @param key1 first argument. /// @param key2 second argument. /// @param key3 third argument. - HashableKeys(T1 key1, T2 key2, T3 key3) - : key1_(key1), key2_(key2), key3_(key3) {} + HashableKeys(T1 key1, T2 key2, T3 key3) : key1_(key1), key2_(key2), key3_(key3) {} /// @brief Construct an instance. /// @param key1 first argument. @@ -304,13 +301,13 @@ class HashableKeys namespace std { -template +template struct hash> { - size_t operator()(const HashableKeys & t) const {return t.hash();} + size_t operator()(const HashableKeys & t) const { return t.hash(); } }; -template +template struct equal_to> { size_t operator()( @@ -417,10 +414,10 @@ class KeysSet /// @param key4 Fourth argument. /// @param key5 Fifth argument. /// @return True if it contains, false otherwise. - void insert(HashableKeys keys) {keys_.insert(keys);} + void insert(HashableKeys keys) { keys_.insert(keys); } /// @brief Clear set. - void clear() {keys_.clear();} + void clear() { keys_.clear(); } /// @brief Confirm content. /// @param key1 First argument. @@ -494,15 +491,15 @@ class KeysSet /// @brief Get const iterator /// @return Iterator referring to the first element. - ConstIteratorT begin() const {return keys_.cbegin();} + ConstIteratorT begin() const { return keys_.cbegin(); } /// @brief Get const iterator /// @return Iterator referring to the last element. - ConstIteratorT end() const {return keys_.cend();} + ConstIteratorT end() const { return keys_.cend(); } /// @brief Get size. /// @return Element number. - size_t size() const {return keys_.size();} + size_t size() const { return keys_.size(); } private: SetT keys_; diff --git a/CARET_trace/include/caret_trace/lttng_session.hpp b/CARET_trace/include/caret_trace/lttng_session.hpp old mode 100755 new mode 100644 index 466611ef..4372f76e --- a/CARET_trace/include/caret_trace/lttng_session.hpp +++ b/CARET_trace/include/caret_trace/lttng_session.hpp @@ -44,8 +44,7 @@ class LttngSession class LttngSessionImpl : public LttngSession { public: - LttngSessionImpl() - : started_session_running_(is_session_running()) {} + LttngSessionImpl() : started_session_running_(is_session_running()) {} ~LttngSessionImpl() {} diff --git a/CARET_trace/include/caret_trace/recordable_data.hpp b/CARET_trace/include/caret_trace/recordable_data.hpp old mode 100755 new mode 100644 index a511389e..d61f011a --- a/CARET_trace/include/caret_trace/recordable_data.hpp +++ b/CARET_trace/include/caret_trace/recordable_data.hpp @@ -67,24 +67,23 @@ class RecordableDataInterface class DummyRecordableKeysSet : public RecordableDataInterface { public: - DummyRecordableKeysSet() - : trace_point_("dummy_recordable_keys_set") {} + DummyRecordableKeysSet() : trace_point_("dummy_recordable_keys_set") {} - bool finished() const override {return true;} + bool finished() const override { return true; } void start() override {} - bool is_recording() const override {return true;} + bool is_recording() const override { return true; } void record_next_one() override {} void reset() override {} - const std::string & trace_point() const override {return trace_point_;} + const std::string & trace_point() const override { return trace_point_; } - size_t size() const override {return 0;} + size_t size() const override { return 0; } - size_t pending_size() const override {return 0;} + size_t pending_size() const override { return 0; } private: const std::string trace_point_; @@ -92,15 +91,15 @@ class DummyRecordableKeysSet : public RecordableDataInterface /// @brief Data container class with sequential recording API. /// @tparam ...Args Trace point data types. -template +template class RecordableData : public RecordableDataInterface { private: using KeyT = HashableKeys; public: - using FuncT = void (Args ...); - using StdFuncT = std::function; + using FuncT = void(Args...); + using StdFuncT = std::function; /// @brief Construct an instance. /// @param trace_point Trace point name for this instance. @@ -111,8 +110,7 @@ class RecordableData : public RecordableDataInterface /// @brief Construct an instance. /// @param trace_point Trace point name for this instance. - explicit RecordableData(char * trace_point) - : RecordableData(std::string(trace_point)) {} + explicit RecordableData(char * trace_point) : RecordableData(std::string(trace_point)) {} ~RecordableData() override {} @@ -146,11 +144,11 @@ class RecordableData : public RecordableDataInterface if (is_iterating_) { // PREPARE state - pending_set_.insert(args ...); + pending_set_.insert(args...); return true; } else { // OTHER state - set_.insert(args ...); + set_.insert(args...); return false; } } diff --git a/CARET_trace/include/caret_trace/singleton.hpp b/CARET_trace/include/caret_trace/singleton.hpp old mode 100755 new mode 100644 index 76dcfd5a..00f74e18 --- a/CARET_trace/include/caret_trace/singleton.hpp +++ b/CARET_trace/include/caret_trace/singleton.hpp @@ -27,7 +27,7 @@ class SingletonFinalizer /// @brief Class for use as a singleton. /// @tparam T Target class type. -template +template class Singleton final { public: @@ -57,10 +57,10 @@ class Singleton final static T * instance; }; -template +template std::once_flag Singleton::initFlag; -template +template T * Singleton::instance = nullptr; #endif // CARET_TRACE__SINGLETON_HPP_ diff --git a/CARET_trace/include/caret_trace/trace_node.hpp b/CARET_trace/include/caret_trace/trace_node.hpp old mode 100755 new mode 100644 index ff2c8e69..ccc91c9b --- a/CARET_trace/include/caret_trace/trace_node.hpp +++ b/CARET_trace/include/caret_trace/trace_node.hpp @@ -26,8 +26,7 @@ #include #include -enum class TRACE_STATUS -{ +enum class TRACE_STATUS { UNINITIALIZED, WAIT, PREPARE, diff --git a/CARET_trace/src/clock_recorder.cpp b/CARET_trace/src/clock_recorder.cpp old mode 100755 new mode 100644 index 9a7d1960..2131210c --- a/CARET_trace/src/clock_recorder.cpp +++ b/CARET_trace/src/clock_recorder.cpp @@ -28,26 +28,25 @@ using namespace std::literals::chrono_literals; class ClockRecorder : public rclcpp::Node { public: - ClockRecorder() - : Node("clock_recorder") + ClockRecorder() : Node("clock_recorder") { auto use_sim_time = rclcpp::Parameter("use_sim_time", true); set_parameter(use_sim_time); RCLCPP_INFO(get_logger(), "clock_recorder started to record sim time."); auto timer_callback = [&]() { - auto now = this->now(); - // std::cout << static_cast(now.seconds()) << std::endl; - // The /clock topic will not be recorded while it is not published. - if (now.nanoseconds() == 0) { - RCLCPP_WARN_THROTTLE( - get_logger(), *timer_steady_, 3000, // per 3 second. - "Failed to get simtime correctly. /clock topic may not have been published."); - return; - } - RCLCPP_DEBUG(get_logger(), "sim_time recorded: %ld.", now.nanoseconds()); - tracepoint(TRACEPOINT_PROVIDER, sim_time, now.nanoseconds()); - }; + auto now = this->now(); + // std::cout << static_cast(now.seconds()) << std::endl; + // The /clock topic will not be recorded while it is not published. + if (now.nanoseconds() == 0) { + RCLCPP_WARN_THROTTLE( + get_logger(), *timer_steady_, 3000, // per 3 second. + "Failed to get simtime correctly. /clock topic may not have been published."); + return; + } + RCLCPP_DEBUG(get_logger(), "sim_time recorded: %ld.", now.nanoseconds()); + tracepoint(TRACEPOINT_PROVIDER, sim_time, now.nanoseconds()); + }; timer_ = create_wall_timer(1s, timer_callback); timer_steady_ = std::make_shared(RCL_STEADY_TIME); } diff --git a/CARET_trace/src/hooked_trace_points.cpp b/CARET_trace/src/hooked_trace_points.cpp old mode 100755 new mode 100644 index f2f63cfa..955f857d --- a/CARET_trace/src/hooked_trace_points.cpp +++ b/CARET_trace/src/hooked_trace_points.cpp @@ -45,8 +45,8 @@ #include "caret_trace/keys_set.hpp" -#define SYMBOL_CONCAT_2(x, y) x ## y -#define SYMBOL_CONCAT_3(x, y, z) x ## y ## z +#define SYMBOL_CONCAT_2(x, y) x##y +#define SYMBOL_CONCAT_3(x, y, z) x##y##z extern thread_local bool trace_filter_is_rcl_publish_recorded; @@ -116,7 +116,7 @@ class StaticSingleThreadedExecutorPublic : public rclcpp::Executor RCLCPP_PUBLIC std::vector get_automatically_added_callback_groups_from_nodes() - override; + override; // protected: RCLCPP_PUBLIC @@ -186,8 +186,8 @@ void update_dds_function_addr() } static auto record = [](const char * rmw_implementation, int64_t init_time) { - tracepoint(TRACEPOINT_PROVIDER, rmw_implementation, rmw_implementation, init_time); - }; + tracepoint(TRACEPOINT_PROVIDER, rmw_implementation, rmw_implementation, init_time); + }; if (!data_container.is_assigned_rmw_implementation()) { data_container.assign_rmw_implementation(record); @@ -263,12 +263,12 @@ void _ZN6rclcpp9executors22SingleThreadedExecutorC1ERKNS_15ExecutorOptionsE( static auto & clock = context.get_clock(); static auto & data_container = context.get_data_container(); static auto record = [](const void * obj, const char * executor_type_name, int64_t init_time) { - tracepoint(TRACEPOINT_PROVIDER, construct_executor, obj, executor_type_name, init_time); + tracepoint(TRACEPOINT_PROVIDER, construct_executor, obj, executor_type_name, init_time); #ifdef DEBUG_OUTPUT - std::cerr << "construct_executor," << executor_type_name << "," << obj << std::endl; + std::cerr << "construct_executor," << executor_type_name << "," << obj << std::endl; #endif - }; + }; auto now = clock.now(); using functionT = void (*)(void *, const void *); ((functionT)orig_func)(obj, option); @@ -294,11 +294,11 @@ void SYMBOL_CONCAT_2( { static void * orig_func = dlsym(RTLD_NEXT, __func__); static auto record = [](const void * obj, const char * executor_type_name, int64_t init_time) { - tracepoint(TRACEPOINT_PROVIDER, construct_executor, obj, executor_type_name, init_time); + tracepoint(TRACEPOINT_PROVIDER, construct_executor, obj, executor_type_name, init_time); #ifdef DEBUG_OUTPUT - std::cerr << "construct_executor," << executor_type_name << "," << obj << std::endl; + std::cerr << "construct_executor," << executor_type_name << "," << obj << std::endl; #endif - }; + }; static auto & context = Singleton::get_instance(); static auto & clock = context.get_clock(); auto now = clock.now(); @@ -327,18 +327,18 @@ void _ZN6rclcpp9executors28StaticSingleThreadedExecutorC1ERKNS_15ExecutorOptions static auto & clock = context.get_clock(); static auto & data_container = context.get_data_container(); static auto record = []( - const void * obj, const void * entities_collector_ptr, - const char * executor_type, int64_t init_time) { - tracepoint( - TRACEPOINT_PROVIDER, construct_static_executor, obj, entities_collector_ptr, executor_type, - init_time); + const void * obj, const void * entities_collector_ptr, + const char * executor_type, int64_t init_time) { + tracepoint( + TRACEPOINT_PROVIDER, construct_static_executor, obj, entities_collector_ptr, executor_type, + init_time); #ifdef DEBUG_OUTPUT - std::cerr << "construct_static_executor," - << "static_single_threaded_executor" - << "," << obj << "," << entities_collector_ptr << std::endl; + std::cerr << "construct_static_executor," + << "static_single_threaded_executor" + << "," << obj << "," << entities_collector_ptr << std::endl; #endif - }; + }; auto now = clock.now(); using functionT = void (*)(void *, const void *); @@ -481,12 +481,12 @@ void _ZN6rclcpp13CallbackGroup9add_timerESt10shared_ptrINS_9TimerBaseEE( static auto & clock = context.get_clock(); static auto & data_container = context.get_data_container(); static auto record = [](const void * obj, const void * timer_handle, int64_t init_time) { - tracepoint(TRACEPOINT_PROVIDER, callback_group_add_timer, obj, timer_handle, init_time); + tracepoint(TRACEPOINT_PROVIDER, callback_group_add_timer, obj, timer_handle, init_time); #ifdef DEBUG_OUTPUT - std::cerr << "callback_group_add_timer," << obj << "," << timer_handle << std::endl; + std::cerr << "callback_group_add_timer," << obj << "," << timer_handle << std::endl; #endif - }; + }; auto now = clock.now(); auto timer_handle = static_cast(timer_ptr->get_timer_handle().get()); @@ -510,14 +510,14 @@ void _ZN6rclcpp13CallbackGroup16add_subscriptionESt10shared_ptrINS_16Subscriptio static auto & clock = context.get_clock(); static auto & data_container = context.get_data_container(); static auto record = [](const void * obj, const void * subscription_handle, int64_t init_time) { - tracepoint( - TRACEPOINT_PROVIDER, callback_group_add_subscription, obj, subscription_handle, init_time); + tracepoint( + TRACEPOINT_PROVIDER, callback_group_add_subscription, obj, subscription_handle, init_time); #ifdef DEBUG_OUTPUT - std::cerr << "callback_group_add_subscription," << obj << "," << subscription_handle - << std::endl; + std::cerr << "callback_group_add_subscription," << obj << "," << subscription_handle + << std::endl; #endif - }; + }; auto now = clock.now(); auto subscription_handle = @@ -542,12 +542,12 @@ void _ZN6rclcpp13CallbackGroup11add_serviceESt10shared_ptrINS_11ServiceBaseEE( static auto & clock = context.get_clock(); static auto & data_container = context.get_data_container(); static auto record = [](const void * obj, const void * service_handle, int64_t init_time) { - tracepoint(TRACEPOINT_PROVIDER, callback_group_add_service, obj, service_handle, init_time); + tracepoint(TRACEPOINT_PROVIDER, callback_group_add_service, obj, service_handle, init_time); #ifdef DEBUG_OUTPUT - std::cerr << "callback_group_add_service," << obj << "," << service_handle << std::endl; + std::cerr << "callback_group_add_service," << obj << "," << service_handle << std::endl; #endif - }; + }; auto now = clock.now(); auto service_handle = static_cast(service_ptr->get_service_handle().get()); @@ -571,12 +571,12 @@ void _ZN6rclcpp13CallbackGroup10add_clientESt10shared_ptrINS_10ClientBaseEE( static auto & clock = context.get_clock(); static auto & data_container = context.get_data_container(); static auto record = [](const void * obj, const void * client_handle, int64_t init_time) { - tracepoint(TRACEPOINT_PROVIDER, callback_group_add_client, obj, client_handle, init_time); + tracepoint(TRACEPOINT_PROVIDER, callback_group_add_client, obj, client_handle, init_time); #ifdef DEBUG_OUTPUT - std::cerr << "callback_group_add_client," << obj << "," << client_handle << std::endl; + std::cerr << "callback_group_add_client," << obj << "," << client_handle << std::endl; #endif - }; + }; auto now = clock.now(); auto client_handle = static_cast(client_ptr->get_client_handle().get()); diff --git a/CARET_trace/test/include/test/mock.hpp b/CARET_trace/test/include/test/mock.hpp old mode 100755 new mode 100644 index 658a2ea2..b7da1be8 --- a/CARET_trace/test/include/test/mock.hpp +++ b/CARET_trace/test/include/test/mock.hpp @@ -32,8 +32,8 @@ class CaretTraceNodeModeMock : public TraceNodeInterface MOCK_CONST_METHOD0(is_recording_allowed, bool()); MOCK_CONST_METHOD0(is_recording_allowed_init, bool()); MOCK_CONST_METHOD0(is_timer_running, bool()); - MOCK_METHOD0(get_data_container, DataContainerInterface & ()); - MOCK_CONST_METHOD0(get_status, const TRACE_STATUS & ()); + MOCK_METHOD0(get_data_container, DataContainerInterface &()); + MOCK_CONST_METHOD0(get_status, const TRACE_STATUS &()); }; /// @private diff --git a/CARET_trace/test/test_data_container.cpp b/CARET_trace/test/test_data_container.cpp old mode 100755 new mode 100644 index 73945f3d..3a5e944a --- a/CARET_trace/test/test_data_container.cpp +++ b/CARET_trace/test/test_data_container.cpp @@ -67,27 +67,27 @@ TEST(DataContainerTest, TracePoints) std::vector expect( {"add_callback_group", - "add_callback_group_static_executor", - "callback_group_add_client", - "callback_group_add_service", - "callback_group_add_subscription", - "callback_group_add_timer", - "construct_executor", - "construct_static_executor", - "rcl_client_init", - "rcl_init", - "rcl_node_init", - "rcl_publisher_init", - "rcl_service_init", - "rcl_subscription_init", - "rcl_timer_init", - "rclcpp_callback_register", - "rclcpp_service_callback_added", - "rclcpp_subscription_callback_added", - "rclcpp_subscription_init", - "rclcpp_timer_callback_added", - "rclcpp_timer_link_node", - "rmw_implementation"}); + "add_callback_group_static_executor", + "callback_group_add_client", + "callback_group_add_service", + "callback_group_add_subscription", + "callback_group_add_timer", + "construct_executor", + "construct_static_executor", + "rcl_client_init", + "rcl_init", + "rcl_node_init", + "rcl_publisher_init", + "rcl_service_init", + "rcl_subscription_init", + "rcl_timer_init", + "rclcpp_callback_register", + "rclcpp_service_callback_added", + "rclcpp_subscription_callback_added", + "rclcpp_subscription_init", + "rclcpp_timer_callback_added", + "rclcpp_timer_link_node", + "rmw_implementation"}); EXPECT_EQ(trace_points, expect); } diff --git a/CARET_trace/test/test_data_recorder.cpp b/CARET_trace/test/test_data_recorder.cpp old mode 100755 new mode 100644 index 607241df..bc702b36 --- a/CARET_trace/test/test_data_recorder.cpp +++ b/CARET_trace/test/test_data_recorder.cpp @@ -40,11 +40,10 @@ TEST(DataRecorderTest, AssignCaseOneKeys) DataRecorder recorder({key}); bool called = false; - key->assign( - [&](const int arg) { - (void)arg; - called = true; - }); + key->assign([&](const int arg) { + (void)arg; + called = true; + }); key->store(0); diff --git a/CARET_trace/test/test_hashable_keys.cpp b/CARET_trace/test/test_hashable_keys.cpp old mode 100755 new mode 100644 index 1e469a06..43159b79 --- a/CARET_trace/test/test_hashable_keys.cpp +++ b/CARET_trace/test/test_hashable_keys.cpp @@ -127,8 +127,8 @@ TEST(HashableKeys, StringLiteralCase) HashableKeys keys__(s__); auto is_equal = [](const char * lhs, const char * rhs) -> bool { - return std::string(lhs).compare(rhs) == 0; - }; + return std::string(lhs).compare(rhs) == 0; + }; EXPECT_TRUE(is_equal(keys.first(), keys_.first())); EXPECT_FALSE(is_equal(keys.first(), keys__.first())); diff --git a/CARET_trace/test/test_recordable_data.cpp b/CARET_trace/test/test_recordable_data.cpp old mode 100755 new mode 100644 index 099e16be..1b775c4d --- a/CARET_trace/test/test_recordable_data.cpp +++ b/CARET_trace/test/test_recordable_data.cpp @@ -63,8 +63,8 @@ TEST(RecordableData, TwoTypesCase) EXPECT_EQ(set->get().first(), 1); auto is_equal = [](const char * lhs, const char * rhs) -> bool { - return std::string(lhs).compare(rhs) == 0; - }; + return std::string(lhs).compare(rhs) == 0; + }; EXPECT_TRUE(is_equal(set->get().second(), "test")); diff --git a/CARET_trace/test/test_scenario.cpp b/CARET_trace/test/test_scenario.cpp old mode 100755 new mode 100644 index 460ec469..2071608f --- a/CARET_trace/test/test_scenario.cpp +++ b/CARET_trace/test/test_scenario.cpp @@ -101,8 +101,8 @@ TEST(ScenarioTest, TestMultiThread) // NOTE: Ensure recording data. Avoid container.record() before add_data() is called. add_data(container, 1); - std::thread t1([&container, loop]() {add_data(container, loop);}); - std::thread t2([&container, loop]() {container.record(loop);}); + std::thread t1([&container, loop]() { add_data(container, loop); }); + std::thread t2([&container, loop]() { container.record(loop); }); t1.join(); t2.join();