Add ros2trace_analysis command and process/convert verbs
This commit is contained in:
parent
42cf8a0a4a
commit
f09cd960d6
17 changed files with 335 additions and 10 deletions
|
@ -18,6 +18,7 @@
|
|||
import argparse
|
||||
import os
|
||||
import time
|
||||
from typing import Optional
|
||||
|
||||
from tracetools_analysis.conversion import ctf
|
||||
|
||||
|
@ -25,24 +26,28 @@ from tracetools_analysis.conversion import ctf
|
|||
DEFAULT_CONVERT_FILE_NAME = 'converted'
|
||||
|
||||
|
||||
def parse_args():
|
||||
parser = argparse.ArgumentParser(
|
||||
description='Convert CTF trace data to a file.')
|
||||
def add_args(parser: argparse.ArgumentParser) -> None:
|
||||
parser.add_argument(
|
||||
'trace_directory',
|
||||
help='the path to the main CTF trace directory')
|
||||
help='the path to the main trace directory')
|
||||
parser.add_argument(
|
||||
'-o', '--output-file-name', dest='output_file_name',
|
||||
default=DEFAULT_CONVERT_FILE_NAME,
|
||||
help='the name of the output file to generate, '
|
||||
'under $trace_directory (default: %(default)s)')
|
||||
|
||||
|
||||
def parse_args():
|
||||
parser = argparse.ArgumentParser(
|
||||
description='Convert trace data to a file.')
|
||||
add_args(parser)
|
||||
return parser.parse_args()
|
||||
|
||||
|
||||
def convert(
|
||||
trace_directory: str,
|
||||
output_file_name: str = DEFAULT_CONVERT_FILE_NAME,
|
||||
) -> None:
|
||||
) -> Optional[int]:
|
||||
"""
|
||||
Convert trace directory to a file.
|
||||
|
||||
|
|
|
@ -19,6 +19,7 @@ import argparse
|
|||
import os
|
||||
import sys
|
||||
import time
|
||||
from typing import Optional
|
||||
from typing import Tuple
|
||||
|
||||
from tracetools_analysis.convert import convert
|
||||
|
@ -28,9 +29,7 @@ from tracetools_analysis.processor.ros2 import Ros2Handler
|
|||
from tracetools_read.trace import is_trace_directory
|
||||
|
||||
|
||||
def parse_args():
|
||||
parser = argparse.ArgumentParser(description='Process a file converted from a trace '
|
||||
'directory and output model data.')
|
||||
def add_args(parser: argparse.ArgumentParser) -> None:
|
||||
parser.add_argument(
|
||||
'input_path',
|
||||
help='the path to a converted file to import and process, '
|
||||
|
@ -39,6 +38,12 @@ def parse_args():
|
|||
'-f', '--force-conversion', dest='force_conversion',
|
||||
action='store_true', default=False,
|
||||
help='re-convert trace directory even if converted file is found')
|
||||
|
||||
|
||||
def parse_args():
|
||||
parser = argparse.ArgumentParser(description='Process a file converted from a trace '
|
||||
'directory and output model data.')
|
||||
add_args(parser)
|
||||
return parser.parse_args()
|
||||
|
||||
|
||||
|
@ -106,7 +111,7 @@ def inspect_input_path(
|
|||
def process(
|
||||
input_path: str,
|
||||
force_conversion: bool = False,
|
||||
) -> None:
|
||||
) -> Optional[int]:
|
||||
"""
|
||||
Process converted trace file.
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue