ros2_tracing_cpp icon indicating copy to clipboard operation
ros2_tracing_cpp copied to clipboard

FEAT: Distinguishing between callback types

Open wkaisertexas opened this issue 1 year ago • 0 comments

Using rclcpp_timer_callback_added, rclcpp_subscription_callback_added, and rclcpp_service_callback_added the types of callbacks can be differentiated.

DEFINE_TRACEPOINT(
  rclcpp_timer_callback_added,
  TRACEPOINT_PARAMS(
    const void * timer_handle,
    const void * callback),
  TRACEPOINT_ARGS(
    timer_handle,
    callback))

DEFINE_TRACEPOINT(
  rclcpp_subscription_callback_added,
  TRACEPOINT_PARAMS(
    const void * subscription,
    const void * callback),
  TRACEPOINT_ARGS(
    subscription,
    callback))

DEFINE_TRACEPOINT(
  rclcpp_service_callback_added,
  TRACEPOINT_PARAMS(
    const void * service_handle,
    const void * callback),
  TRACEPOINT_ARGS(
    service_handle,
    callback))

Because the name of the function is unfortunately mangled in the callback, this could help distinguish them without significantly contributing to tracing overhead.

wkaisertexas avatar Nov 11 '24 17:11 wkaisertexas