tracetools  master
Tracing tools and instrumentation for ROS 2
Macros | Functions
tracetools.h File Reference
#include <stdint.h>
#include <string.h>
#include <stdbool.h>
#include "tracetools/config.h"
#include "tracetools/visibility_control.hpp"
Include dependency graph for tracetools.h:

Go to the source code of this file.

Macros

#define TRACEPOINT(event_name, ...)   (ros_trace_ ## event_name)(__VA_ARGS__)
 Call a tracepoint. More...
 

Functions

bool ros_trace_compile_status ()
 Get tracing compilation status. More...
 
void ros_trace_rcl_init (const void *context_handle)
 rcl_init More...
 
void ros_trace_rcl_node_init (const void *node_handle, const void *rmw_handle, const char *node_name, const char *node_namespace)
 rcl_node_init More...
 
void ros_trace_rcl_publisher_init (const void *publisher_handle, const void *node_handle, const void *rmw_publisher_handle, const char *topic_name, const size_t queue_depth)
 rcl_publisher_init More...
 
void ros_trace_rcl_subscription_init (const void *subscription_handle, const void *node_handle, const void *rmw_subscription_handle, const char *topic_name, const size_t queue_depth)
 rcl_subscription_init More...
 
void ros_trace_rclcpp_subscription_init (const void *subscription_handle, const void *subscription)
 rclcpp_subscription_init More...
 
void ros_trace_rclcpp_subscription_callback_added (const void *subscription, const void *callback)
 rclcpp_subscription_callback_added More...
 
void ros_trace_rcl_service_init (const void *service_handle, const void *node_handle, const void *rmw_service_handle, const char *service_name)
 rcl_service_init More...
 
void ros_trace_rclcpp_service_callback_added (const void *service_handle, const void *callback)
 rclcpp_service_callback_added More...
 
void ros_trace_rcl_client_init (const void *client_handle, const void *node_handle, const void *rmw_client_handle, const char *service_name)
 rcl_client_init More...
 
void ros_trace_rcl_timer_init (const void *timer_handle, int64_t period)
 rcl_timer_init More...
 
void ros_trace_rclcpp_timer_callback_added (const void *timer_handle, const void *callback)
 rclcpp_timer_callback_added More...
 
void ros_trace_rclcpp_callback_register (const void *callback, const char *function_symbol)
 rclcpp_callback_register More...
 
void ros_trace_callback_start (const void *callback, const bool is_intra_process)
 callback_start More...
 
void ros_trace_callback_end (const void *callback)
 callback_end More...
 

Macro Definition Documentation

◆ TRACEPOINT

