summaryrefslogtreecommitdiffstats
path: root/split-locks
diff options
context:
space:
mode:
Diffstat (limited to 'split-locks')
-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