-
Notifications
You must be signed in to change notification settings - Fork 8
Expand file tree
/
Copy pathcontention.sh
More file actions
executable file
·64 lines (56 loc) · 978 Bytes
/
contention.sh
File metadata and controls
executable file
·64 lines (56 loc) · 978 Bytes
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
#!/bin/bash
CYCLE=20
THREAD=1
REPEAT=1
SLOT=""
TARGET=""
FIX_PROB=""
while [[ $# -gt 1 ]]; do
key="$1"
case $key in
-c|--cycle)
CYCLE="$2"
shift
;;
-t|--thread)
THREAD="$2"
shift
;;
-r|--repeat)
REPEAT="$2"
shift
;;
-s|--slot)
SLOT="_$2"
shift
;;
-f|--fix-prob)
FIX_PROB="-f"
esac
shift
done
TARGET=${1?"$0 <OUTPUT_DIR>. Need to specify output directory"}
echo CYCLE = "$CYCLE"
echo THREAD = "$THREAD"
echo REPEAT = "$REPEAT"
echo TARGET = "$TARGET"
echo FIX_PROB = "$FIX_PROB"
mkdir -p $TARGET
PROGRAMS=(
atomic_wait_free
pthread_mutex
atomic_mutex1
atomic_mutex2
atomic_mutex3
atomic_mutex4
atomic_mutex5
pthread_rwlock
atomic_rwlock
atomic_punch_card
)
for program in ${PROGRAMS[@]}; do
echo $program
for i in `seq 1 $REPEAT`; do
perf stat -o "$TARGET/${program}${SLOT}_${THREAD}" --append ./${program}${SLOT} -c $CYCLE -t $THREAD $FIX_PROB
done
done