summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorBjoern B. Brandenburg <bbb@cs.unc.edu>2011-07-29 12:11:01 -0400
committerBjoern B. Brandenburg <bbb@cs.unc.edu>2011-07-29 12:11:01 -0400
commit6d2ae786660c87ab704e615f68843d21be70c37e (patch)
treeb9538a99f1f3083edaf2cf738653ef306baa4dff
parent38c8f0ad0b5fafbdf6f956eb6c489710e56f569f (diff)
Add script for extracting locking overheads.
-rwxr-xr-xsplit-locks36
1 files changed, 36 insertions, 0 deletions
diff --git a/split-locks b/split-locks
new file mode 100755
index 0000000..b0a8bed
--- /dev/null
+++ b/split-locks
@@ -0,0 +1,36 @@
1#!/bin/bash
2
3SPLITTER=ft2csv
4
5EVENTS="LOCK UNLOCK READ_LOCK READ_UNLOCK SYSCALL_IN SYSCALL_OUT"
6
7
8OPTS="-r"
9EXT=bin
10
11function do_split() {
12 printf "\n[$NUM/$TOTAL] Splitting $1\n"
13 for E in $EVENTS; do
14 EP=${E/_/-}
15 WHERE=`basename "$1" | sed -e 's/.ft//' -e 's/_idx=[^_]*'// `
16 TARGET="${WHERE}_overhead=$EP.$EXT"
17 echo $1 $E ">>" $TARGET
18 $SPLITTER $OPTS $E "$1" >> $TARGET
19 done
20}
21
22if [ ! -f "$1" ]; then
23 echo "Usage: split-locks <file.ft>+"
24 exit 1
25fi
26
27TOTAL=$#
28NUM=0
29
30
31while [ "" != "$*" ]
32do
33 NUM=$((NUM + 1))
34 do_split "$1"
35 shift
36done