-
Notifications
You must be signed in to change notification settings - Fork 2
/
run-spec-pop2.sh
executable file
·71 lines (61 loc) · 1.82 KB
/
run-spec-pop2.sh
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
#!/bin/bash
# Copyright (C) 2024 Embecosm Limited <www.embecosm.com>
# Contributor Jeremy Bennett <[email protected]>
# SPDX-License-Identifier: GPL-3.0-or-later
# A script to run Linux perf on the SPEC 628.pop2_s benchmark.
set -u
usage () {
cat <<EOF
Usage ./run-spec-pop2.sh : Run the SPEC 2017 628.pop2_2 benchmark under
perf
[--reportfile <file>] : Name of the report file (relative to tooling
directory). Default: prof-628.pop2_s.res
[--specdir <dir>] : Use this as the directory with the SPEC CPU
2017 installation. Default
${topdir}/install/spec-2024-08-14-08-41-03
EOF
}
topdir="$(cd $(dirname $(dirname $(readlink -f $0))) ; pwd)"
tooldir="${topdir}/tooling"
specdir="${topdir}/install/spec-2024-08-14-08-41-03"
reportfile=prof-628.pop2_s.res
set +u
until
opt="$1"
case "${opt}" in
--reportfile)
shift
reportfile=$(readlink -f $1)
;;
--specdir)
shift
specdir="$(cd $(readlink -f $1) ; pwd)"
;;
--help)
usage
exit 0
;;
?*)
usage
exit 1
;;
*)
;;
esac
[ "x${opt}" = "x" ]
do
shift
done
set -u
export PATH="${topdir}/install/bin:${PATH}"
speccpudir="${specdir}/benchspec/CPU"
cd ${speccpudir}/628.pop2_s/run/run_base_test_riscv64-qemu-default.0000
echo "Recording..."
time perf record -g -m 16M --call-graph dwarf,4096 -- qemu-riscv64 \
-cpu "rv64,zicsr=true,v=true,vext_spec=v1.0,zfh=true,zvfh=true" \
./speed_pop2_base.riscv64-qemu-default \
> pop2_s-perf.out 2>> pop2_s-perf.err
echo "Generating report..."
time perf report --stdio --call-graph "graph,0.1,caller,function" \
-k /tmp/vmlinux | \
sed -e 's/[[:space:]]*$//' > ${topdir}/tooling/${reportfile}