Skip to content

Commit

Permalink
review results reflected
Browse files Browse the repository at this point in the history
  • Loading branch information
miyakoshi-dev committed Nov 12, 2024
1 parent 4ded1eb commit cfa0c26
Show file tree
Hide file tree
Showing 4 changed files with 17 additions and 11 deletions.
10 changes: 10 additions & 0 deletions CARET_trace/include/caret_trace/data_container.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -152,10 +152,12 @@ 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.
#ifdef ROS_DISTRO_JAZZY
/// @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.
#endif
/// @param rcl_client_init Data instance for rcl_client_init trace point.
/// @param rcl_init Data instance for rcl_init trace point.
/// @param rcl_node_init Data instance for rcl_node_init trace point.
Expand Down Expand Up @@ -297,6 +299,7 @@ class DataContainer : public DataContainerInterface
return construct_static_executor_->store(args...);
}

#ifdef ROS_DISTRO_JAZZY
/// @brief Store data for callback_group_to_executor_entity_collector trace points.
/// @tparam ...Args Data types to be stored.
/// @param ...args Data to be stored.
Expand All @@ -318,6 +321,7 @@ class DataContainer : public DataContainerInterface
{
return executor_entity_collector_to_executor_->store(args...);
}
#endif

/// @brief Store data for rcl_node_init trace points.
/// @tparam ...Args Data types to be stored.
Expand Down Expand Up @@ -538,6 +542,7 @@ class DataContainer : public DataContainerInterface
/// @param record recording function.
void assign_construct_static_executor(ConstructStaticExecutor::StdFuncT record);

#ifdef ROS_DISTRO_JAZZY
/// @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(
Expand All @@ -547,6 +552,7 @@ class DataContainer : public DataContainerInterface
/// @param record recording function.
void assign_executor_entity_collector_to_executor(
ExecutorEntityCollectorToExecutor::StdFuncT record);
#endif

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

#ifdef ROS_DISTRO_JAZZY
/// @brief Check whether recording function for callback_group_to_executor_entity_collector trace
/// point is assigned.
/// @return True if function is assigned, false otherwise.
Expand All @@ -666,6 +673,7 @@ class DataContainer : public DataContainerInterface
/// is assigned.
/// @return True if function is assigned, false otherwise.
bool is_assigned_executor_entity_collector_to_executor() const;
#endif

/// @brief Check whether recording function for rcl_client_init trace point is assigned.
/// @return True if function is assigned, false otherwise.
Expand Down Expand Up @@ -755,9 +763,11 @@ 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_;
#ifdef ROS_DISTRO_JAZZY
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_;
std::shared_ptr<RclNodeInit::KeysT> rcl_node_init_;
Expand Down
4 changes: 2 additions & 2 deletions CARET_trace/include/caret_trace/tp.h
Original file line number Diff line number Diff line change
Expand Up @@ -50,12 +50,12 @@ TRACEPOINT_EVENT(
TP_ARGS(
const void *, rmw_publisher_handle_arg,
const void *, message_arg,
int64_t, init_timestamp_arg
int64_t, timestamp_arg
),
TP_FIELDS(
ctf_integer_hex(const void *, rmw_publisher_handle, rmw_publisher_handle_arg)
ctf_integer_hex(const void *, message, message_arg)
ctf_integer(const int64_t, init_timestamp, init_timestamp_arg)
ctf_integer(const int64_t, timestamp, timestamp_arg)
)
)
#else
Expand Down
8 changes: 2 additions & 6 deletions CARET_trace/src/hooked_trace_points.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -362,8 +362,8 @@ void SYMBOL_CONCAT_2(
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();
Expand All @@ -376,8 +376,6 @@ void SYMBOL_CONCAT_2(
return;
}

const std::string executor_type_name = "single_threaded_executor";

if (!data_container.is_assigned_callback_group_to_executor_entity_collector()) {
data_container.assign_callback_group_to_executor_entity_collector(record);
}
Expand Down Expand Up @@ -415,8 +413,6 @@ void _ZN6rclcpp8ExecutorC2ERKNS_15ExecutorOptionsE(void * obj, const void * opti
return;
}

const std::string executor_type_name = "single_threaded_executor";

if (!data_container.is_assigned_executor_entity_collector_to_executor()) {
data_container.assign_executor_entity_collector_to_executor(record);
}
Expand Down
6 changes: 3 additions & 3 deletions CARET_trace/src/ros_trace_points.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1224,7 +1224,7 @@ void ros_trace_rmw_take(
void ros_trace_rmw_publish(
const void * rmw_publisher_handle,
const void * message,
int64_t init_timestamp
int64_t timestamp
)
{
static auto & context = Singleton<Context>::get_instance();
Expand All @@ -1235,12 +1235,12 @@ void ros_trace_rmw_publish(
}

if (trace_filter_is_rcl_publish_recorded) {
tracepoint(TRACEPOINT_PROVIDER, dds_write, rmw_publisher_handle, message, init_timestamp);
tracepoint(TRACEPOINT_PROVIDER, dds_write, rmw_publisher_handle, message, timestamp);
#ifdef DEBUG_OUTPUT
std::cerr << "rmw_publish," <<
rmw_publisher_handle << "," <<
message << "," <<
init_timestamp << "," << std::endl;
timestamp << "," << std::endl;
#endif
}
}
Expand Down

0 comments on commit cfa0c26

Please sign in to comment.