Git Product home page Git Product logo

Comments (11)

nightduck avatar nightduck commented on July 22, 2024 2

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.

@Autostone-c :
image

from ros2_tracing.

nightduck avatar nightduck commented on July 22, 2024 1

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 with sudo 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.

nightduck avatar nightduck commented on July 22, 2024 1

Just curious: why do you need to run as root?

My application uses real-time priorities

from ros2_tracing.

christophebedard avatar christophebedard commented on July 22, 2024

What version of ROS 2 are you using? What version of tracetools_analysis/ros2trace_analysis are you using?

from ros2_tracing.

christophebedard avatar christophebedard commented on July 22, 2024

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.

christophebedard avatar christophebedard commented on July 22, 2024

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.

christophebedard avatar christophebedard commented on July 22, 2024

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.

nightduck avatar nightduck commented on July 22, 2024

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.

christophebedard avatar christophebedard commented on July 22, 2024

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.

nightduck avatar nightduck commented on July 22, 2024

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.

christophebedard avatar christophebedard commented on July 22, 2024

Just curious: why do you need to run as root?

from ros2_tracing.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.