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 feature to record multi-host system #163

Merged
merged 9 commits into from
May 10, 2024
Merged
58 changes: 0 additions & 58 deletions ros2caret/verb/callback_graph.py

This file was deleted.

53 changes: 0 additions & 53 deletions ros2caret/verb/chain_latency.py

This file was deleted.

5 changes: 4 additions & 1 deletion ros2caret/verb/check_ctf.py
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ class CheckCTFVerb(VerbExtension):

def add_arguments(self, parser, cli_name):
parser.add_argument(
'trace_dir', type=str,
'trace_dir', type=str, nargs='+',
help='the path to the trace directory to be checked')
parser.add_argument(
'-m', '--max_callback_construction_order_on_path_searching',
Expand All @@ -40,6 +40,9 @@ def add_arguments(self, parser, cli_name):
)

def main(self, *, args):
if len(args.trace_dir) >= 2:
print('Validating multiple trace data is not supported.')
exit(0)
try:
if args.max_callback_construction_order_on_path_searching >= 0:
Lttng(args.trace_dir)
Expand Down
4 changes: 2 additions & 2 deletions ros2caret/verb/create_architecture.py
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ class CreateArchitectureVerb(VerbExtension):

def add_arguments(self, parser, cli_name):
parser.add_argument(
'trace_dir', type=str,
'trace_dir', type=str, nargs='+',
help='the path to the main trace directory'
)
parser.add_argument(
Expand Down Expand Up @@ -92,7 +92,7 @@ class CreateArchitecture:

def __init__(
self,
trace_dir: str,
trace_dir: list[str],
max_callback_construction_order_on_path_searching: int,
architecture: Optional[Architecture] = None
) -> None:
Expand Down
49 changes: 0 additions & 49 deletions ros2caret/verb/message_flow.py

This file was deleted.

2 changes: 1 addition & 1 deletion ros2caret/verb/node_summary.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ class NodeSummaryVerb(VerbExtension):

def add_arguments(self, parser, cli_name):
parser.add_argument(
'trace_dir', type=str,
'trace_dir', type=str, nargs='+',
help='the path to the trace directory'
)
parser.add_argument(
Expand Down
9 changes: 8 additions & 1 deletion ros2caret/verb/record.py
Original file line number Diff line number Diff line change
Expand Up @@ -181,6 +181,13 @@ def main(self, *, args):
context_names = names.DEFAULT_CONTEXT
events_kernel = []

# check lttng session exist
command = "lttng list | grep --quiet \'\\[active\\]\'"
ps = subprocess.run(command, shell=True)
if ps.returncode == 0:
print('LTTng session is already active.')
exit(0)

rclpy.init()
node = CaretSessionNode()

Expand Down Expand Up @@ -229,12 +236,12 @@ def _run():

def _fini():
node.stop_progress()
node.end()
if clock_recorder:
# cspell: ignore killpg, getpgid
os.killpg(os.getpgid(clock_recorder.pid), signal.SIGTERM)
print('stopping & destroying tracing session')
lttng.lttng_fini(session_name=args.session_name)
node.end()

if args.record_clock:
# cspell: ignore preexec, setpgrp
Expand Down
3 changes: 2 additions & 1 deletion ros2caret/verb/summary.py
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,8 @@

filters = self._get_filters(args.d_filter_args,
args.s_filter_args)
self._lttng = Lttng(args.trace_dir, event_filters=filters)
self._lttng = Lttng(args.trace_dir, event_filters=filters,
validate=len(args.trace_dir) == 1)
self._summary_df = self._get_summary_df(self._lttng, groupby)
self._filtered = len(filters) > 0

Expand Down Expand Up @@ -77,8 +78,8 @@

print(tabulate(self._summary_df,
self._summary_df.columns,
tablefmt='presto',

Check warning on line 81 in ros2caret/verb/summary.py

View workflow job for this annotation

GitHub Actions / spell-check-differential

Unknown word (tablefmt)
showindex=False))

Check warning on line 82 in ros2caret/verb/summary.py

View workflow job for this annotation

GitHub Actions / spell-check-differential

Unknown word (showindex)

@staticmethod
def _get_summary_df(
Expand Down
2 changes: 1 addition & 1 deletion ros2caret/verb/topic_summary.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ class TopicSummaryVerb(VerbExtension):

def add_arguments(self, parser, cli_name):
parser.add_argument(
'trace_dir', type=str,
'trace_dir', type=str, nargs='+',
help='the path to the trace directory'
)
parser.add_argument(
Expand Down
2 changes: 1 addition & 1 deletion ros2caret/verb/trace_point_summary.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ class TracePointSummaryVerb(VerbExtension):

def add_arguments(self, parser, cli_name):
parser.add_argument(
'trace_dir', type=str,
'trace_dir', type=str, nargs='+',
help='the path to the trace directory'
)
parser.add_argument(
Expand Down
4 changes: 0 additions & 4 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -44,10 +44,6 @@
ros2caret.verb.record:RecordVerb',
'version = \
ros2caret.verb.version:CaretVersionVerb',
# 'callback_graph = \
# ros2caret.verb.callback_graph:CallbackGraphVerb',
# 'chain_latency = ros2caret.verb.chain_latency:ChainLatencyVerb',
# 'message_flow = ros2caret.verb.message_flow:MessageFlowVerb',
]
},
)
Loading