Skip to content

Commit

Permalink
ci(pre-commit): autofix
Browse files Browse the repository at this point in the history
  • Loading branch information
pre-commit-ci[bot] committed Oct 25, 2024
1 parent 676f373 commit 4ded1eb
Show file tree
Hide file tree
Showing 5 changed files with 45 additions and 32 deletions.
23 changes: 14 additions & 9 deletions CARET_trace/include/caret_trace/data_container.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -80,8 +80,7 @@ class DataContainer : public DataContainerInterface
ContainerTraits<const void *, const void *, int64_t>;

/// @brief ContainerTraits for executor_entity_collector_to_executor trace points.
using ExecutorEntityCollectorToExecutor =
ContainerTraits<const void *, const void *, int64_t>;
using ExecutorEntityCollectorToExecutor = ContainerTraits<const void *, const void *, int64_t>;

/// @brief ContainerTraits for rcl_init trace points.
using RclInit = ContainerTraits<const void *, int64_t>;
Expand Down Expand Up @@ -153,7 +152,7 @@ class DataContainer : public DataContainerInterface
/// @param callback_group_add_timer Data instance for callback_group_add_timer trace point.
/// @param construct_executor Data instance for construct_executor trace point.
/// @param construct_static_executor Data instance for construct_static_executor trace point.
/// @param callback_group_to_executor_entity_collector Data instance for
/// @param callback_group_to_executor_entity_collector Data instance for
/// callback_group_to_executor_entity_collector trace point.
/// @param executor_entity_collector_to_executor Data instance for
/// executor_entity_collector_to_executor trace point.
Expand Down Expand Up @@ -183,7 +182,8 @@ class DataContainer : public DataContainerInterface
std::shared_ptr<ConstructExecutor::KeysT> construct_executor,
std::shared_ptr<ConstructStaticExecutor::KeysT> construct_static_executor,
#ifdef ROS_DISTRO_JAZZY
std::shared_ptr<CallbackGroupToExecutorEntityCollector::KeysT> callback_group_to_executor_entity_collector,
std::shared_ptr<CallbackGroupToExecutorEntityCollector::KeysT>
callback_group_to_executor_entity_collector,
std::shared_ptr<ExecutorEntityCollectorToExecutor::KeysT> executor_entity_collector_to_executor,
#endif
std::shared_ptr<RclClientInit::KeysT> rcl_client_init, std::shared_ptr<RclInit::KeysT> rcl_init,
Expand Down Expand Up @@ -540,11 +540,13 @@ class DataContainer : public DataContainerInterface

/// @brief Assign recording function for callback_group_to_executor_entity_collector trace points.
/// @param record recording function.
void assign_callback_group_to_executor_entity_collector(CallbackGroupToExecutorEntityCollector::StdFuncT record);
void assign_callback_group_to_executor_entity_collector(
CallbackGroupToExecutorEntityCollector::StdFuncT record);

/// @brief Assign recording function for executor_entity_collector_to_executor trace points.
/// @param record recording function.
void assign_executor_entity_collector_to_executor(ExecutorEntityCollectorToExecutor::StdFuncT record);
void assign_executor_entity_collector_to_executor(
ExecutorEntityCollectorToExecutor::StdFuncT record);

/// @brief Assign recording function for rcl_client_init trace points.
/// @param record recording function.
Expand Down Expand Up @@ -655,11 +657,13 @@ class DataContainer : public DataContainerInterface
/// @return True if function is assigned, false otherwise.
bool is_assigned_construct_static_executor() const;

/// @brief Check whether recording function for callback_group_to_executor_entity_collector trace point is assigned.
/// @brief Check whether recording function for callback_group_to_executor_entity_collector trace
/// point is assigned.
/// @return True if function is assigned, false otherwise.
bool is_assigned_callback_group_to_executor_entity_collector() const;

/// @brief Check whether recording function for executor_entity_collector_to_executor trace point is assigned.
/// @brief Check whether recording function for executor_entity_collector_to_executor trace point
/// is assigned.
/// @return True if function is assigned, false otherwise.
bool is_assigned_executor_entity_collector_to_executor() const;