#define TRACEPOINT (   event_name,
  ... 
)    (ros_trace_ ## event_name)(__VA_ARGS__)

Call a tracepoint.

This is the preferred method over calling the actual function directly.

Function Documentation

◆ ros_trace_compile_status()

bool ros_trace_compile_status ( )

Get tracing compilation status.

Returns
true if tracing is enabled, false otherwise

◆ ros_trace_rcl_init()

void ros_trace_rcl_init ( const void *  context_handle)

rcl_init

Initialisation for the whole process. Notes the tracetools version automatically.

Parameters
[in]context_handlepointer to the rcl_context_t handle

◆ ros_trace_rcl_node_init()

void ros_trace_rcl_node_init ( const void *  node_handle,
const void *  rmw_handle,
const char *  node_name,
const char *  node_namespace 
)

rcl_node_init

Node initialisation. Links a rcl_node_t handle to its rmw_node_t handle.

Parameters
[in]node_handlepointer to the node's rcl_node_t handle
[in]rmw_handlepointer to the node's rmw_node_t handle
[in]node_namenode name
[in]node_namespacenode namespace

◆ ros_trace_rcl_publisher_init()

void ros_trace_rcl_publisher_init ( const void *  publisher_handle,
const void *  node_handle,
const void *  rmw_publisher_handle,
const char *  topic_name,
const size_t  queue_depth 
)

rcl_publisher_init

Publisher initialisation. Links a rcl_publisher_t handle to its rcl_node_t handle and its rmw_publisher_t handle, and links it to a topic name.

Parameters
[in]publisher_handlepointer to the publisher's rcl_publisher_t handle
[in]node_handlepointer to the rcl_node_t handle of the node the publisher belongs to
[in]rmw_publisher_handlepointer to the publisher's rmw_publisher_t handle
[in]topic_namefull topic name
[in]queue_depthpublisher history depth

◆ ros_trace_rcl_subscription_init()

void ros_trace_rcl_subscription_init ( const void *  subscription_handle,
const void *  node_handle,
const void *  rmw_subscription_handle,
const char *  topic_name,
const size_t  queue_depth 
)

rcl_subscription_init

Subscription initialisation. Links a rcl_subscription_t handle to its rcl_node_t handle and its rmw_subscription_t handle, and links it to a topic name.

Parameters
[in]subscription_handlepointer to the subscription's rcl_subscription_t handle
[in]node_handlepointer to the rcl_node_t handle of the node the subscription belongs to
[in]rmw_subscription_handlepointer to the subscription's rmw_subscription_t handle
[in]topic_namefull topic name
[in]queue_depthsubscription history depth

◆ ros_trace_rclcpp_subscription_init()

void ros_trace_rclcpp_subscription_init ( const void *  subscription_handle,
const void *  subscription 
)

rclcpp_subscription_init

Subscription object initialisation. Links the rclcpp::*Subscription* object to a rcl_subscription_t handle. Needed since there could be more than 1 rclcpp::*Subscription* object for one rcl subscription (e.g. when using intra-process).

Parameters
[in]subscription_handlepointer to the rcl_subscription_t handle of the subscription this object belongs to
[in]subscriptionpointer to this subscription object (e.g. rclcpp::*Subscription*)

◆ ros_trace_rclcpp_subscription_callback_added()

void ros_trace_rclcpp_subscription_callback_added ( const void *  subscription,
const void *  callback 
)

rclcpp_subscription_callback_added

Link a subscription callback object to a subscription object.

Parameters
[in]subscriptionpointer to the subscription object this callback belongs to
[in]callbackpointer to this callback object (e.g. rclcpp::AnySubscriptionCallback)

◆ ros_trace_rcl_service_init()

void ros_trace_rcl_service_init ( const void *  service_handle,
const void *  node_handle,
const void *  rmw_service_handle,
const char *  service_name 
)

rcl_service_init

Service initialisation. Links a rcl_service_t handle to its rcl_node_t handle and its rmw_service_t handle, and links it to a service name.

Parameters
[in]service_handlepointer to the service's rcl_service_t handle
[in]node_handlepointer to the rcl_node_t handle of the node the service belongs to
[in]rmw_service_handlepointer to the service's rmw_service_t handle
[in]service_namefull service name

◆ ros_trace_rclcpp_service_callback_added()

void ros_trace_rclcpp_service_callback_added ( const void *  service_handle,
const void *  callback 
)

rclcpp_service_callback_added

Link a service callback object to a service.

Parameters
[in]service_handlepointer to the rcl_service_t handle of the service this callback belongs to
[in]callbackpointer to this callback object (e.g. rclcpp::AnyServiceCallback)

◆ ros_trace_rcl_client_init()

void ros_trace_rcl_client_init ( const void *  client_handle,
const void *  node_handle,
const void *  rmw_client_handle,
const char *  service_name 
)

rcl_client_init

Client initialisation. Links a rcl_client_t handle to its rcl_node_t handle and its rmw_client_t handle, and links it to a client name.

Parameters
[in]client_handlepointer to the client's rcl_client_t handle
[in]node_handlepointer to the rcl_node_t handle of the node the client belongs to
[in]rmw_client_handlepointer to the client's rmw_client_t handle
[in]service_namefull client name

◆ ros_trace_rcl_timer_init()

void ros_trace_rcl_timer_init ( const void *  timer_handle,
int64_t  period 
)

rcl_timer_init

Timer initialisation. Notes the timer's period.

Parameters
[in]timer_handlepointer to the timer's rcl_timer_t handle
[in]periodperiod in nanoseconds

◆ ros_trace_rclcpp_timer_callback_added()

void ros_trace_rclcpp_timer_callback_added ( const void *  timer_handle,
const void *  callback 
)

rclcpp_timer_callback_added

Link a timer callback object to its rcl_timer_t handle.

Parameters
[in]timer_handlepointer to the rcl_timer_t handle of the timer this callback belongs to
[in]callbackpointer to the callback object (std::function)

◆ ros_trace_rclcpp_callback_register()

void ros_trace_rclcpp_callback_register ( const void *  callback,
const char *  function_symbol 
)

rclcpp_callback_register

Register a demangled function symbol with a callback.

Parameters
[in]callbackpointer to the callback object (e.g. rclcpp::AnySubscriptionCallback, rclcpp::AnyServiceCallback, timer std::function, etc.)
[in]function_symboldemangled symbol of the callback function/lambda, see get_symbol()

◆ ros_trace_callback_start()

void ros_trace_callback_start ( const void *  callback,
const bool  is_intra_process 
)

callback_start

Start of a callback.

Parameters
[in]callbackpointer to this callback object (e.g. rclcpp::AnySubscriptionCallback, rclcpp::AnyServiceCallback, timer std::function, etc.)
[in]is_intra_processwhether this callback is done via intra-process or not

◆ ros_trace_callback_end()

void ros_trace_callback_end ( const void *  callback)

callback_end

End of a callback.

Parameters
[in]callbackpointer to this callback object (e.g. rclcpp::AnySubscriptionCallback, rclcpp::AnyServiceCallback, timer std::function, etc.)