diff options
| author | Bjoern Brandenburg <bbb@mpi-sws.org> | 2016-02-17 13:18:08 -0500 |
|---|---|---|
| committer | Bjoern Brandenburg <bbb@mpi-sws.org> | 2016-03-08 11:04:43 -0500 |
| commit | bc038aebddbb1fce1f9176565efae0cdf1f3f68c (patch) | |
| tree | 301660a833d72620f5fbed4ffe18bffa80c6e10c | |
| parent | 10537e151ab69299f0ba3c504fda0037ad663194 (diff) | |
st_trace: use ftcat -p to await initialization
| -rwxr-xr-x | st_trace | 16 |
1 files changed, 15 insertions, 1 deletions
| @@ -68,17 +68,31 @@ NUM_CPUS=`egrep -c '^processor|online' /proc/cpuinfo` | |||
| 68 | # 510 - sched_trace_sys_release | 68 | # 510 - sched_trace_sys_release |
| 69 | ST_IDS="501 502 503 504 505 506 507 508 509 510" | 69 | ST_IDS="501 502 503 504 505 506 507 508 509 510" |
| 70 | 70 | ||
| 71 | DIR=`mktemp -d` || die "mktemp failed" | ||
| 72 | |||
| 71 | TAG=$1 | 73 | TAG=$1 |
| 72 | PIDS="" | 74 | PIDS="" |
| 75 | COUNT=0 | ||
| 73 | for x in `seq 0 $(($NUM_CPUS - 1))` | 76 | for x in `seq 0 $(($NUM_CPUS - 1))` |
| 74 | do | 77 | do |
| 75 | TARGET="st-${TAG}-${x}.bin" | 78 | TARGET="st-${TAG}-${x}.bin" |
| 76 | echo -n "CPU $x: " | 79 | echo -n "CPU $x: " |
| 77 | $FTCAT "$FTDEV$x" $ST_IDS > "$TARGET" & | 80 | $FTCAT -p "$DIR/cpu${x}.pid" "$FTDEV$x" $ST_IDS > "$TARGET" & |
| 78 | PIDS="$PIDS $!" | 81 | PIDS="$PIDS $!" |
| 79 | echo $! "> $TARGET [$?]" | 82 | echo $! "> $TARGET [$?]" |
| 83 | COUNT=$((COUNT + 1)) | ||
| 80 | done | 84 | done |
| 81 | 85 | ||
| 86 | READY=`ls $DIR/*.pid | wc -l` | ||
| 87 | while [[ $READY != $COUNT ]] | ||
| 88 | do | ||
| 89 | sleep 0.5 | ||
| 90 | READY=`ls $DIR/*.pid | wc -l` | ||
| 91 | done | ||
| 92 | |||
| 93 | rm $DIR/*.pid | ||
| 94 | rmdir $DIR | ||
| 95 | |||
| 82 | if [[ $AUTO != 1 ]] | 96 | if [[ $AUTO != 1 ]] |
| 83 | then | 97 | then |
| 84 | echo "Press Enter to end tracing..." | 98 | echo "Press Enter to end tracing..." |
