From c3de155d41672687aa984b5012ae1b70d40e114e Mon Sep 17 00:00:00 2001 From: Christophe Bedard Date: Wed, 26 Jun 2019 11:16:51 +0200 Subject: [PATCH 1/3] Move readme to root --- README.md | 26 ++++++++++++++++++++++++++ tracetools/README.md | 26 -------------------------- 2 files changed, 26 insertions(+), 26 deletions(-) delete mode 100644 tracetools/README.md diff --git a/README.md b/README.md index e69de29..5d7516e 100644 --- a/README.md +++ b/README.md @@ -0,0 +1,26 @@ +# tracetools + +## Building + +If tracing is not enabled when building, or if LTTng is not found, then this package will not do anything. + +To enable tracing: + +1. Install [LTTng](https://lttng.org/docs/v2.10/#doc-ubuntu): + ``` + $ sudo apt-get install lttng-tools lttng-modules-dkms liblttng-ust-dev + ``` +2. Build with the `WITH_LTTNG` flag: + ``` + $ colcon build --cmake-args " -DWITH_LTTNG=ON" + ``` +3. Check if tracing is enabled (after sourcing): + ``` + $ ros2 run tracetools tracetools_status + ``` + +## Tracing + +By default, the steps above will not lead to trace data being generated, and thus they will have no impact on execution. + +LTTng has to be enabled: TODO mention scripts diff --git a/tracetools/README.md b/tracetools/README.md deleted file mode 100644 index 5d7516e..0000000 --- a/tracetools/README.md +++ /dev/null @@ -1,26 +0,0 @@ -# tracetools - -## Building - -If tracing is not enabled when building, or if LTTng is not found, then this package will not do anything. - -To enable tracing: - -1. Install [LTTng](https://lttng.org/docs/v2.10/#doc-ubuntu): - ``` - $ sudo apt-get install lttng-tools lttng-modules-dkms liblttng-ust-dev - ``` -2. Build with the `WITH_LTTNG` flag: - ``` - $ colcon build --cmake-args " -DWITH_LTTNG=ON" - ``` -3. Check if tracing is enabled (after sourcing): - ``` - $ ros2 run tracetools tracetools_status - ``` - -## Tracing - -By default, the steps above will not lead to trace data being generated, and thus they will have no impact on execution. - -LTTng has to be enabled: TODO mention scripts From 6d8b3cde2ca7336bcc218e8662d84c5346683265 Mon Sep 17 00:00:00 2001 From: Christophe Bedard Date: Wed, 26 Jun 2019 11:18:05 +0200 Subject: [PATCH 2/3] Add short repo description --- README.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/README.md b/README.md index 5d7516e..684b35d 100644 --- a/README.md +++ b/README.md @@ -1,5 +1,7 @@ # tracetools +Tracing tools for ROS 2. + ## Building If tracing is not enabled when building, or if LTTng is not found, then this package will not do anything. From f7821e37bf57965ff4f6c4f86d4a2d6f86b34a50 Mon Sep 17 00:00:00 2001 From: Christophe Bedard Date: Wed, 26 Jun 2019 15:00:56 +0200 Subject: [PATCH 3/3] Add building and tracing instructions --- README.md | 27 +++++++++++++++++++++++---- 1 file changed, 23 insertions(+), 4 deletions(-) diff --git a/README.md b/README.md index 684b35d..4dd130e 100644 --- a/README.md +++ b/README.md @@ -8,21 +8,40 @@ If tracing is not enabled when building, or if LTTng is not found, then this pac To enable tracing: -1. Install [LTTng](https://lttng.org/docs/v2.10/#doc-ubuntu): +1. Install [LTTng](https://lttng.org/docs/#doc-ubuntu) with the Python interfaces to control tracing and read trace: ``` + $ sudo apt-add-repository ppa:lttng/stable-2.10 + $ sudo apt-get update $ sudo apt-get install lttng-tools lttng-modules-dkms liblttng-ust-dev + $ sudo apt-get install python3-babeltrace python3-lttng ``` + Note: the LTTng stable 2.10 PPA is used to get more recent versions. 2. Build with the `WITH_LTTNG` flag: ``` $ colcon build --cmake-args " -DWITH_LTTNG=ON" ``` -3. Check if tracing is enabled (after sourcing): +3. Source and check that tracing is enabled: ``` + $ source ./install/local_setup.bash $ ros2 run tracetools tracetools_status ``` ## Tracing -By default, the steps above will not lead to trace data being generated, and thus they will have no impact on execution. +The steps above will not lead to trace data being generated, and thus they will have no impact on execution. LTTng has to be enabled. The packages in this repo provide two options. -LTTng has to be enabled: TODO mention scripts +### Trace command + +The first option is to use the `ros2 trace` command. + +``` +$ ros2 trace +``` + +By default, it will enable all ROS tracepoints and a few kernel tracepoints. The trace will be written to `/tmp/session-YYYYMMDDHHMMSS`. Run the command with `-h` for more information. + +### Launch file trace action + +Another option is to use the `Trace` action in a launch file along with your `Node` action(s). + +See [this example launch file](./tracetools_launch/launch/example.launch.py) for more information.