File tree Expand file tree Collapse file tree 3 files changed +26
-12
lines changed Expand file tree Collapse file tree 3 files changed +26
-12
lines changed Original file line number Diff line number Diff line change @@ -191,10 +191,14 @@ class AnyServiceCallback
191191#ifndef TRACETOOLS_DISABLED
192192 std::visit (
193193 [this ](auto && arg) {
194- TRACEPOINT (
195- rclcpp_callback_register,
196- static_cast <const void *>(this ),
197- tracetools::get_symbol (arg));
194+ if (TRACEPOINT_ENABLED (rclcpp_callback_register)) {
195+ char * symbol = tracetools::get_symbol (arg);
196+ DO_TRACEPOINT (
197+ rclcpp_callback_register,
198+ static_cast <const void *>(this ),
199+ symbol);
200+ std::free (symbol);
201+ }
198202 }, callback_);
199203#endif // TRACETOOLS_DISABLED
200204 }
Original file line number Diff line number Diff line change @@ -965,10 +965,14 @@ class AnySubscriptionCallback
965965#ifndef TRACETOOLS_DISABLED
966966 std::visit (
967967 [this ](auto && callback) {
968- TRACEPOINT (
969- rclcpp_callback_register,
970- static_cast <const void *>(this ),
971- tracetools::get_symbol (callback));
968+ if (TRACEPOINT_ENABLED (rclcpp_callback_register)) {
969+ char * symbol = tracetools::get_symbol (callback);
970+ DO_TRACEPOINT (
971+ rclcpp_callback_register,
972+ static_cast <const void *>(this ),
973+ symbol);
974+ std::free (symbol);
975+ }
972976 }, callback_variant_);
973977#endif // TRACETOOLS_DISABLED
974978 }
Original file line number Diff line number Diff line change @@ -227,10 +227,16 @@ class GenericTimer : public TimerBase
227227 rclcpp_timer_callback_added,
228228 static_cast <const void *>(get_timer_handle ().get ()),
229229 reinterpret_cast <const void *>(&callback_));
230- TRACEPOINT (
231- rclcpp_callback_register,
232- reinterpret_cast <const void *>(&callback_),
233- tracetools::get_symbol (callback_));
230+ #ifndef TRACETOOLS_DISABLED
231+ if (TRACEPOINT_ENABLED (rclcpp_callback_register)) {
232+ char * symbol = tracetools::get_symbol (callback_);
233+ DO_TRACEPOINT (
234+ rclcpp_callback_register,
235+ reinterpret_cast <const void *>(&callback_),
236+ symbol);
237+ std::free (symbol);
238+ }
239+ #endif
234240 }
235241
236242 // / Default destructor.
You can’t perform that action at this time.
0 commit comments