ros-tracing/tracetools_analysis

Launching ROS2 trace from a launch file results in large tracing files (over 30 GB)

alanxuefei opened this issue · 2 comments

ros2 trace ends with 200 MB tracing logs and tracetool_analysis can visualize them.

However, launching ROS2 trace from a launch file results in large files (over 15 GB). When processing log files larger than 15 GB, my PC takes approximately 30 minutes to handle the files. However, the process is automatically terminated, as shown in the terminal output below:

ros2 trace-analysis process /logs/navigation_session_20240507_0907
converting trace directory: /logs/navigation_session_20240507_0907
Killed

Can I select only essential events to make the callback_duration.ipynb work? With all events, the logs can easily exceed 50GB after just a 10-minute run.

    ros2_tracing = Trace(
        condition=IfCondition(enable_tracing),
        session_name=f'ros_tracing_navigation_session_{timestamp}',
        events_kernel=[],  
        events_ust=['ros2:*'],  <------- this can trim down the size of tracing files significantly.
    )

Indeed, you can use the events_ust= param with the Trace action to specify userspace tracing events. However, by default, it uses the complete list of ROS 2 trace events, which should be equivalent to (or even smaller than) ros2:*, so I'm not sure why you were getting more events/data when using launch compared to ros2 trace. https://github.com/ros2/ros2_tracing/blob/c0e59c442e61f6c638f06a48a00ecf10913442fb/tracetools_launch/tracetools_launch/action.py#L113