|
@@ -16,10 +16,21 @@
|
|
|
# See the GNU Lesser General Public License in COPYING.LGPL for more details.
|
|
|
#
|
|
|
|
|
|
+# TODO display help if -h is passed
|
|
|
+
|
|
|
# The input file must be generated by the fxt_tool command
|
|
|
-inputfile=$1
|
|
|
+inputfile_with_counters=$1
|
|
|
|
|
|
-# TODO display help if -h is passed
|
|
|
+# We extract the counters out of the input file
|
|
|
+inputfile=.$inputfile_with_counters.activity
|
|
|
+inputfile_cnt_ready=.$1.cnt_ready
|
|
|
+inputfile_cnt_submitted=.$1.cnt_submitted
|
|
|
+
|
|
|
+grep -v "^cnt" $inputfile_with_counters > $inputfile
|
|
|
+grep "^cnt_ready" $inputfile_with_counters > $inputfile_cnt_ready
|
|
|
+grep "^cnt_submitted" $inputfile_with_counters > $inputfile_cnt_submitted
|
|
|
+
|
|
|
+max_cnt_submitted=`cut -f2 $inputfile_cnt_submitted |sort -n|tail -1`
|
|
|
|
|
|
# Count the number of workers in the trace
|
|
|
workers=`cut -f1 $inputfile | sort -n | uniq`
|
|
@@ -27,7 +38,7 @@ nworkers=`cut -f1 $inputfile | sort -n | uniq|wc -l`
|
|
|
|
|
|
# size of the entire graph
|
|
|
width=2.5
|
|
|
-heigth=$(echo "0.5 * $nworkers"|bc -l)
|
|
|
+heigth=$(echo "0.5 + (0.5 * $nworkers)"|bc -l)
|
|
|
|
|
|
# In case 3 arguments are provided, the 2nd (resp. 3rd) indicates the start
|
|
|
# (resp. the end) of the interval to be displayed.
|
|
@@ -46,6 +57,13 @@ set output "activity.eps"
|
|
|
set xrange [$starttime:$endtime]
|
|
|
set size $width,$heigth
|
|
|
set multiplot;
|
|
|
+
|
|
|
+set origin 0.0,0.0;
|
|
|
+set size $width,0.5;
|
|
|
+
|
|
|
+plot "$inputfile_cnt_submitted" using 2:3 with filledcurves lt rgb "#999999" title "submitted",\
|
|
|
+ "$inputfile_cnt_ready" using 2:3 with filledcurves lt rgb "#000000" title "ready"
|
|
|
+
|
|
|
EOF
|
|
|
|
|
|
cnt=0
|
|
@@ -53,7 +71,7 @@ for worker in $workers
|
|
|
do
|
|
|
grep "^$worker" $inputfile > .tmp.$worker
|
|
|
|
|
|
- starty=$(echo "0.5 * $cnt"|bc -l)
|
|
|
+ starty=$(echo "0.5 + (0.5 * $cnt)"|bc -l)
|
|
|
|
|
|
cat >> gnuplotcmd << EOF
|
|
|
|
|
@@ -76,3 +94,13 @@ unset multiplot
|
|
|
EOF
|
|
|
|
|
|
gnuplot < gnuplotcmd
|
|
|
+
|
|
|
+rm gnuplotcmd
|
|
|
+rm $inputfile
|
|
|
+rm $inputfile_cnt_ready
|
|
|
+rm $inputfile_cnt_submitted
|
|
|
+
|
|
|
+for worker in $workers
|
|
|
+do
|
|
|
+ rm .tmp.$worker
|
|
|
+done
|