Skip to content

Commit 911e149

Browse files
Update tracing commands and tutorial
1 parent f1bb7cc commit 911e149

1 file changed

Lines changed: 8 additions & 10 deletions

File tree

  • _docs/tutorials/advanced/tracing

_docs/tutorials/advanced/tracing/index.md

Lines changed: 8 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -48,11 +48,11 @@ If the ROS 2 development tools and dependencies are not installed on your machin
4848
Now we'll download all the necessary packages. First, create your workspace.
4949

5050
```bash
51-
$ mkdir ~/ros2_ws
51+
$ mkdir -p ~/ros2_ws/src
5252
$ cd ros2_ws/
5353
```
5454

55-
Then clone everything using the following `.repos` file. It includes the core ROS 2 packages with instrumented versions of `rcl` and `rclcpp`, as well as the tracing tools and tracing analysis repos.
55+
Then clone everything using the `master` `ros2.repos` file, which includes the core ROS 2 packages with instrumented `rcl` and `rclcpp`. We will also need the trace analysis tools.
5656

5757
#### Clone source on ROS 2 eloquent
5858
```bash
@@ -69,8 +69,8 @@ $ vcs import src < all.repos
6969
#### Let's build everything and source!
7070

7171
```bash
72-
$ colcon build --symlink-install --cmake-args " -DWITH_LTTNG=ON"
73-
$ source ./install/local_setup.bash
72+
$ colcon build --symlink-install
73+
$ source install/local_setup.bash
7474
```
7575

7676
## Simple tracing example
@@ -91,7 +91,7 @@ $ ros2 launch tracetools_launch example.launch.py
9191

9292
As shown above, you should see a few output lines, and that's it.
9393

94-
You can take a look at the trace's events using `babeltrace`.
94+
By default, traces are written in the `~/.ros/tracing/` directory. You can take a look at the trace's events using `babeltrace`.
9595

9696
```bash
9797
$ cd ~/.ros/tracing/
@@ -108,15 +108,13 @@ $ babeltrace my-tracing-session/ust/
108108
<img src="/img/tutorials/tracing_babeltrace.svg" style="padding: 10px;" />
109109
</center>
110110

111-
The last part of the `babeltrace` output is shown above. This is a human-readable version of the raw Common Trace Format (CTF) data, which is a list of events. Each event has a timestamp, an event type, some information on the process that generated the event, and the fields corresponding to the event type. The last events of our trace are pairs of `ros2:callback_start` and `ros2:callback_end` events. Each contains a reference to its corresponding callback.
111+
The last part of the `babeltrace` output is shown above. This is a human-readable version of the raw Common Trace Format (CTF) data, which is a list of events. Each event has a timestamp, an event type, some information on the process that generated the event, and the fields corresponding to the event type. The last events of our trace are pairs of `ros2:callback_start` and `ros2:callback_end` events. Each one contains a reference to its corresponding callback.
112112

113-
It's now time to process the trace data! The `tracetools_analysis` package provides tools to import and process the results. We can first convert the CTF data to a pickle file. Then we can process it to get `pandas` dataframes which we can use later to run analyses.
113+
It's now time to process the trace data! The `tracetools_analysis` package provides tools to import a trace and process it. Since reading a CTF trace is slow, it first converts it to a file which we can read much faster later on. Then we can process it to get `pandas` dataframes and use those to run analyses.
114114

115115
```bash
116-
$ ros2 run tracetools_analysis convert ~/.ros/tracing/my-tracing-session/ust
117-
$ ros2 run tracetools_analysis process ~/.ros/tracing/my-tracing-session/ust/pickle
116+
$ ros2 trace-analysis process ~/.ros/tracing/my-tracing-session/ust/
118117
```
119-
120118
<center>
121119
<img src="/img/tutorials/tracing_process.svg" style="padding: 10px;" />
122120
</center>

0 commit comments

Comments
 (0)