Skip to content
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

Merged
merged 1 commit into from Jan 23, 2024

Conversation

cwecht
Copy link
Contributor

@cwecht cwecht commented May 15, 2023

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 plain dds_write?

Copy link
Collaborator

@eboasson eboasson left a 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.

@cwecht cwecht force-pushed the extend_rmw_publish_tracepoint branch from 45ee72d to fb1393c Compare December 15, 2023 16:17
// 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);
Copy link
Contributor Author

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.

Copy link
Contributor Author

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.

Copy link
Contributor Author

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).

Copy link
Collaborator

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.

@cwecht
Copy link
Contributor Author

cwecht commented Dec 22, 2023

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>
@cwecht cwecht force-pushed the extend_rmw_publish_tracepoint branch from 40cad3f to fe934b5 Compare January 2, 2024 08:35
@cwecht cwecht requested a review from eboasson January 11, 2024 08:00
Copy link
Collaborator

@eboasson eboasson left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM!

@mjcarroll mjcarroll merged commit 5bcdaed into ros2:rolling Jan 23, 2024
1 of 2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants