New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add timestamp to rmw_publish tracepoint #454
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
(I do note that the ros_message
argument moves from the 2nd to the 3rd place in the TRACEPOINT
. I assume this is intentional.)
Question: Has dds_write_ts + dds_time() any drawbacks if compared with using plain dds_write?
None whatsoever.
45ee72d
to
fb1393c
Compare
rmw_cyclonedds_cpp/src/rmw_node.cpp
Outdated
// the following wouldn't work since dds_writecdr resets the timestamp anyways. | ||
// const dds_time_t tstamp = dds_time(); | ||
// d->timestamp.v = tstamp; | ||
TRACETOOLS_TRACEPOINT(rmw_publish, (const void *)publisher, ros_message, 0); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is a bit unfortunate. As of now dds_writecdr
will always overwrite the timestamp.
Will the serdata object outlive the dds_writecdr
function call? If so, we could maybe also take the timestamp from it after the fact.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ok, I had a closer look into cyclonedds and it looks like the serdata object does not outlive dds_writecdr
if everything is fine.
@christophebedard I'd suggest to leave it like this for the time beeing. The only way I could image that this could be fixed is add the respective API to cyclonedds.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
After having a closer look at cyclones API, it turns out that there is an APi which seems to fit this usecase quite well: dds_forwardcdr
. @eboasson and/or @ivanpauno, it would be great if you could have a look at these changes (again).
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@cwecht I'm catching up with whatever happened during my break ... I'll review as request but wanted to quickly note that this weird behaviour of dds_writecdr
is the reason I needed to fix something ... and added dds_forwardcdr
.
fb1393c
to
40cad3f
Compare
For the record: the linter warning revealed in the builds of ros2/rmw_connextdds#120 should be fixed now. |
Signed-off-by: Christopher Wecht <cwecht@mailbox.org>
40cad3f
to
fe934b5
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM!
Depends on ros2/ros2_tracing#74
For some background: ros2/ros2_tracing#73
Question: Has
dds_write_ts
+dds_time()
any drawbacks if compared with using plaindds_write
?