Skip to content

Declare a dependency on the (Linux-only) LTTng userspace tracer #1177

@christophebedard

Description

@christophebedard

Feature request

Feature description

This is a follow-up to #957 and relates to ros2/ros2_tracing#23

I would like to discuss declaring a dependency on the LTTng userspace tracer (LTTng-UST) on Linux. I'd like to make sure that this change would be welcomed. My goal would be for this to be implemented a fair amount of time before the next release (Humble).

Core ROS 2 packages are instrumented with calls to functions provided by the tracetools package. These functions contain:

  1. LTTng tracepoints if LTTng is installed/detected and tracetools is re-compiled/overlayed
  2. nothing when building from source if LTTng isn't installed/detected
  3. nothing in debians/Linux binaries
  4. nothing in any code built for/on non-Linux platforms (macOS, Windows)

and

  1. the function calls themselves can be completely removed by building instrumented core packages with -DTRACETOOLS_DISABLED=ON

This LTTng dependency isn't declared. This was initially for simplicity (especially since this is a platform-specific dependency) and because of some concerns about overhead.

This means that this feature currently isn't available out-of-the-box; users need to manually install LTTng and build from source (or at least just tracetools), since it's not installed when installing debians or running rosdep install. This has led to some questions and issues:

As mentioned in #957 (comment), the LTTng userspace tracer is less "invasive" than the kernel tracer. I don't think we need to declare a dependency on the kernel tracer. Users could install it manually if they want to record kernel data for their analyses.

Also, in practice, the overhead is really negligible if tracepoints are not explicitly enabled: https://github.com/lttng/lttng-ust/blob/1f8a8ec9581af89d98aec47de9ad9e25087cd54a/include/lttng/tracepoint.h#L53-L62. Users/companies that do not want to ship a ROS 2-based product with LTTng can completely disable/remove it by setting the right CMake option (see item 5 above) and building from source, which I assume is something they are already doing.

Some references:

Implementation considerations

New dependencies for tracetools:

  • liblttng-ust-dev: LTTng-UST
  • lttng-tools: LTTng CLI (not strictly necessary, but recommended to be able to actually use the tracepoints)

These would of course need to be installed on the Linux ci.ros2.org executors.

If the tracing tests turn out to create problems on ci.ros2.org, skipping them could be an option, but I think it would probably be fine.

Any other platform-related considerations?

Pull requests

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions