2019-05-16 12:54:01 +02:00
|
|
|
#include "tracetools/tracetools.h"
|
|
|
|
|
|
|
|
#ifdef WITH_LTTNG
|
|
|
|
#include "tp_call.h"
|
|
|
|
#endif
|
|
|
|
|
|
|
|
|
2019-05-16 14:16:40 +02:00
|
|
|
bool ros_trace_compile_status()
|
|
|
|
{
|
2019-05-16 12:54:01 +02:00
|
|
|
#ifdef WITH_LTTNG
|
2019-05-16 14:16:40 +02:00
|
|
|
return true;
|
2019-05-16 12:54:01 +02:00
|
|
|
#else
|
2019-05-16 14:16:40 +02:00
|
|
|
return false;
|
2019-05-16 12:54:01 +02:00
|
|
|
#endif
|
|
|
|
}
|
|
|
|
|
2019-05-16 14:16:40 +02:00
|
|
|
void ros_trace_rcl_init()
|
|
|
|
{
|
2019-05-16 12:54:01 +02:00
|
|
|
#ifdef WITH_LTTNG
|
2019-05-16 14:16:40 +02:00
|
|
|
tracepoint(ros2, rcl_init);
|
2019-05-16 12:54:01 +02:00
|
|
|
#endif
|
|
|
|
}
|
2019-05-16 13:36:59 +02:00
|
|
|
|
2019-05-17 09:03:03 +02:00
|
|
|
void ros_trace_rcl_node_init(const char * node_name, const char * node_namespace, const void * rmw_handle)
|
2019-05-16 14:16:40 +02:00
|
|
|
{
|
2019-05-16 13:36:59 +02:00
|
|
|
#ifdef WITH_LTTNG
|
2019-05-17 09:03:03 +02:00
|
|
|
tracepoint(ros2, rcl_node_init, node_name, node_namespace, rmw_handle);
|
2019-05-16 13:36:59 +02:00
|
|
|
#endif
|
|
|
|
}
|
|
|
|
|
2019-05-17 09:03:03 +02:00
|
|
|
void ros_trace_rcl_publisher_init(const char * node_name, const char * node_namespace)
|
2019-05-16 14:16:40 +02:00
|
|
|
{
|
2019-05-16 13:36:59 +02:00
|
|
|
#ifdef WITH_LTTNG
|
2019-05-17 09:03:03 +02:00
|
|
|
tracepoint(ros2, rcl_publisher_init, node_name, node_namespace);
|
2019-05-16 13:36:59 +02:00
|
|
|
#endif
|
|
|
|
}
|
|
|
|
|
2019-05-16 14:16:40 +02:00
|
|
|
void ros_trace_rcl_subscription_init(const char * node_name, const char * topic_name)
|
|
|
|
{
|
2019-05-16 13:36:59 +02:00
|
|
|
#ifdef WITH_LTTNG
|
2019-05-16 14:16:40 +02:00
|
|
|
tracepoint(ros2, rcl_subscription_init, node_name, topic_name);
|
2019-05-16 13:36:59 +02:00
|
|
|
#endif
|
|
|
|
}
|
2019-05-17 09:05:34 +02:00
|
|
|
|
|
|
|
void ros_trace_rclcpp_callback_start(const void * callback, const bool is_intra_process)
|
|
|
|
{
|
|
|
|
#ifdef WITH_LTTNG
|
|
|
|
tracepoint(ros2, rclcpp_callback_start, callback, (is_intra_process ? 1 : 0));
|
|
|
|
#endif
|
|
|
|
}
|
|
|
|
|
|
|
|
void ros_trace_rclcpp_callback_end(const void * callback)
|
|
|
|
{
|
|
|
|
#ifdef WITH_LTTNG
|
|
|
|
tracepoint(ros2, rclcpp_callback_end, callback);
|
|
|
|
#endif
|
|
|
|
}
|