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

feat: add option for record start immediately #123

Merged
merged 1 commit into from
Oct 11, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion ros2caret/verb/caret_record_init.py
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,7 @@ def init(
subbuffer_size_kernel: int,
display_list: bool = False,
append_trace: bool = True,
immediate: bool = False,
) -> bool:
"""
Init and start tracing.
Expand Down Expand Up @@ -101,7 +102,8 @@ def init(

print(f'writing tracing session to: {full_session_path}')

input('press enter to start...')
if not immediate:
input('press enter to start...')
# for iron, rolling
if os.environ['ROS_DISTRO'] in ['iron', 'rolling']:
trace_directory = lttng.lttng_init(
Expand Down
4 changes: 4 additions & 0 deletions ros2caret/verb/record.py
Original file line number Diff line number Diff line change
Expand Up @@ -146,6 +146,9 @@ def add_arguments(self, parser, cli_name):
help='the size of the subbuffers for kernel events(default: 32*4096). '
'buffer size must be power of two. '
'available in iron or rolling only. ')
parser.add_argument(
'--immediate', dest='immediate', action='store_true',
help='record immediately. ')

def main(self, *, args):
if args.light_mode:
Expand Down Expand Up @@ -202,6 +205,7 @@ def main(self, *, args):
if args.subbuffer_size_kernel & (args.subbuffer_size_kernel-1):
raise ValueError('--subbuffer-size-kernel value must be power of two.')
init_args['subbuffer_size_kernel'] = args.subbuffer_size_kernel
init_args['immediate'] = args.immediate
init(**init_args)

def _run():
Expand Down