Skip to content

Commit

Permalink
add option for recording immediately
Browse files Browse the repository at this point in the history
Signed-off-by: yamasaki <[email protected]>
  • Loading branch information
ymski committed Oct 5, 2023
1 parent f410165 commit 1c20044
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 1 deletion.
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

0 comments on commit 1c20044

Please sign in to comment.