forked from Atlantic777/pmu-tools
-
Notifications
You must be signed in to change notification settings - Fork 0
/
other-tester
executable file
·81 lines (56 loc) · 1.65 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
#!/bin/sh
# tester for other programs in pmu-tools
. ./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
interval-normalize.py < x.csv
interval-normalize.py < x.csv > y.csv
grep -vq PARSE-ERROR y.csv
grep -q branch-misses,branches,context-switches,cpu-migrations,cycles,instructions,page-faults,stalled-cycles-backend,stalled-cycles-frontend,task-clock y.csv
# plot-normalized.py
plot-normalized.py -o x2.png y.csv
# interval-plot.py
interval-plot.py x.csv -o x.png
done
for args in "-l2" "--all -v" "-l3 --single-thread" ; do
EVENTMAP=${cpus[hsw]} FORCECPU=$DCPU toplev.py -I 100 $args -o x.csv -x, -a sleep 1
interval-normalize.py < x.csv
interval-normalize.py < x.csv > y.csv
grep -vq PARSE-ERROR y.csv
grep Frontend y.csv
interval-plot.py x.csv -o x.png
# plot-normalized.py
plot-normalized.py -o x2.png y.csv
done
# cputop.py
cputop.py "socket == 0"
cputop.py "thread == 0 and socket == 0"
cputop.py "thread == 1" offline
cputop.py offline online
[ $(cputop.py True | wc -l | cut -d ' ' -f 1) -eq $(getconf _NPROCESSORS_ONLN) ]
# list-events.py
EVENTMAP=${cpus[hsw]} 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]} event-translate.py r4c9 | grep -q rtm_retired.aborted
# 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