forked from andikleen/pmu-tools
-
Notifications
You must be signed in to change notification settings - Fork 0
/
other-tester
executable file
·141 lines (99 loc) · 3.17 KB
/
other-tester
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
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
#!/bin/bash
# tester for other programs in pmu-tools
# PERF=... override perf binary
# NORES=1 don't check measurement results
. ./cpumap.sh
set -e
PERF=${PERF:-perf}
failed() {
echo FAILED
}
PATH=$PATH:.
trap failed ERR 0
set -x
# XXX cgroup untested
for args in "" "-A" "--per-socket" "--per-core" "-r2" ; do
# interval-normalize.py
${PERF} stat -I100 $args -a -x, -o x$$.csv sleep 1
$WRAP interval-normalize.py --error-exit < x$$.csv
$WRAP interval-normalize.py --error-exit < x$$.csv > y$$.csv
grep -vq PARSE-ERROR y$$.csv
if [ -z "$NORES" ] ; then
for i in branch-misses branches context-switches cycles instructions page-faults ; do
grep -q $i y$$.csv
done
fi
grep -vq PARSE-ERROR x$$.csv
# plot-normalized.py
$WRAP plot-normalized.py -o x$$-2.png y$$.csv
# interval-plot.py
$WRAP interval-plot.py x$$.csv -o x$$.png
done
DYGRAPHS=""
# original url http://dygraphs.com/1.0.1/dygraph-combined.js disappeared
if [ ! -r dygraph-combined.js ] && wget https://cdnjs.cloudflare.com/ajax/libs/dygraph/1.0.1/dygraph-combined.js ; then
DYGRAPHS=1
fi
for args in "-l2" "--all -v" "-l3 --single-thread" "--all -a -A"; do
FORCEHT=1 $WRAP toplev.py -v --force-cpu ${DCPU:-hsw} --node +CPU_Utilization -I 100 $args -o x$$.csv -x, ./workloads/BC1s
$WRAP toplev.py -v --force-cpu ${DCPU:-hsw} --node +CPU_Utilization -I 100 $args -o xn$$.csv -x, ./workloads/BC1s
$WRAP interval-normalize.py --error-exit < x$$.csv
$WRAP interval-normalize.py --error-exit < x$$.csv > y$$.csv
grep -vq PARSE-ERROR y$$.csv
[ -z "$NORES" ] && grep Frontend y$$.csv
$WRAP interval-normalize.py --normalize-cpu --error-exit < x$$.csv > yc$$.csv
[ -z "$NORES" ] && grep Frontend yc$$.csv
$WRAP interval-normalize.py --normalize-cpu --error-exit < xn$$.csv > yc$$.csv
[ -z "$NORES" ] && grep Frontend yc$$.csv
if grep -q CPUs x$$.csv ; then
$WRAP utilized.py x$$.csv -o y$$.csv
[ -z "$NORES" ] && grep Frontend y$$.csv
fi
if grep -q CPUs xn$$.csv ; then
$WRAP utilized.py xn$$.csv -o y$$.csv
[ -z "$NORES" ] && grep Frontend y$$.csv
fi
$WRAP interval-plot.py x$$.csv -o x$$.png
# plot-normalized.py
$WRAP plot-normalized.py -o x$$-2.png y$$.csv
# tl-serve.py
if [ -n "$DYGRAPHS" ] ; then
$WRAP tl-serve.py --gen tls$$ x$$.csv
rm -rf tls$$
fi
# tl-barplot.py
$WRAP tl-barplot.py x$$.csv -o x$$.png
rm x$$.png x$$-2.png
done
$WRAP tl-serve.py x$$.csv &
sleep 1
unset http_proxy
curl http://localhost:9001 > /dev/null
kill %1
sleep 1
wait %1
rm x$$.csv xn$$.csv
# cputop.py
$WRAP cputop.py "socket == 0"
$WRAP cputop.py "thread == 0 and socket == 0"
$WRAP cputop.py "thread == 1" offline
$WRAP cputop.py offline online
[ $($WRAP cputop.py True | wc -l | cut -d ' ' -f 1) -eq $(getconf _NPROCESSORS_ONLN) ]
# list-events.py
EVENTMAP=${cpus[hsw]} $WRAP list-events.py > x$$.lst
[ $(wc -l x$$.lst | cut -d ' ' -f 1) -gt 20 ]
grep -qi rtm_retired.aborted x$$.lst
rm x$$.lst
# event-translate.py
EVENTMAP=${cpus[hsw]} $WRAP event-translate.py r4c9 | grep -q rtm_retired.aborted
$WRAP gen-dot.py simple > /dev/null
$WRAP gen-dot.py ivb_client_ratios > /dev/null
# untested: counterdiff.py
# may need network:
# untested: event_download.py
# need root:
# untested: msr.py
# untested: pci.py
# untested: event-rmap.py
trap "" ERR 0
echo SUCCEEDED