2019-05-16 12:54:01 +02:00
|
|
|
#include "tracetools/tracetools.h"
|
|
|
|
|
|
|
|
#ifdef WITH_LTTNG
|
|
|
|
#include "tp_call.h"
|
2019-05-17 14:57:36 +02:00
|
|
|
#define CONDITIONAL_TP(...) \
|
|
|
|
tracepoint(__VA_ARGS__);
|
|
|
|
#else
|
|
|
|
#define CONDITIONAL_TP(...)
|
2019-05-16 12:54:01 +02:00
|
|
|
#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-17 15:42:30 +02:00
|
|
|
void TRACEPOINT(
|
|
|
|
rcl_init,
|
|
|
|
const void * context)
|
2019-05-16 14:16:40 +02:00
|
|
|
{
|
2019-05-17 15:42:30 +02:00
|
|
|
CONDITIONAL_TP(ros2, rcl_init, context);
|
2019-05-16 12:54:01 +02:00
|
|
|
}
|
2019-05-16 13:36:59 +02:00
|
|
|
|
2019-05-17 14:57:36 +02:00
|
|
|
void TRACEPOINT(
|
|
|
|
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-17 14:57:36 +02:00
|
|
|
CONDITIONAL_TP(ros2, rcl_node_init, node_name, node_namespace, rmw_handle);
|
2019-05-16 13:36:59 +02:00
|
|
|
}
|
|
|
|
|
2019-05-17 14:57:36 +02:00
|
|
|
void TRACEPOINT(
|
|
|
|
rcl_publisher_init,
|
|
|
|
const char * node_name,
|
|
|
|
const char * node_namespace)
|
2019-05-16 14:16:40 +02:00
|
|
|
{
|
2019-05-17 14:57:36 +02:00
|
|
|
CONDITIONAL_TP(ros2, rcl_publisher_init, node_name, node_namespace);
|
2019-05-16 13:36:59 +02:00
|
|
|
}
|
|
|
|
|
2019-05-17 14:57:36 +02:00
|
|
|
void TRACEPOINT(
|
|
|
|
rcl_subscription_init,
|
2019-05-17 14:59:31 +02:00
|
|
|
const void * subscription_handle,
|
2019-05-17 14:57:36 +02:00
|
|
|
const char * node_name,
|
|
|
|
const char * topic_name)
|
2019-05-16 14:16:40 +02:00
|
|
|
{
|
2019-05-17 14:59:31 +02:00
|
|
|
CONDITIONAL_TP(ros2, rcl_subscription_init, subscription_handle, node_name, topic_name);
|
|
|
|
}
|
|
|
|
|
|
|
|
void TRACEPOINT(
|
|
|
|
rclcpp_subscription_callback_added,
|
|
|
|
const void * subscription_handle,
|
|
|
|
const void * callback)
|
|
|
|
{
|
|
|
|
CONDITIONAL_TP(ros2, rclcpp_subscription_callback_added, subscription_handle, callback);
|
2019-05-16 13:36:59 +02:00
|
|
|
}
|
2019-05-17 09:05:34 +02:00
|
|
|
|
2019-05-17 14:57:36 +02:00
|
|
|
void TRACEPOINT(
|
|
|
|
rclcpp_subscription_callback_start,
|
|
|
|
const void * callback,
|
|
|
|
const bool is_intra_process)
|
2019-05-17 09:05:34 +02:00
|
|
|
{
|
2019-05-17 14:57:36 +02:00
|
|
|
CONDITIONAL_TP(ros2, rclcpp_subscription_callback_start, callback, (is_intra_process ? 1 : 0));
|
2019-05-17 09:05:34 +02:00
|
|
|
}
|
|
|
|
|
2019-05-17 14:57:36 +02:00
|
|
|
void TRACEPOINT(
|
|
|
|
rclcpp_subscription_callback_end,
|
|
|
|
const void * callback)
|
2019-05-17 09:05:34 +02:00
|
|
|
{
|
2019-05-17 14:57:36 +02:00
|
|
|
CONDITIONAL_TP(ros2, rclcpp_subscription_callback_end, callback);
|
2019-05-17 13:52:19 +02:00
|
|
|
}
|
|
|
|
|
2019-05-17 14:57:36 +02:00
|
|
|
void TRACEPOINT(
|
|
|
|
rclcpp_service_callback_start,
|
|
|
|
const void * callback)
|
2019-05-17 13:52:19 +02:00
|
|
|
{
|
2019-05-17 14:57:36 +02:00
|
|
|
CONDITIONAL_TP(ros2, rclcpp_service_callback_start, callback);
|
2019-05-17 13:52:19 +02:00
|
|
|
}
|
|
|
|
|
2019-05-17 14:57:36 +02:00
|
|
|
void TRACEPOINT(
|
|
|
|
rclcpp_service_callback_end,
|
|
|
|
const void * callback)
|
2019-05-17 13:52:19 +02:00
|
|
|
{
|
2019-05-17 14:57:36 +02:00
|
|
|
CONDITIONAL_TP(ros2, rclcpp_service_callback_end, callback);
|
2019-05-17 13:52:19 +02:00
|
|
|
}
|