diff --git a/rmw_fastrtps_dynamic_cpp/CMakeLists.txt b/rmw_fastrtps_dynamic_cpp/CMakeLists.txt
index 57c49e5ab..914e7acc7 100644
--- a/rmw_fastrtps_dynamic_cpp/CMakeLists.txt
+++ b/rmw_fastrtps_dynamic_cpp/CMakeLists.txt
@@ -36,6 +36,7 @@ find_package(rcpputils REQUIRED)
find_package(rcutils REQUIRED)
find_package(rmw_dds_common REQUIRED)
find_package(rmw_fastrtps_shared_cpp REQUIRED)
+find_package(tracetools REQUIRED)
find_package(fastrtps_cmake_module REQUIRED)
find_package(fastcdr 2 REQUIRED CONFIG)
@@ -111,6 +112,7 @@ target_link_libraries(rmw_fastrtps_dynamic_cpp PUBLIC
)
target_link_libraries(rmw_fastrtps_dynamic_cpp PRIVATE
rmw_dds_common::rmw_dds_common_library
+ tracetools::tracetools
)
configure_rmw_library(rmw_fastrtps_dynamic_cpp)
diff --git a/rmw_fastrtps_dynamic_cpp/package.xml b/rmw_fastrtps_dynamic_cpp/package.xml
index 3d3436141..f3fc46af4 100644
--- a/rmw_fastrtps_dynamic_cpp/package.xml
+++ b/rmw_fastrtps_dynamic_cpp/package.xml
@@ -31,6 +31,7 @@
rosidl_runtime_c
rosidl_typesupport_introspection_c
rosidl_typesupport_introspection_cpp
+ tracetools
fastcdr
fastrtps
@@ -43,12 +44,14 @@
rosidl_runtime_c
rosidl_typesupport_introspection_c
rosidl_typesupport_introspection_cpp
+ tracetools
ament_cmake_gtest
ament_lint_auto
ament_lint_common
osrf_testing_tools_cpp
test_msgs
+ tracetools
rmw_implementation_packages
diff --git a/rmw_fastrtps_dynamic_cpp/src/publisher.cpp b/rmw_fastrtps_dynamic_cpp/src/publisher.cpp
index c1ef92651..6d597abe7 100644
--- a/rmw_fastrtps_dynamic_cpp/src/publisher.cpp
+++ b/rmw_fastrtps_dynamic_cpp/src/publisher.cpp
@@ -45,6 +45,8 @@
#include "rmw_fastrtps_dynamic_cpp/identifier.hpp"
+#include "tracetools/tracetools.h"
+
#include "publisher.hpp"
#include "type_support_common.hpp"
#include "type_support_registry.hpp"
@@ -326,5 +328,10 @@ rmw_fastrtps_dynamic_cpp::create_publisher(
cleanup_datawriter.cancel();
return_type_support.cancel();
cleanup_info.cancel();
+
+ TRACETOOLS_TRACEPOINT(
+ rmw_publisher_init,
+ static_cast(rmw_publisher),
+ info->publisher_gid.data);
return rmw_publisher;
}
diff --git a/rmw_fastrtps_dynamic_cpp/src/subscription.cpp b/rmw_fastrtps_dynamic_cpp/src/subscription.cpp
index 5a6869783..c3d3433e3 100644
--- a/rmw_fastrtps_dynamic_cpp/src/subscription.cpp
+++ b/rmw_fastrtps_dynamic_cpp/src/subscription.cpp
@@ -51,6 +51,8 @@
#include "rmw_fastrtps_dynamic_cpp/identifier.hpp"
+#include "tracetools/tracetools.h"
+
#include "subscription.hpp"
#include "type_support_common.hpp"
#include "type_support_registry.hpp"
@@ -365,6 +367,11 @@ create_subscription(
cleanup_datareader.cancel();
return_type_support.cancel();
cleanup_info.cancel();
+
+ TRACETOOLS_TRACEPOINT(
+ rmw_subscription_init,
+ static_cast(rmw_subscription),
+ info->subscription_gid_.data);
return rmw_subscription;
}