-
Notifications
You must be signed in to change notification settings - Fork 39
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
[Foxy] Add support for ROS tracing tools #9
Comments
Hi @christophebedard We plan to replace "OSRF memory tools" to analyze memory allocations and use ros2_tracing instead. Could you point us in the right direction? The goal is to detect any malloc (and alike) syscalls only when a lifecycle node is in the active state.
Thanks. |
Yeah, you can't do this without having a way to know which memory allocations happened during the active state and which didn't, so you will indeed need to add tracepoints to track lifecycle state changes. I think support for this should be added to
So this is unrelated to the first point? You would need to track the execution flow across layers, e.g. by putting a tracepoint at each layer boundary. Then you use those to keep track of the "layer state." Of course this can get ugly if the execution flow is complex, i.e. if it triggers a lot of tracepoints 😆. I'm guessing you mean layers like Another way could be to gather callstack information along with the memory allocation trace events (with something like this, since this isn't a standard LTTng feature), look at the function which called
Of course! Here's a few links:
I hope that was helpful. Let me know if you need more information! |
Ok cool. In the meanwhile I can test can test the checking for memory allocations for all the tracing session.
Yes, I think this fits better with what I had in mind. Plotting memory consumption over time just for the active state could be interesting too, at least as a POC. I will start with the easiest one and I will ask for help to set up the callstack example. |
@carlossvg I've started working on this (see: https://gitlab.com/micro-ROS/ros_tracing/ros2_tracing/-/issues/99) and I was wondering if you can think of other things that would be good to instrument for lifecycle nodes (other than state transitions). I can't think of anything myself, but if there is anything it might be good to do at the same time. |
@christophebedard That's great. I think with the state transition traces most of my use case is covered. After looking at the rclcpp/rcl lifecycle implementation I can't find any clear places to put additional traces. For the moment tracing the state transitions seem to be more than enough for me. |
@christophebedard I started working on the callbacks duration scripts in this branch. I have some questions maybe you can help me to solve:
|
|
@christophebedard Thanks for the answers. I added the changes you suggested and I created the script for the timestamp differences. I created a PR here #39, feel free to provide your input and drop me a comment there if you think something can be improved. Thanks for your support. |
@carlossvg I'll take a look! I also wanted to mention (just in case) that the modifications (to |
That's right, for the moment we prefer to target the latest release. In the meanwhile, we could create a Rolling branch to test some of the new features. @LanderU What's your input on this? |
@carlossvg we can create a rolling branch and start testing features when they will integrated. |
@carlossvg @LanderU so then you'll maintain forks/branches for |
also, just to link to the various related MRs/branches from here:
the MRs are still WIP, but they should be ready soon. |
Currently we track statistics to measure real-time performance using different tools. Some of them are included in the project pendulum_tools and others are external (OSRF memory memory tools). To read this statistics we publish them using a ROS 2 publisher, which can be intrusive because it generates additional traffic, ROS 2 executables, etc.
In Eloquent ros2 tracing tools were introduced, these tools would allow to track most of the statistics we are currently tracking and even more. The advantages of using this approach are that we rely in only one tool and we can remove all the specific code to track statistics from the project. Also, the overhead of tracing tools is minimal, which makes it a less intrusive solution than the current approach.
These are some of the steps in order to add support for the ROS2 tracing tools:
on_active
event to process some statistics only in active state.Some disadvantages:
Links:
The text was updated successfully, but these errors were encountered: