Skip to content

Commit

Permalink
Do not include service/client tracepoints for Jazzy
Browse files Browse the repository at this point in the history
Signed-off-by: Christophe Bedard <[email protected]>
  • Loading branch information
christophebedard committed Dec 21, 2024
1 parent 61e1a4c commit 841afa2
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 0 deletions.
3 changes: 3 additions & 0 deletions rmw_zenoh_cpp/src/detail/rmw_client_data.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,7 @@
#include "message_type_support.hpp"
#include "qos.hpp"
#include "rmw_context_impl_s.hpp"
#include "rmw_zenoh_cpp/distro.hpp"

#include "rcpputils/scope_exit.hpp"

Expand Down Expand Up @@ -365,11 +366,13 @@ rmw_ret_t ClientData::send_request(
size_t data_length = ser.get_serialized_data_length();
*sequence_id = sequence_number_++;

#ifndef ROS_DISTRO_JAZZY
TRACETOOLS_TRACEPOINT(
rmw_send_request,
static_cast<const void *>(rmw_client_),
static_cast<const void *>(ros_request),
*sequence_id);
#endif

// Send request
zenoh::Session::GetOptions opts = zenoh::Session::GetOptions::create_default();
Expand Down
3 changes: 3 additions & 0 deletions rmw_zenoh_cpp/src/detail/rmw_service_data.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@
#include "message_type_support.hpp"
#include "logging_macros.hpp"
#include "qos.hpp"
#include "rmw_zenoh_cpp/distro.hpp"

#include "rcpputils/scope_exit.hpp"

Expand Down Expand Up @@ -460,13 +461,15 @@ rmw_ret_t ServiceData::send_response(
return RMW_RET_ERROR;
}

#ifndef ROS_DISTRO_JAZZY
TRACETOOLS_TRACEPOINT(
rmw_send_response,
static_cast<const void *>(rmw_service_),
static_cast<const void *>(ros_response),
request_id->writer_guid,
request_id->sequence_number,
source_timestamp);
#endif
loaned_query.reply(service_ke, std::move(payload), std::move(options), &result);
if (result != Z_OK) {
RMW_SET_ERROR_MSG("unable to reply");
Expand Down
7 changes: 7 additions & 0 deletions rmw_zenoh_cpp/src/rmw_zenoh.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,7 @@
#include "detail/serialization_format.hpp"
#include "detail/type_support_common.hpp"
#include "detail/zenoh_utils.hpp"
#include "rmw_zenoh_cpp/distro.hpp"

#include "rcpputils/scope_exit.hpp"

Expand Down Expand Up @@ -1509,10 +1510,12 @@ rmw_create_client(
free_rmw_client.cancel();
free_service_name.cancel();

#ifndef ROS_DISTRO_JAZZY
TRACETOOLS_TRACEPOINT(
rmw_client_init,
static_cast<const void *>(rmw_client),
client_data->copy_gid().data());
#endif
return rmw_client;
}

Expand Down Expand Up @@ -1609,13 +1612,15 @@ rmw_take_response(
RMW_CHECK_ARGUMENT_FOR_NULL(request_header, RMW_RET_INVALID_ARGUMENT);

rmw_ret_t ret = client_data->take_response(request_header, ros_response, taken);
#ifndef ROS_DISTRO_JAZZY
TRACETOOLS_TRACEPOINT(
rmw_take_response,
static_cast<const void *>(client),
static_cast<const void *>(ros_response),
request_header->request_id.sequence_number,
request_header->source_timestamp,
*taken);
#endif
return ret;
}

Expand Down Expand Up @@ -1838,13 +1843,15 @@ rmw_take_request(
request_header,
ros_request,
taken);
#ifndef ROS_DISTRO_JAZZY
TRACETOOLS_TRACEPOINT(
rmw_take_request,
static_cast<const void *>(service),
static_cast<const void *>(ros_request),
request_header->request_id.writer_guid,
request_header->request_id.sequence_number,
*taken);
#endif
return ret;
}

Expand Down

0 comments on commit 841afa2

Please sign in to comment.