Expand Down Expand Up @@ -751,7 +755,8 @@ class DataContainer : public DataContainerInterface
std::shared_ptr<CallbackGroupAddTimer::KeysT> callback_group_add_timer_;
std::shared_ptr<ConstructExecutor::KeysT> construct_executor_;
std::shared_ptr<ConstructStaticExecutor::KeysT> construct_static_executor_;
std::shared_ptr<CallbackGroupToExecutorEntityCollector::KeysT> callback_group_to_executor_entity_collector_;
std::shared_ptr<CallbackGroupToExecutorEntityCollector::KeysT>
callback_group_to_executor_entity_collector_;
std::shared_ptr<ExecutorEntityCollectorToExecutor::KeysT> executor_entity_collector_to_executor_;
std::shared_ptr<RclClientInit::KeysT> rcl_client_init_;
std::shared_ptr<RclInit::KeysT> rcl_init_;
Expand Down
15 changes: 10 additions & 5 deletions CARET_trace/src/data_container.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -38,8 +38,10 @@ DataContainer::DataContainer()
std::make_shared<ConstructExecutor::KeysT>("construct_executor"),
std::make_shared<ConstructStaticExecutor::KeysT>("construct_static_executor"),
#ifdef ROS_DISTRO_JAZZY
std::make_shared<CallbackGroupToExecutorEntityCollector::KeysT>("callback_group_to_executor_entity_collector"),
std::make_shared<ExecutorEntityCollectorToExecutor::KeysT>("executor_entity_collector_to_executor"),
std::make_shared<CallbackGroupToExecutorEntityCollector::KeysT>(
"callback_group_to_executor_entity_collector"),
std::make_shared<ExecutorEntityCollectorToExecutor::KeysT>(
"executor_entity_collector_to_executor"),
#endif
std::make_shared<RclClientInit::KeysT>("rcl_client_init"),
std::make_shared<RclInit::KeysT>("rcl_init"),
Expand Down Expand Up @@ -71,7 +73,8 @@ DataContainer::DataContainer(
std::shared_ptr<ConstructExecutor::KeysT> construct_executor,
std::shared_ptr<ConstructStaticExecutor::KeysT> construct_static_executor,
#ifdef ROS_DISTRO_JAZZY
std::shared_ptr<CallbackGroupToExecutorEntityCollector::KeysT> callback_group_to_executor_entity_collector,
std::shared_ptr<CallbackGroupToExecutorEntityCollector::KeysT>
callback_group_to_executor_entity_collector,
std::shared_ptr<ExecutorEntityCollectorToExecutor::KeysT> executor_entity_collector_to_executor,
#endif
std::shared_ptr<RclClientInit::KeysT> rcl_client_init, std::shared_ptr<RclInit::KeysT> rcl_init,
Expand Down Expand Up @@ -294,13 +297,15 @@ void DataContainer::assign_construct_static_executor(ConstructStaticExecutor::St
}

#ifdef ROS_DISTRO_JAZZY
void DataContainer::assign_callback_group_to_executor_entity_collector(CallbackGroupToExecutorEntityCollector::StdFuncT record)
void DataContainer::assign_callback_group_to_executor_entity_collector(
CallbackGroupToExecutorEntityCollector::StdFuncT record)
{
assert(callback_group_to_executor_entity_collector_.get() != nullptr);
callback_group_to_executor_entity_collector_->assign(record);
}

void DataContainer::assign_executor_entity_collector_to_executor(ExecutorEntityCollectorToExecutor::StdFuncT record)
void DataContainer::assign_executor_entity_collector_to_executor(
ExecutorEntityCollectorToExecutor::StdFuncT record)
{
assert(executor_entity_collector_to_executor_.get() != nullptr);
executor_entity_collector_to_executor_->assign(record);
Expand Down
23 changes: 13 additions & 10 deletions CARET_trace/src/hooked_trace_points.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -167,9 +167,8 @@ class ExecutorPublic : public rclcpp::Executor
} // namespace executors
} // namespace rclcpp

using CallbackGroupCollection = std::set<
rclcpp::CallbackGroup::WeakPtr,
std::owner_less<rclcpp::CallbackGroup::WeakPtr>>;
using CallbackGroupCollection =
std::set<rclcpp::CallbackGroup::WeakPtr, std::owner_less<rclcpp::CallbackGroup::WeakPtr>>;

