Skip to content

Commit

Permalink
feat: reuse path report to save time (#176)
Browse files Browse the repository at this point in the history
Signed-off-by: takeshi.iwanari <take.iwiw2222@gmail.com>
  • Loading branch information
iwatake2222 authored Jun 12, 2024
1 parent bedec9d commit 34980f2
Show file tree
Hide file tree
Showing 6 changed files with 24 additions and 3 deletions.
6 changes: 5 additions & 1 deletion report/report_analysis/analyze_all.py
Original file line number Diff line number Diff line change
Expand Up @@ -115,7 +115,11 @@ def main():
app = Application(arch_path, lttng)

# Analyze
analyze_path.analyze(args, lttng, arch_path, app, args.dest_dir + '/analyze_path')
if os.path.exists(args.dest_dir + '/analyze_path/index.html'):
logger.info(f'Skip creating path report to save time')
else:
analyze_path.analyze(args, lttng, arch_path, app, args.dest_dir + '/analyze_path')

if not args.is_path_analysis_only:
analyze_node.analyze(args, lttng, arch, app, args.dest_dir + '/analyze_node')

Expand Down
7 changes: 7 additions & 0 deletions report/report_analysis/make_report.sh
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ use_python=true # to avoid reading trace data every step
script_path=$(dirname "$0")/..
trace_data_name=$(basename "${trace_data}")
report_dir_name=output/report_"${trace_data_name}"
another_report_dir_name=output/val_"${trace_data_name}"
is_path_analysis_only=${is_path_analysis_only:-false}
is_html_only=${is_html_only:-false}

Expand All @@ -21,6 +22,12 @@ fi
cp "${component_list_json}" "${report_dir_name}"/.
cp "${target_path_json}" "${report_dir_name}"/.

# Reuse path report to save time
if [ ! -f "${report_dir_name}/analyze_path/index.html" ] && [ -f "${another_report_dir_name}/analyze_path/index.html" ]; then
echo "Copy analyze_path from ${another_report_dir_name} to ${report_dir_name}"
cp -r "${another_report_dir_name}/analyze_path" "${report_dir_name}"/.
fi

if ${use_python}; then
find_valid_duration=${find_valid_duration:-false}
duration=${duration:-1200}
Expand Down
7 changes: 7 additions & 0 deletions report/report_validation/make_report.sh
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ use_python=true # to avoid reading trace data every step
script_path=$(dirname "$0")/..
trace_data_name=$(basename "${trace_data}")
report_dir_name=output/val_"${trace_data_name}"
another_report_dir_name=output/report_"${trace_data_name}"
is_path_analysis_only=${is_path_analysis_only:-false}
is_html_only=${is_html_only:-false}

Expand All @@ -22,6 +23,12 @@ cp "${component_list_json}" "${report_dir_name}"/.
cp "${target_path_json}" "${report_dir_name}"/.
cp "${callback_list_csv}" "${report_dir_name}"/.

# Reuse path report to save time
if [ ! -f "${report_dir_name}/analyze_path/index.html" ] && [ -f "${another_report_dir_name}/analyze_path/index.html" ]; then
echo "Copy analyze_path from ${another_report_dir_name} to ${report_dir_name}"
cp -r "${another_report_dir_name}/analyze_path" "${report_dir_name}"/.
fi

if ${use_python}; then
find_valid_duration=${find_valid_duration:-false}
duration=${duration:-1200}
Expand Down
5 changes: 4 additions & 1 deletion report/report_validation/validate_all.py
Original file line number Diff line number Diff line change
Expand Up @@ -128,7 +128,10 @@ def main():
app = Application(arch_path, lttng)

# Analyze and validate
analyze_path.analyze(args, lttng, arch_path, app, args.dest_dir + '/analyze_path')
if os.path.exists(args.dest_dir + '/analyze_path/index.html'):
logger.info(f'Skip creating path report to save time')
else:
analyze_path.analyze(args, lttng, arch_path, app, args.dest_dir + '/analyze_path')

if not args.is_path_analysis_only:
xaxis_type = 'sim_time' if args.sim_time else 'system_time'
Expand Down
2 changes: 1 addition & 1 deletion report/track_path/make_report_track_path.py
Original file line number Diff line number Diff line change
Expand Up @@ -115,7 +115,7 @@ def get_version_str_from_yaml(report_dir: str):
elif autoware_version == '' and pilot_auto_version:
version = version + ', ' + pilot_auto_version
if job_description:
version = version + ', ' + job_description[:20]
version = version + ', ' + job_description[:40]
if env:
version = version + ', ' + env
if route:
Expand Down
Empty file modified sample_autoware/run.sh
100644 → 100755
Empty file.

0 comments on commit 34980f2

Please sign in to comment.