Skip to content

Commit

Permalink
Add publishing instrumentation
Browse files Browse the repository at this point in the history
Signed-off-by: Christophe Bedard <bedard.christophe@gmail.com>
  • Loading branch information
christophebedard committed Apr 1, 2021
1 parent e7e3504 commit 5b9fdca
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions rclcpp/include/rclcpp/publisher.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,8 @@
#include "rclcpp/type_support_decl.hpp"
#include "rclcpp/visibility_control.hpp"

#include "tracetools/tracetools.h"

namespace rclcpp
{

Expand Down Expand Up @@ -279,6 +281,10 @@ class Publisher : public PublisherBase
void
do_inter_process_publish(const MessageT & msg)
{
TRACEPOINT(
rclcpp_publish,
static_cast<const void *>(publisher_handle_.get()),
static_cast<const void *>(&msg));
auto status = rcl_publish(publisher_handle_.get(), &msg, nullptr);

if (RCL_RET_PUBLISHER_INVALID == status) {
Expand Down

0 comments on commit 5b9fdca

Please sign in to comment.