Comments (11)
I'm getting the exact same error. Using the default binaries that come with Ubuntu 24.04
tracetools-analysis: 3.0.0-5noble.20240426.184931
I follow steps 1 and 2 here. After killing my process and running
ros2 run tracetools_analysis process ~/.ros/tracing/test
I get the same missing events: {'Ros2Handler': {'ros2:rcl_init'}}
error that @Autostone-c received.
The catch: on the same machine, with the same versions, I receive no error when I run a standard application from a public repo. The issue is definitely my code (which is definitely invoking rcl_init), but I can't find out what is wrong.
from ros2_tracing.
For those who find this issue in the future, it can be caused by the following problems:
- The aforementioned rcl linking issue. Details unclear, but refrain from linking directly to rcl
- Mismatched root permissions between the tracer and the program. If the program is launched with root, the tracer must be launched with root
- Python environments. If your program's terminal has sourced a python environment that your tracer hasn't sourced, it will not work, (even if you prepend
env PATH="$PATH" LD_LIBRARY_PATH="$LD_LIBRARY_PATH"
to your command) - Failing to prepend the
sudo env PATH="$PATH" LD_LIBRARY_PATH="$LD_LIBRARY_PATH"
. If you open a root terminal withsudo su
, source ros and execute from there: also will not work.
The method I got working to execute a program in root is to put the following in a bash program:
ros2 trace start test-trace
./path/to/my/program
ros2 trace stop test-trace
cp -r ~/.ros/tracing/test-trace .
chown -R $SUDO_USER:$SUDO_USER test-trace
And then execute that script with:
sudo env PATH="$PATH" LD_LIBRARY_PATH="$LD_LIBRARY_PATH" bash run_and_trace_my_program.sh
This will place the trace folder in the current directory
from ros2_tracing.
Just curious: why do you need to run as root?
My application uses real-time priorities
from ros2_tracing.
What version of ROS 2 are you using? What version of tracetools_analysis
/ros2trace_analysis
are you using?
from ros2_tracing.
Since there has been no response, I'm going to close this. Feel free to re-open the issue and provide the versions of ROS 2/tracetools_analysis
that you're using if you're still facing this issue.
Given that the ros2:rcl_init
tracepoint has existed since the beginning of ros2_tracing
, the issue might be that you are not collecting ros2:rcl_init
events when tracing. Therefore, it would be useful to see the command or launch file you use to trace.
from ros2_tracing.
The catch: on the same machine, with the same versions, I receive no error when I run a standard application from a public repo. The issue is definitely my code (which is definitely invoking rcl_init), but I can't find out what is wrong.
Can you share the application you're tracing, or at least a minimal reproducer? Alternatively, you could use gdb
to make sure that rcl_init()
is called and that it runs the TRACETOOLS_TRACEPOINT()
line. https://github.com/ros2/rcl/blob/6d53d24a863c3e9e4a41e9fe5f550271210d9d9d/rcl/src/rcl/init.c#L47
from ros2_tracing.
Or alternatively, you could just comment out this line, assuming that you don't need this data: https://github.com/ros-tracing/tracetools_analysis/blob/760dca9598a04a64b2e1aef0f8e419e8018c79d6/tracetools_analysis/tracetools_analysis/processor/ros2.py#L107. Then it won't complain about it.
Of course, I'd appreciate if we could figure out why this happens, though 😁
from ros2_tracing.
My application was directly linking to rcl code, specifically the rcl_timer_get_period function. When I moved this functionality down into a modified rclcpp layer, this issue disappeared.
So my guess is it's a linking issue. When you link directly to rcl, the tracer gets uppity.
from ros2_tracing.
That's weird. Were you rebuilding rcl
from source?
If you have an application + some build steps that reproduce the issue, that's would be helpful.
from ros2_tracing.
I think I built it against the binaries. Not 100% sure.
I'm going to have to put this issue on the backburner for a couple weeks, but I'll get a reproducible gist for you hopefully by the end of the month.
from ros2_tracing.
Just curious: why do you need to run as root?
from ros2_tracing.
Related Issues (20)
- Clang warning
- Build Error HOT 3
- :farmer: Flaky test `test_generic_pub_sub__rmw_connextdds` in linux and linux-rhel nightlies HOT 3
- Request to bloom new release for Iron HOT 4
- :farmer: test_pub_sub, test_publisher and test_subscription failures HOT 3
- Process trace events into intermediate storage format HOT 4
- Destroy tracing session if it exists when tracing configuration fails
- Remove context_names parameter in Rolling
- Mention needing to start tracing before starting application
- Find solution to allow starting to trace from any point in time
- regression in build on macos HOT 1
- Provide non-interactive 'ros2 trace start/pause/resume/stop' commands HOT 1
- Proposal: move dds tracepoints to RWM layers HOT 1
- test_tracetools_launch tests causing GitHub CI to hang HOT 1
- Colcon build error after installation of ros2_tracing HOT 2
- Empty and partially-filled metadata files from trace HOT 4
- lttngpy fails to build on Windows Debug HOT 3
- Allow tracing tests to be run in parallel with tracing tests & normal tests
- Fix LTTng issue with `test_ros2trace` and `test_tracetools_launch` so that they can run tracing tests in parallel
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from ros2_tracing.