Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Provide non-interactive 'ros2 trace start/pause/resume/stop' commands #68

Closed
christophebedard opened this issue Apr 21, 2023 · 1 comment · Fixed by #70
Closed

Provide non-interactive 'ros2 trace start/pause/resume/stop' commands #68

christophebedard opened this issue Apr 21, 2023 · 1 comment · Fixed by #70
Assignees
Labels
enhancement New feature or request

Comments

@christophebedard
Copy link
Member

christophebedard commented Apr 21, 2023

Currently, ros2 trace cannot be used in scripts or in non-interactive environments. After running the ros2 trace command, the user needs to press start to start tracing and then enter again to stop tracing. We could provide start and stop sub-commands to do that instead. Also, sub-commands like pause and resume could help with #44:

$ ros2 trace start  ... # Same args as 'ros2 trace' except for a mandatory explicit session name, but starts tracing and returns immediately
# ... wait until initialization is done
$ ros2 trace pause <session_name>  # Pauses tracing and returns immediately
# ... some time later
$ ros2 trace resume <session_name>  # Starts tracing again and returns immediately
$ ros2 trace stop <session_name>  # Stops tracing and returns immediately

Here is a comparison with the lttng commands:

  • ros2 trace start ...: equivalent to configuring the tracing session (session name, events, etc.) and lttng start
  • ros2 trace pause <session_name>: equivalent to lttng stop
  • ros2 trace resume <session_name>: equivalent to lttng start
  • ros2 trace stop <session_name>: equivalent to [lttng stop &&] lttng destroy

We could offer a ros2 trace create ..., which would configure the tracing session without starting to trace, i.e., ros2 trace start ... without lttng start. However, since there's currently no point in configuring the tracing session without also starting to trace, this wouldn't really be useful. We can always add it later on anyway.

The implementation wouldn't be too bad. We already have separate setup(), start(), stop(), and destroy() functions in tracetools_trace/tracetools_trace/tools/lttng_impl.py.

Finally, note that lttng's start/stop/destroy don't require a session name argument, since the "current" session name is written to ~/.lttngrc: https://lttng.org/man/7/lttng-concepts/v2.13/#doc-_current_recording_session. This isn't the case when tracing using the LTTng Python bindings, but we could re-implement this functionality (e.g., write the current session name to ~/.ros/tracing/.rc).

@christophebedard christophebedard added the enhancement New feature or request label Apr 21, 2023
@christophebedard christophebedard self-assigned this Apr 21, 2023
@christophebedard
Copy link
Member Author

@iluetkeb @mjcarroll any thoughts or feedback?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant