diff options
author | Bjoern Brandenburg <bbb@mpi-sws.org> | 2016-02-17 13:12:54 -0500 |
---|---|---|
committer | Bjoern Brandenburg <bbb@mpi-sws.org> | 2016-03-08 11:04:11 -0500 |
commit | 4d6773e9c1d86b198806652cfc46313df64d5767 (patch) | |
tree | 46a4149b71d33caf2ae7c80da342040d0b2c97e0 | |
parent | d085e70581760ffb9231bd01d79e08be6a1604ef (diff) |
ft-trace-overheads: make use ftcat -p to await initialization
Wait until all tracers have initialized before message to user.
-rwxr-xr-x | ft-trace-overheads | 19 |
1 files changed, 17 insertions, 2 deletions
diff --git a/ft-trace-overheads b/ft-trace-overheads index 28913e9..0651352 100755 --- a/ft-trace-overheads +++ b/ft-trace-overheads | |||
@@ -93,13 +93,17 @@ then | |||
93 | fi | 93 | fi |
94 | SCHEDULER=${SCHEDULER//[ \/_]/-} | 94 | SCHEDULER=${SCHEDULER//[ \/_]/-} |
95 | 95 | ||
96 | DIR=`mktemp -d` || die "mktemp failed" | ||
97 | |||
98 | COUNT=0 | ||
96 | for dev in $CPU_FILES | 99 | for dev in $CPU_FILES |
97 | do | 100 | do |
98 | CPU=`basename ${dev} | sed 's/ft_cpu_trace//'` | 101 | CPU=`basename ${dev} | sed 's/ft_cpu_trace//'` |
99 | TRACE="overheads_host=`hostname`_scheduler=${SCHEDULER}_trace=${NAME}_cpu=${CPU}.bin" | 102 | TRACE="overheads_host=`hostname`_scheduler=${SCHEDULER}_trace=${NAME}_cpu=${CPU}.bin" |
100 | echo "[II] Recording $dev -> $TRACE" | 103 | echo "[II] Recording $dev -> $TRACE" |
101 | $FTCAT $dev $CPU_EVENTS > $TRACE & | 104 | $FTCAT -p "$DIR/cpu$CPU.pid" $dev $CPU_EVENTS > $TRACE & |
102 | PIDS="$PIDS $!" | 105 | PIDS="$PIDS $!" |
106 | COUNT=$((COUNT + 1)) | ||
103 | done | 107 | done |
104 | 108 | ||
105 | for dev in $MSG_FILES | 109 | for dev in $MSG_FILES |
@@ -107,10 +111,21 @@ do | |||
107 | CPU=`basename ${dev} | sed 's/ft_msg_trace//'` | 111 | CPU=`basename ${dev} | sed 's/ft_msg_trace//'` |
108 | TRACE="overheads_host=`hostname`_scheduler=${SCHEDULER}_trace=${NAME}_msg=${CPU}.bin" | 112 | TRACE="overheads_host=`hostname`_scheduler=${SCHEDULER}_trace=${NAME}_msg=${CPU}.bin" |
109 | echo "[II] Recording $dev -> $TRACE" | 113 | echo "[II] Recording $dev -> $TRACE" |
110 | $FTCAT $dev $MSG_EVENTS > $TRACE & | 114 | $FTCAT -p "$DIR/msg$CPU.pid" $dev $MSG_EVENTS > $TRACE & |
111 | PIDS="$PIDS $!" | 115 | PIDS="$PIDS $!" |
116 | COUNT=$((COUNT + 1)) | ||
112 | done | 117 | done |
113 | 118 | ||
119 | READY=`ls $DIR/*.pid | wc -l` | ||
120 | while [[ $READY != $COUNT ]] | ||
121 | do | ||
122 | sleep 0.5 | ||
123 | READY=`ls $DIR/*.pid | wc -l` | ||
124 | done | ||
125 | |||
126 | rm $DIR/*.pid | ||
127 | rmdir $DIR | ||
128 | |||
114 | 129 | ||
115 | if [[ $AUTO != 1 ]] | 130 | if [[ $AUTO != 1 ]] |
116 | then | 131 | then |