Make sure callback_end tracepoint is triggered in AnyServiceCallback#2670
Conversation
Signed-off-by: Christophe Bedard <christophe.bedard@apex.ai>
|
We could use {
TRACETOOLS_TRACEPOINT(callback_start, static_cast<const void *>(this), false);
+#ifndef TRACETOOLS_DISABLED
+ RCPPUTILS_SCOPE_EXIT({TRACETOOLS_TRACEPOINT(callback_end, static_cast<const void *>(this));});
+#endif // TRACETOOLS_DISABLED |
clalancette
left a comment
There was a problem hiding this comment.
We could use RCPPUTILS_SCOPE_EXIT at the top of the dispatch() method instead:
TRACETOOLS_TRACEPOINT(callback_start, static_cast<const void *>(this), false);
+#ifndef TRACETOOLS_DISABLED
+ RCPPUTILS_SCOPE_EXIT({TRACETOOLS_TRACEPOINT(callback_end, static_cast<const void *>(this));});
+#endif // TRACETOOLS_DISABLED
While I'm usually a fan of using scope exit where possible, it is a little ugly in this case, and the function is short anyway. Thus, I'm fine with what you've done here, with green CI.
|
Pulls: ros2/ros2_tracing#144, #2670 |
The
callback_endtracepoint was triggered at the end of thedispatch()method, but there is more than 1return.Relates to ros2/ros2_tracing#144