summaryrefslogtreecommitdiffstats
path: root/split
diff options
context:
space:
mode:
authorBjoern B. Brandenburg <bbb@cs.unc.edu>2011-02-21 15:13:52 -0500
committerBjoern B. Brandenburg <bbb@cs.unc.edu>2011-02-21 15:13:52 -0500
commit60f818697e2cee718c75e78999945fe2b628c72b (patch)
tree2dac456fb600a283dafa90ed4d6630f049d02f67 /split
parent5537e1e3e8e946e93110e78a9e01c7b1ab3188d9 (diff)
Provide progress info in split
Diffstat (limited to 'split')
-rwxr-xr-xsplit22
1 files changed, 14 insertions, 8 deletions
diff --git a/split b/split
index aec5374..dc5c15c 100755
--- a/split
+++ b/split
@@ -5,25 +5,25 @@ SPLITTER=ft2csv
5EVENTS="SCHED SCHED2 TICK CXS RELEASE RELEASE_LATENCY" 5EVENTS="SCHED SCHED2 TICK CXS RELEASE RELEASE_LATENCY"
6BE_EVENTS="SEND_RESCHED" 6BE_EVENTS="SEND_RESCHED"
7 7
8OPTS=-r 8OPTS="-r"
9EXT=bin 9EXT=bin
10 10
11function do_split() { 11function do_split() {
12 printf "\nsplitting $1\n" 12 printf "\n[$NUM/$TOTAL] Splitting $1\n"
13 for E in $EVENTS; do 13 for E in $EVENTS; do
14 EP=${E/_/-} 14 EP=${E/_/-}
15 WHERE=`basename $1 | sed -e 's/.ft//' -e 's/_idx=[^_]*'// ` 15 WHERE=`basename "$1" | sed -e 's/.ft//' -e 's/_idx=[^_]*'// `
16 TARGET="${WHERE}_overhead=$EP.$EXT" 16 TARGET="${WHERE}_overhead=$EP.$EXT"
17 echo $1 $E ">>" $TARGET 17 echo $1 $E ">>" $TARGET
18 $SPLITTER $OPTS $E $1 >> $TARGET 18 $SPLITTER $OPTS $E "$1" >> $TARGET
19 done 19 done
20 for E in $BE_EVENTS; do 20 for E in $BE_EVENTS; do
21 echo $E 21 echo $E
22 EP=${E/_/-} 22 EP=${E/_/-}
23 WHERE=`basename $1 | sed -e 's/.ft//' -e 's/_idx=[^_]*'// ` 23 WHERE=`basename "$1" | sed -e 's/.ft//' -e 's/_idx=[^_]*'// `
24 TARGET="${WHERE}_overhead=$EP.$EXT" 24 TARGET="${WHERE}_overhead=$EP.$EXT"
25 echo $1 $E ">>" $TARGET 25 echo $1 $E ">>" $TARGET
26 $SPLITTER $OPTS -b $E $1 >> ${TARGET} 26 $SPLITTER $OPTS -b $E "$1" >> ${TARGET}
27 done 27 done
28} 28}
29 29
@@ -32,7 +32,13 @@ if [ ! -f "$1" ]; then
32 exit 1 32 exit 1
33fi 33fi
34 34
35while [ "" != "$*" ]; do 35TOTAL=$#
36 do_split $1 36NUM=0
37
38
39while [ "" != "$*" ]
40do
41 NUM=$((NUM + 1))
42 do_split "$1"
37 shift 43 shift
38done 44done