aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rwxr-xr-xst_trace16
1 files changed, 15 insertions, 1 deletions
diff --git a/st_trace b/st_trace
index 64bc3dd..9a5c66b 100755
--- a/st_trace
+++ b/st_trace
@@ -68,17 +68,31 @@ NUM_CPUS=`egrep -c '^processor|online' /proc/cpuinfo`
68# 510 - sched_trace_sys_release 68# 510 - sched_trace_sys_release
69ST_IDS="501 502 503 504 505 506 507 508 509 510" 69ST_IDS="501 502 503 504 505 506 507 508 509 510"
70 70
71DIR=`mktemp -d` || die "mktemp failed"
72
71TAG=$1 73TAG=$1
72PIDS="" 74PIDS=""
75COUNT=0
73for x in `seq 0 $(($NUM_CPUS - 1))` 76for x in `seq 0 $(($NUM_CPUS - 1))`
74do 77do
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))
80done 84done
81 85
86READY=`ls $DIR/*.pid | wc -l`
87while [[ $READY != $COUNT ]]
88do
89 sleep 0.5
90 READY=`ls $DIR/*.pid | wc -l`
91done
92
93rm $DIR/*.pid
94rmdir $DIR
95
82if [[ $AUTO != 1 ]] 96if [[ $AUTO != 1 ]]
83then 97then
84 echo "Press Enter to end tracing..." 98 echo "Press Enter to end tracing..."