diff --git a/tracetools/include/tracetools/tp_call.h b/tracetools/include/tracetools/tp_call.h index b69dca37..0c00843b 100644 --- a/tracetools/include/tracetools/tp_call.h +++ b/tracetools/include/tracetools/tp_call.h @@ -100,10 +100,14 @@ TRACEPOINT_EVENT( TRACEPOINT_PROVIDER, rclcpp_publish, TP_ARGS( - const void *, message_arg + const void *, publisher_handle_arg, + const void *, message_arg, + const uint64_t, message_timestamp_arg ), TP_FIELDS( + ctf_integer_hex(const void *, publisher_handle, publisher_handle_arg) ctf_integer_hex(const void *, message, message_arg) + ctf_integer(const uint64_t, message_timestamp, message_timestamp_arg) ) ) @@ -408,6 +412,66 @@ TRACEPOINT_EVENT( ) ) +TRACEPOINT_EVENT( + TRACEPOINT_PROVIDER, + message_construct, + TP_ARGS( + const void *, original_message_arg, + const void *, constructed_message_arg + ), + TP_FIELDS( + ctf_integer_hex(const void *, original_message, original_message_arg) + ctf_integer_hex(const void *, constructed_message, constructed_message_arg) + ) +) + +TRACEPOINT_EVENT( + TRACEPOINT_PROVIDER, + rclcpp_intra_publish, + TP_ARGS( + const void *, publisher_handle_arg, + const void *, message_arg, + const uint64_t, message_timestamp_arg + ), + TP_FIELDS( + ctf_integer_hex(const void *, publisher_handle, publisher_handle_arg) + ctf_integer_hex(const void *, message, message_arg) + ctf_integer(const uint64_t, message_timestamp, message_timestamp_arg) + ) +) + +TRACEPOINT_EVENT( + TRACEPOINT_PROVIDER, + dispatch_subscription_callback, + TP_ARGS( + const void *, message_arg, + const void *, callback_arg, + const uint64_t, source_timestamp_arg, + const uint64_t, message_timestamp_arg + ), + TP_FIELDS( + ctf_integer_hex(const void *, message, message_arg) + ctf_integer_hex(const void *, callback, callback_arg) + ctf_integer(const uint64_t, source_stamp, source_timestamp_arg) + ctf_integer(const uint64_t, message_timestamp, message_timestamp_arg) + ) +) + +TRACEPOINT_EVENT( + TRACEPOINT_PROVIDER, + dispatch_intra_process_subscription_callback, + TP_ARGS( + const void *, message_arg, + const void *, callback_arg, + const uint64_t, message_timestamp_arg + ), + TP_FIELDS( + ctf_integer_hex(const void *, message, message_arg) + ctf_integer_hex(const void *, callback, callback_arg) + ctf_integer(const uint64_t, message_timestamp, message_timestamp_arg) + ) +) + #endif // _TRACETOOLS__TP_CALL_H_ #include diff --git a/tracetools/include/tracetools/tracetools.h b/tracetools/include/tracetools/tracetools.h index c9afdd4c..5ec7ce31 100644 --- a/tracetools/include/tracetools/tracetools.h +++ b/tracetools/include/tracetools/tracetools.h @@ -163,11 +163,13 @@ DECLARE_TRACEPOINT( * * \param[in] publisher_handle not used, but kept for API/ABI stability * \param[in] message pointer to the message being published + * \param[in] timestamp of message header */ DECLARE_TRACEPOINT( rclcpp_publish, const void * publisher_handle, - const void * message) + const void * message, + const uint64_t message_timestamp) /// `rcl_publish` /** @@ -482,6 +484,30 @@ DECLARE_TRACEPOINT( rclcpp_executor_execute, const void * handle) +DECLARE_TRACEPOINT( + message_construct, + const void * original_message, + const void * constructed_message) + +DECLARE_TRACEPOINT( + rclcpp_intra_publish, + const void * publisher_handle, + const void * message, + const uint64_t message_timestamp) + +DECLARE_TRACEPOINT( + dispatch_subscription_callback, + const void * message, + const void * callback, + const uint64_t source_timestamp, + const uint64_t message_timestamp) + +DECLARE_TRACEPOINT( + dispatch_intra_process_subscription_callback, + const void * message, + const void * callback, + const uint64_t message_timestamp) + #ifdef __cplusplus } #endif diff --git a/tracetools/src/tracetools.c b/tracetools/src/tracetools.c index a9d1db23..7ee51480 100644 --- a/tracetools/src/tracetools.c +++ b/tracetools/src/tracetools.c @@ -97,12 +97,14 @@ void TRACEPOINT( void TRACEPOINT( rclcpp_publish, const void * publisher_handle, - const void * message) + const void * message, + const uint64_t message_timestamp) { - (void)publisher_handle; CONDITIONAL_TP( rclcpp_publish, - message); + publisher_handle, + message, + message_timestamp); } void TRACEPOINT( @@ -362,6 +364,59 @@ void TRACEPOINT( handle); } +void TRACEPOINT( + message_construct, + const void * original_message, + const void * constructed_message) +{ + CONDITIONAL_TP( + message_construct, + original_message, + constructed_message); +} + +void TRACEPOINT( + rclcpp_intra_publish, + const void * publisher_handle, + const void * message, + const uint64_t message_timestamp + ) +{ + CONDITIONAL_TP( + rclcpp_intra_publish, + publisher_handle, + message, + message_timestamp); +} + +void TRACEPOINT( + dispatch_subscription_callback, + const void * message, + const void * callback, + const uint64_t source_stamp, + const uint64_t message_timestamp) +{ + CONDITIONAL_TP( + dispatch_subscription_callback, + message, + callback, + source_stamp, + message_timestamp); +} + +void TRACEPOINT( + dispatch_intra_process_subscription_callback, + const void * message, + const void * callback, + const uint64_t message_timestamp) +{ + CONDITIONAL_TP( + dispatch_intra_process_subscription_callback, + message, + callback, + message_timestamp); +} + #ifndef _WIN32 # pragma GCC diagnostic pop #else