From 5d1bdd492d5012ae321bb45b0c6d09241ac1b872 Mon Sep 17 00:00:00 2001 From: "takeshi.iwanari" Date: Wed, 12 Jun 2024 16:44:59 +0900 Subject: [PATCH] feat: reuse path report to save time Signed-off-by: takeshi.iwanari --- report/report_analysis/analyze_all.py | 6 +++++- report/report_analysis/make_report.sh | 7 +++++++ report/report_validation/make_report.sh | 7 +++++++ report/report_validation/validate_all.py | 5 ++++- report/track_path/make_report_track_path.py | 2 +- sample_autoware/run.sh | 0 6 files changed, 24 insertions(+), 3 deletions(-) mode change 100644 => 100755 sample_autoware/run.sh diff --git a/report/report_analysis/analyze_all.py b/report/report_analysis/analyze_all.py index 2ca4d61b..78418801 100644 --- a/report/report_analysis/analyze_all.py +++ b/report/report_analysis/analyze_all.py @@ -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') diff --git a/report/report_analysis/make_report.sh b/report/report_analysis/make_report.sh index b571cd25..f952d3f0 100644 --- a/report/report_analysis/make_report.sh +++ b/report/report_analysis/make_report.sh @@ -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} @@ -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} diff --git a/report/report_validation/make_report.sh b/report/report_validation/make_report.sh index 264a7bda..c01c448f 100644 --- a/report/report_validation/make_report.sh +++ b/report/report_validation/make_report.sh @@ -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} @@ -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} diff --git a/report/report_validation/validate_all.py b/report/report_validation/validate_all.py index 492700bc..096c8636 100644 --- a/report/report_validation/validate_all.py +++ b/report/report_validation/validate_all.py @@ -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' diff --git a/report/track_path/make_report_track_path.py b/report/track_path/make_report_track_path.py index a175cc52..f21884c4 100644 --- a/report/track_path/make_report_track_path.py +++ b/report/track_path/make_report_track_path.py @@ -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: diff --git a/sample_autoware/run.sh b/sample_autoware/run.sh old mode 100644 new mode 100755