Skip to content

Commit

Permalink
feat: support reading multi trace data (#175)
Browse files Browse the repository at this point in the history
Signed-off-by: takeshi.iwanari <[email protected]>
  • Loading branch information
iwatake2222 authored Jun 1, 2024
1 parent 871911c commit bedec9d
Show file tree
Hide file tree
Showing 5 changed files with 16 additions and 6 deletions.
2 changes: 2 additions & 0 deletions report/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@ export is_html_only=false # (optional) Set true if yo
export find_valid_duration=false # (optional) Set true so that start_strip is automatically detected
export duration=0 # (optional) Set a value (second) for duration to calculate end_strip
export trace_data=~/.ros/tracing/session-yyyymmddhhmmss # Path to CARET trace data (CTF file)
export sub_trace_data=~/.ros/tracing/session-yyyymmddhhmmss_sub # (optional) Path to CARET trace data recorded in Sub ECU (CTF file)
sh ${script_path}/make_report.sh
```

Expand Down Expand Up @@ -72,6 +73,7 @@ export is_html_only=false # (optional) Set true if yo
export find_valid_duration=false # (optional) Set true so that start_strip is automatically detected
export duration=0 # (optional) Set a value (second) for duration to calculate end_strip
export trace_data=~/.ros/tracing/session-yyyymmddhhmmss # Path to CARET trace data (CTF file)
export sub_trace_data=~/.ros/tracing/session-yyyymmddhhmmss_sub # (optional) Path to CARET trace data recorded in Sub ECU (CTF file)
sh ${script_path}/make_report.sh
```

Expand Down
9 changes: 6 additions & 3 deletions report/report_analysis/analyze_all.py
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@ def parse_arg():
description='Script to make analysis reports')
parser.add_argument('trace_data', nargs=1, type=str)
parser.add_argument('dest_dir', nargs=1, type=str)
parser.add_argument('--sub_trace_data', type=str, default='')
parser.add_argument('--component_list_json', type=str, default='')
parser.add_argument('--start_strip', type=float, default=0.0,
help='Start strip [sec] to load trace data')
Expand Down Expand Up @@ -77,6 +78,7 @@ def main():
logger.debug(f'trace_data: {args.trace_data}')
args.dest_dir = args.dest_dir[0]
logger.debug(f'dest_dir: {args.dest_dir}')
logger.debug(f'sub_trace_data: {args.sub_trace_data}')
logger.debug(f'component_list_json: {args.component_list_json}')
logger.debug(f'start_strip: {args.start_strip}, end_strip: {args.end_strip}')
logger.debug(f'sim_time: {args.sim_time}')
Expand All @@ -93,8 +95,9 @@ def main():
logger.debug(f'skip_first_num: {args.skip_first_num}')

# Read trace data
lttng = read_trace_data(args.trace_data, args.start_strip, args.end_strip, False)
arch = Architecture('lttng', args.trace_data)
trace_data = args.trace_data if args.sub_trace_data == '' else [args.trace_data, args.sub_trace_data]
lttng = read_trace_data(trace_data, args.start_strip, args.end_strip, False)
arch = Architecture('lttng', trace_data)

# Create architecture for path analysis
arch_path = add_path_to_architecture.add_path_to_architecture(args, arch)
Expand All @@ -108,7 +111,7 @@ def main():
args.end_strip = end_strip
logger.info(f'Find valid duration. start_strip: {args.start_strip}, end_strip: {args.end_strip}')
logger.info(f'Reload trace data')
lttng = read_trace_data(args.trace_data, args.start_strip, args.end_strip, False)
lttng = read_trace_data(trace_data, args.start_strip, args.end_strip, False)
app = Application(arch_path, lttng)

# Analyze
Expand Down
1 change: 1 addition & 0 deletions report/report_analysis/make_report.sh
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@ if ${use_python}; then
if ! ${is_html_only}; then
# Analyze
python3 "${script_path}"/report_analysis/analyze_all.py "${trace_data}" "${report_dir_name}" \
--sub_trace_data="${sub_trace_data}" \
--component_list_json="${component_list_json}" \
--start_strip "${start_strip}" \
--end_strip "${end_strip}" \
Expand Down
1 change: 1 addition & 0 deletions report/report_validation/make_report.sh
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@ if ${use_python}; then
if ! ${is_html_only}; then
# Analyze and validate
python3 "${script_path}"/report_validation/validate_all.py "${trace_data}" "${report_dir_name}" \
--sub_trace_data="${sub_trace_data}" \
--component_list_json="${component_list_json}" \
--start_strip "${start_strip}" \
--end_strip "${end_strip}" \
Expand Down
9 changes: 6 additions & 3 deletions report/report_validation/validate_all.py
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,7 @@ def parse_arg():
description='Script to make validation reports')
parser.add_argument('trace_data', nargs=1, type=str)
parser.add_argument('dest_dir', nargs=1, type=str)
parser.add_argument('--sub_trace_data', type=str, default='')
parser.add_argument('--component_list_json', type=str, default='')
parser.add_argument('--start_strip', type=float, default=0.0,
help='Start strip [sec] to load trace data')
Expand Down Expand Up @@ -85,6 +86,7 @@ def main():
logger.debug(f'trace_data: {args.trace_data}')
args.dest_dir = args.dest_dir[0]
logger.debug(f'dest_dir: {args.dest_dir}')
logger.debug(f'sub_trace_data: {args.sub_trace_data}')
logger.debug(f'component_list_json: {args.component_list_json}')
logger.debug(f'start_strip: {args.start_strip}, end_strip: {args.end_strip}')
logger.debug(f'sim_time: {args.sim_time}')
Expand All @@ -106,8 +108,9 @@ def main():
logger.debug(f'expectation_callback_csv_filename: {args.expectation_callback_csv_filename}')

# Read trace data
lttng = read_trace_data(args.trace_data, args.start_strip, args.end_strip, False)
arch = Architecture('lttng', args.trace_data)
trace_data = args.trace_data if args.sub_trace_data == '' else [args.trace_data, args.sub_trace_data]
lttng = read_trace_data(trace_data, args.start_strip, args.end_strip, False)
arch = Architecture('lttng', trace_data)

# Create architecture for path analysis
arch_path = add_path_to_architecture.add_path_to_architecture(args, arch)
Expand All @@ -121,7 +124,7 @@ def main():
args.end_strip = end_strip
logger.info(f'Find valid duration. start_strip: {args.start_strip}, end_strip: {args.end_strip}')
logger.info(f'Reload trace data')
lttng = read_trace_data(args.trace_data, args.start_strip, args.end_strip, False)
lttng = read_trace_data(trace_data, args.start_strip, args.end_strip, False)
app = Application(arch_path, lttng)

# Analyze and validate
Expand Down

0 comments on commit bedec9d

Please sign in to comment.