diff options
author | Christophe Lyon <christophe.lyon@linaro.org> | 2020-08-07 14:13:54 +0000 |
---|---|---|
committer | Christophe Lyon <christophe.lyon@linaro.org> | 2020-08-12 13:06:36 +0000 |
commit | 71dfb529fc5aa4da5714ddf13f204d0533c47832 (patch) | |
tree | cca68adaf66ee7e0896bbbcf0afaa87e9c8ed742 /tcwg-benchmark-results.sh | |
parent | 9b14091d683d9cd46b939a64b74a649fe0e5522e (diff) |
tcwg-benchmark-results.sh: Add support for --has_perf_logs option
It defaults to "yes" so that we parse perf logs by default.
Use "no" when no perf data is available (eg. when benchmarking on
bare-metal).
Change-Id: I0e6c4b4b6e39de5a55808f22154025e435561753
Diffstat (limited to 'tcwg-benchmark-results.sh')
-rwxr-xr-x | tcwg-benchmark-results.sh | 26 |
1 files changed, 21 insertions, 5 deletions
diff --git a/tcwg-benchmark-results.sh b/tcwg-benchmark-results.sh index 88e25f5f..dee59a01 100755 --- a/tcwg-benchmark-results.sh +++ b/tcwg-benchmark-results.sh @@ -17,6 +17,7 @@ verbose="${verbose-false}" # shellcheck disable=SC2154 num_entries_opt="${num_dsos+--num-dsos $num_dsos} ${num_symbols+--num-symbols $num_symbols}" entry_threshold="${entry_threshold-5}" +has_perf_logs="${has_perf_logs-yes}" verbose_opt="" if $verbose; then @@ -42,11 +43,26 @@ csvs="" for i in "${results[@]}"; do rsync -az --delete "$results_top-$i/" results-$num/ hw_tag="${i%%/*}" - $scripts/../bmk-scripts/perfdatadir2csv.sh \ - --buildid-dir local --format sample,size --sort-field sample \ - --perf-bin /usr/lib/linux-tools/$hw_tag/perf \ - $verbose_opt $num_entries_opt \ - --results-dir "results-$num/" > "$top_artifacts/results-$num.csv" + if [ x"$has_perf_logs" = xyes ]; then + $scripts/../bmk-scripts/perfdatadir2csv.sh \ + --buildid-dir local --format sample,size --sort-field sample \ + --perf-bin /usr/lib/linux-tools/$hw_tag/perf \ + $verbose_opt $num_entries_opt \ + --results-dir "results-$num/" > "$top_artifacts/results-$num.csv" + else + # No perf logs to parse, just copy the plain results.csv. + # Use 'find' because results.csv is located under + # results-$num/NODE_NAME/ and we don't want to hardcode + # NODE_NAME. Since the whole script runs under 'set -f', using + # '*' does not work. + mapfile -t this_csv < <(find results-$num -name results.csv) + if [ "${#this_csv[@]}" -eq 1 ]; then + cp -v "${this_csv[@]}" "$top_artifacts/results-$num.csv" + else + echo "ERROR: Found ${#this_csv[@]} CSV results files in results-$num, expecting a single one." + exit 1 + fi + fi csvs="$csvs $top_artifacts/results-$num.csv" num=$(($num+1)) done |