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 @@ -959,10 +959,14 @@ class AnySubscriptionCallback
959959#ifndef TRACETOOLS_DISABLED
960960 std::visit (
961961 [this ](auto && callback) {
962- TRACEPOINT (
963- rclcpp_callback_register,
964- static_cast <const void *>(this ),
965- tracetools::get_symbol (callback));
962+ if (TRACEPOINT_ENABLED (rclcpp_callback_register)) {
963+ char * symbol = tracetools::get_symbol (callback);
964+ DO_TRACEPOINT (
965+ rclcpp_callback_register,
966+ static_cast <const void *>(this ),
967+ symbol);
968+ std::free (symbol);
969+ }
966970 }, callback_variant_);
967971#endif // TRACETOOLS_DISABLED
968972 }
Original file line number Diff line number Diff line change @@ -220,10 +220,16 @@ class GenericTimer : public TimerBase
220220 rclcpp_timer_callback_added,
221221 static_cast <const void *>(get_timer_handle ().get ()),
222222 reinterpret_cast <const void *>(&callback_));
223- TRACEPOINT (
224- rclcpp_callback_register,
225- reinterpret_cast <const void *>(&callback_),
226- tracetools::get_symbol (callback_));
223+ #ifndef TRACETOOLS_DISABLED
224+ if (TRACEPOINT_ENABLED (rclcpp_callback_register)) {
225+ char * symbol = tracetools::get_symbol (callback_);
226+ DO_TRACEPOINT (
227+ rclcpp_callback_register,
228+ reinterpret_cast <const void *>(&callback_),
229+ symbol);
230+ std::free (symbol);
231+ }
232+ #endif
227233 }
228234
229235 // / Default destructor.
You can’t perform that action at this time.
0 commit comments