blob: e2593e58fd0e32a63286cf1db2535cba92af3602 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
|
#!/bin/bash
set -ex
bmk_scripts=$(dirname $0)
function gather_perf_data ()
{
local has_perf_logs=$1
local hw_tag=$2
local results_dir=$3
local csv_results_dir=$4
if [ x"$has_perf_logs" = xyes ]; then
$bmk_scripts/perfdatadir2csv.sh \
--buildid-dir local --format sample --sort-field sample \
--perf-bin /usr/lib/linux-tools/$hw_tag/perf \
$verbose_opt $num_entries_opt \
--results-dir "$results_dir" > "$csv_results_dir/perf.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.
node_dir=$(ls -Icsv_results "$results_dir")
mapfile -t this_csv < <(find "$results_dir"/"$node_dir" -name results.csv)
if [ "${#this_csv[@]}" -eq 1 ]; then
# Remove "size" column from old results.csv
cat "${this_csv[@]}" | cut -d"," -f 1-3 \
> "$csv_results_dir/perf.csv"
# Replace CSV header with: benchmark, symbol, sample.
sed -i "1s/.*/benchmark,symbol,sample/" \
"$csv_results_dir/perf.csv"
else
echo "ERROR: Found ${#this_csv[@]} CSV results files in results-perf, expecting a single one."
exit 1
fi
fi
}
function check_option()
{
local var=$1
local msg=$2
if [ x"$var" = x"undef" ]; then
echo $msg
exit 1
fi
}
results_dir="undef"
csv_results_dir="undef"
hw_tag="undef"
has_perf_logs="undef"
verbose=false
while test $# -gt 0; do
case $1 in
--results_dir) results_dir="$2"; shift ;;
--csv_results_dir) csv_results_dir="$2"; shift;;
--hw_tag) hw_tag="$2"; shift;;
--has_perf_logs) has_perf_logs="$2"; shift;;
--verbose) verbose="$2"; shift;;
--num-symbols) num_symbols="$2"; shift;;
--num-dsos) num_dsos="$2"; shift;;
*) echo "ERROR: unknown option $1"; exit 1 ;;
esac
shift
done
check_option $results_dir "results_dir not set."
check_option $csv_results_dir "csv_results_dir not set."
check_option $hw_tag "hw_tag not set."
check_option $has_perf_logs "has_perf_logs not set."
# Gather data for perf metric.
if $verbose; then
verbose_opt="--verbose"
fi
num_entries_opt="${num_dsos+--num-dsos $num_dsos} ${num_symbols+--num-symbols $num_symbols}"
gather_perf_data $has_perf_logs $hw_tag $results_dir $csv_results_dir
# Gather data for size metric.
$bmk_scripts/size-data-to-csv.py "$results_dir" \
"$csv_results_dir/size.csv"
# Gather data for vect metric.
$bmk_scripts/vect-data-to-csv.py "$results_dir" \
"$csv_results_dir/vect.csv"
# Gather data for md5sum metric.
$bmk_scripts/md5sum-data-to-csv.py "$results_dir" \
"$csv_results_dir/md5sum.csv"
# Merge all metric csvs
$bmk_scripts/merge-metric-csvs.py \
"$csv_results_dir/perf.csv" \
"$csv_results_dir/size.csv" \
"$csv_results_dir/vect.csv" \
"$csv_results_dir/md5sum.csv" \
> "$csv_results_dir/results.csv"
|