From 42c029944b1b2402efc9d602813bd7e50e22c248 Mon Sep 17 00:00:00 2001 From: h-suzuki Date: Thu, 14 Mar 2024 09:21:36 +0000 Subject: [PATCH 1/4] Add: tracepoint for take_serialized_message Signed-off-by: h-suzuki --- .../src/common/rmw_subscription.cpp | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/rmw_connextdds_common/src/common/rmw_subscription.cpp b/rmw_connextdds_common/src/common/rmw_subscription.cpp index 8c667ee8..eb5abdad 100644 --- a/rmw_connextdds_common/src/common/rmw_subscription.cpp +++ b/rmw_connextdds_common/src/common/rmw_subscription.cpp @@ -386,6 +386,13 @@ rmw_api_connextdds_take_serialized_message( RMW_Connext_Subscriber * const sub_impl = reinterpret_cast(subscription->data); + TRACETOOLS_TRACEPOINT( + rmw_take, + subscription, + serialized_message, + (message_info ? message_info->source_timestamp : 0LL), + *taken); + return sub_impl->take_serialized(serialized_message, nullptr, taken); } @@ -413,6 +420,13 @@ rmw_api_connextdds_take_serialized_message_with_info( RMW_Connext_Subscriber * const sub_impl = reinterpret_cast(subscription->data); + TRACETOOLS_TRACEPOINT( + rmw_take, + subscription, + serialized_message, + (message_info ? message_info->source_timestamp : 0LL), + *taken); + return sub_impl->take_serialized(serialized_message, message_info, taken); } From b62c20191394c4a3e8015348a4577649726f16d2 Mon Sep 17 00:00:00 2001 From: h-suzuki Date: Thu, 14 Mar 2024 09:30:41 +0000 Subject: [PATCH 2/4] Fix: TRACETOOLS_TRACEPOINT args Signed-off-by: h-suzuki --- rmw_connextdds_common/src/common/rmw_subscription.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/rmw_connextdds_common/src/common/rmw_subscription.cpp b/rmw_connextdds_common/src/common/rmw_subscription.cpp index eb5abdad..e611ad2d 100644 --- a/rmw_connextdds_common/src/common/rmw_subscription.cpp +++ b/rmw_connextdds_common/src/common/rmw_subscription.cpp @@ -390,7 +390,7 @@ rmw_api_connextdds_take_serialized_message( rmw_take, subscription, serialized_message, - (message_info ? message_info->source_timestamp : 0LL), + 0LL, *taken); return sub_impl->take_serialized(serialized_message, nullptr, taken); @@ -424,7 +424,7 @@ rmw_api_connextdds_take_serialized_message_with_info( rmw_take, subscription, serialized_message, - (message_info ? message_info->source_timestamp : 0LL), + message_info->source_timestamp, *taken); return sub_impl->take_serialized(serialized_message, message_info, taken); From 1e69d2d336605eeebc492d200ecc50ebbf839d08 Mon Sep 17 00:00:00 2001 From: h-suzuki-isp <146712054+h-suzuki-isp@users.noreply.github.com> Date: Thu, 28 Mar 2024 11:28:32 +0900 Subject: [PATCH 3/4] Update rmw_connextdds_common/src/common/rmw_subscription.cpp Co-authored-by: Christophe Bedard Signed-off-by: h-suzuki-isp <146712054+h-suzuki-isp@users.noreply.github.com> --- rmw_connextdds_common/src/common/rmw_subscription.cpp | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/rmw_connextdds_common/src/common/rmw_subscription.cpp b/rmw_connextdds_common/src/common/rmw_subscription.cpp index e611ad2d..cc814461 100644 --- a/rmw_connextdds_common/src/common/rmw_subscription.cpp +++ b/rmw_connextdds_common/src/common/rmw_subscription.cpp @@ -386,6 +386,8 @@ rmw_api_connextdds_take_serialized_message( RMW_Connext_Subscriber * const sub_impl = reinterpret_cast(subscription->data); + rmw_ret_t rc = sub_impl->take_serialized(serialized_message, nullptr, taken); + TRACETOOLS_TRACEPOINT( rmw_take, subscription, @@ -393,7 +395,7 @@ rmw_api_connextdds_take_serialized_message( 0LL, *taken); - return sub_impl->take_serialized(serialized_message, nullptr, taken); + return rc; } From 97da1efabeeff95d5e21b2d42c300c94455dc590 Mon Sep 17 00:00:00 2001 From: h-suzuki-isp <146712054+h-suzuki-isp@users.noreply.github.com> Date: Thu, 28 Mar 2024 11:28:39 +0900 Subject: [PATCH 4/4] Update rmw_connextdds_common/src/common/rmw_subscription.cpp Co-authored-by: Christophe Bedard Signed-off-by: h-suzuki-isp <146712054+h-suzuki-isp@users.noreply.github.com> --- rmw_connextdds_common/src/common/rmw_subscription.cpp | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/rmw_connextdds_common/src/common/rmw_subscription.cpp b/rmw_connextdds_common/src/common/rmw_subscription.cpp index cc814461..601bcd4a 100644 --- a/rmw_connextdds_common/src/common/rmw_subscription.cpp +++ b/rmw_connextdds_common/src/common/rmw_subscription.cpp @@ -422,14 +422,16 @@ rmw_api_connextdds_take_serialized_message_with_info( RMW_Connext_Subscriber * const sub_impl = reinterpret_cast(subscription->data); + rmw_ret_t rc = sub_impl->take_serialized(serialized_message, message_info, taken); + TRACETOOLS_TRACEPOINT( rmw_take, subscription, serialized_message, - message_info->source_timestamp, + (message_info ? message_info->source_timestamp : 0LL), *taken); - return sub_impl->take_serialized(serialized_message, message_info, taken); + return rc; }