Add missing service callback registration tracepoint (#986)

Signed-off-by: Christophe Bedard <bedard.christophe@gmail.com>
This commit is contained in:
Christophe Bedard 2020-02-26 07:51:38 -05:00 committed by GitHub
parent 9c002c65da
commit 2371923761
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 19 additions and 0 deletions

View file

@ -24,6 +24,7 @@
#include "rclcpp/visibility_control.hpp" #include "rclcpp/visibility_control.hpp"
#include "rmw/types.h" #include "rmw/types.h"
#include "tracetools/tracetools.h" #include "tracetools/tracetools.h"
#include "tracetools/utils.hpp"
namespace rclcpp namespace rclcpp
{ {
@ -98,6 +99,21 @@ public:
} }
TRACEPOINT(callback_end, (const void *)this); TRACEPOINT(callback_end, (const void *)this);
} }
void register_callback_for_tracing()
{
if (shared_ptr_callback_) {
TRACEPOINT(
rclcpp_callback_register,
(const void *)this,
get_symbol(shared_ptr_callback_));
} else if (shared_ptr_with_request_header_callback_) {
TRACEPOINT(
rclcpp_callback_register,
(const void *)this,
get_symbol(shared_ptr_with_request_header_callback_));
}
}
}; };
} // namespace rclcpp } // namespace rclcpp

View file

@ -159,6 +159,7 @@ public:
rclcpp_service_callback_added, rclcpp_service_callback_added,
(const void *)get_service_handle().get(), (const void *)get_service_handle().get(),
(const void *)&any_callback_); (const void *)&any_callback_);
any_callback_.register_callback_for_tracing();
} }
Service( Service(
@ -181,6 +182,7 @@ public:
rclcpp_service_callback_added, rclcpp_service_callback_added,
(const void *)get_service_handle().get(), (const void *)get_service_handle().get(),
(const void *)&any_callback_); (const void *)&any_callback_);
any_callback_.register_callback_for_tracing();
} }
Service( Service(
@ -205,6 +207,7 @@ public:
rclcpp_service_callback_added, rclcpp_service_callback_added,
(const void *)get_service_handle().get(), (const void *)get_service_handle().get(),
(const void *)&any_callback_); (const void *)&any_callback_);
any_callback_.register_callback_for_tracing();
} }
Service() = delete; Service() = delete;