extern "C" {
// Get symbols from the DDS shared library
Expand Down Expand Up @@ -359,14 +358,17 @@ void SYMBOL_CONCAT_2(
static auto & clock = context.get_clock();
static auto & data_container = context.get_data_container();
static auto record = [](const void * obj, const void * group_addr, int64_t init_time) {
tracepoint(TRACEPOINT_PROVIDER, callback_group_to_executor_entity_collector, obj, group_addr, init_time);
tracepoint(
TRACEPOINT_PROVIDER, callback_group_to_executor_entity_collector, obj, group_addr, init_time);

#ifdef DEBUG_OUTPUT
//std::cerr << "callback_group_to_executor_entity_collector," << obj << "," << group_addr << std::endl;
// std::cerr << "callback_group_to_executor_entity_collector," << obj << "," << group_addr <<
// std::endl;
#endif
};
auto now = clock.now();
using functionT = void (*)(void *, const rclcpp::CallbackGroup::SharedPtr, const CallbackGroupCollection &);
using functionT =
void (*)(void *, const rclcpp::CallbackGroup::SharedPtr, const CallbackGroupCollection &);
((functionT)orig_func)(obj, group_ptr, collection);
auto group_addr = static_cast<const void *>(group_ptr.get());

Expand All @@ -385,18 +387,19 @@ void SYMBOL_CONCAT_2(
}

// rclcpp::Executor::Executor(rclcpp::ExecutorOptions const&)
void _ZN6rclcpp8ExecutorC2ERKNS_15ExecutorOptionsE(
void * obj, const void * option)
void _ZN6rclcpp8ExecutorC2ERKNS_15ExecutorOptionsE(void * obj, const void * option)

Check warning on line 390 in CARET_trace/src/hooked_trace_points.cpp

View workflow job for this annotation

GitHub Actions / spell-check-differential

Unknown word (ERKNS)
{
static void * orig_func = dlsym(RTLD_NEXT, __func__);
static auto & context = Singleton<Context>::get_instance();
static auto & clock = context.get_clock();
static auto & data_container = context.get_data_container();
static auto record = [](const void * obj, const void * collector_ptr, int64_t init_time) {
tracepoint(TRACEPOINT_PROVIDER, executor_entity_collector_to_executor, obj, collector_ptr, init_time);
tracepoint(
TRACEPOINT_PROVIDER, executor_entity_collector_to_executor, obj, collector_ptr, init_time);

#ifdef DEBUG_OUTPUT
std::cerr << "executor_entity_collector_to_executor," << obj << "," << collector_ptr << std::endl;
std::cerr << "executor_entity_collector_to_executor," << obj << "," << collector_ptr
<< std::endl;
#endif
};

Expand Down
4 changes: 2 additions & 2 deletions CARET_trace/test/test_data_container.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -26,9 +26,9 @@ TEST(DataContainerTest, EmptyCase)
{
#ifdef ROS_DISTRO_JAZZY
DataContainer container(
nullptr, nullptr, nullptr, nullptr, nullptr, nullptr, nullptr, nullptr, nullptr, nullptr, nullptr, nullptr,
nullptr, nullptr, nullptr, nullptr, nullptr, nullptr, nullptr, nullptr, nullptr, nullptr,
nullptr, nullptr, nullptr, nullptr, nullptr);
nullptr, nullptr, nullptr, nullptr, nullptr, nullptr, nullptr, nullptr, nullptr, nullptr,
nullptr, nullptr, nullptr, nullptr, nullptr, nullptr, nullptr);
#else
DataContainer container(
nullptr, nullptr, nullptr, nullptr, nullptr, nullptr, nullptr, nullptr, nullptr, nullptr,
Expand Down
12 changes: 6 additions & 6 deletions CARET_trace/test/test_scenario.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -58,9 +58,9 @@ TEST(ScenarioTest, TestSingleThread)

#ifdef ROS_DISTRO_JAZZY
DataContainer container(
nullptr, nullptr, nullptr, nullptr, nullptr, nullptr, nullptr, nullptr, nullptr, nullptr, nullptr, keys, nullptr,
nullptr, nullptr, nullptr, nullptr, nullptr, nullptr, nullptr, nullptr, nullptr, nullptr,
nullptr, nullptr, nullptr, nullptr);
nullptr, keys, nullptr, nullptr, nullptr, nullptr, nullptr, nullptr, nullptr, nullptr, nullptr,
nullptr, nullptr, nullptr, nullptr, nullptr, nullptr);
#else
DataContainer container(
nullptr, nullptr, nullptr, nullptr, nullptr, nullptr, nullptr, nullptr, nullptr, keys, nullptr,
Expand Down Expand Up @@ -93,9 +93,9 @@ TEST(ScenarioTest, TestMultiThread)

#ifdef ROS_DISTRO_JAZZY
DataContainer container(
nullptr, nullptr, nullptr, nullptr, nullptr, nullptr, nullptr, nullptr, nullptr, nullptr, nullptr, keys, nullptr,
nullptr, nullptr, nullptr, nullptr, nullptr, nullptr, nullptr, nullptr, nullptr, nullptr,
nullptr, nullptr, nullptr, nullptr);
nullptr, keys, nullptr, nullptr, nullptr, nullptr, nullptr, nullptr, nullptr, nullptr, nullptr,
nullptr, nullptr, nullptr, nullptr, nullptr, nullptr);
#else
DataContainer container(
nullptr, nullptr, nullptr, nullptr, nullptr, nullptr, nullptr, nullptr, nullptr, keys, nullptr,
Expand Down Expand Up @@ -236,9 +236,9 @@ TEST(ScenarioTest, Record)

#ifdef ROS_DISTRO_JAZZY
auto container = std::make_shared<DataContainer>(
nullptr, nullptr, nullptr, nullptr, nullptr, nullptr, nullptr, nullptr, nullptr, nullptr, nullptr, keys, nullptr,
nullptr, nullptr, nullptr, nullptr, nullptr, nullptr, nullptr, nullptr, nullptr, nullptr,
nullptr, nullptr, nullptr, nullptr);
nullptr, keys, nullptr, nullptr, nullptr, nullptr, nullptr, nullptr, nullptr, nullptr, nullptr,
nullptr, nullptr, nullptr, nullptr, nullptr, nullptr);
#else
auto container = std::make_shared<DataContainer>(
nullptr, nullptr, nullptr, nullptr, nullptr, nullptr, nullptr, nullptr, nullptr, keys, nullptr,
Expand Down

0 comments on commit 4ded1eb

Please sign in to comment.