]> code.ossystems Code Review - openembedded-core.git/commitdiff
bb-matrix: Fix min and max calculations
authorDarren Hart <dvhart@linux.intel.com>
Fri, 18 Jan 2013 23:13:52 +0000 (23:13 +0000)
committerRichard Purdie <richard.purdie@linuxfoundation.org>
Mon, 21 Jan 2013 10:20:21 +0000 (10:20 +0000)
The BB and PM ranges were originally intended to use leading 0s to
ensure all the values were the same string length, making for nice log
filenames and columnar dat files. However, not everyone will do this -
especially if it isn't documented.

Document the intent. Make the generation and parsing of dat files robust
to either method.

Signed-off-by: Darren Hart <dvhart@linux.intel.com>
Signed-off-by: Saul Wold <sgw@linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
scripts/contrib/bb-perf/bb-matrix-plot.sh
scripts/contrib/bb-perf/bb-matrix.sh

index 62aa66d96db634caa0575e50501442e9aa669f24..87e8cb1abd3d3c092d3025a5a16916b474559a2f 100755 (executable)
@@ -101,12 +101,12 @@ if [ -z "$TITLE" ]; then
 fi
 
 # Determine the dgrid3d mesh dimensions size
-MIN=$(tail -n +2 "$DATFILE" | cut -d ' ' -f 1 | sort | uniq | head -n1)
-MAX=$(tail -n +2 "$DATFILE" | cut -d ' ' -f 1 | sort | uniq | tail -n1)
-BB_CNT=$[${MAX#*0} - $MIN + 1]
-MIN=$(tail -n +2 "$DATFILE" | cut -d ' ' -f 2 | sort | uniq | head -n1)
-MAX=$(tail -n +2 "$DATFILE" | cut -d ' ' -f 2 | sort | uniq | tail -n1)
-PM_CNT=$[${MAX#*0} - $MIN + 1]
+MIN=$(tail -n +2 "$DATFILE" | cut -d ' ' -f 1 | sed 's/^0*//' | sort -n | uniq | head -n1)
+MAX=$(tail -n +2 "$DATFILE" | cut -d ' ' -f 1 | sed 's/^0*//' | sort -n | uniq | tail -n1)
+BB_CNT=$[${MAX} - $MIN + 1]
+MIN=$(tail -n +2 "$DATFILE" | cut -d ' ' -f 2 | sed 's/^0*//' | sort -n | uniq | head -n1)
+MAX=$(tail -n +2 "$DATFILE" | cut -d ' ' -f 2 | sed 's/^0*//' | sort -n | uniq | tail -n1)
+PM_CNT=$[${MAX} - $MIN + 1]
 
 
 (cat <<EOF
index b9edd5ff086e23d30046f44326154ff67550a00e..37721fe268b34a1599b6fecfc39f9e54b894dd39 100755 (executable)
@@ -33,6 +33,8 @@
 #
 
 # The following ranges are appropriate for a 4 core system with 8 logical units
+# Use leading 0s to ensure all digits are the same string length, this results
+# in nice log file names and columnar dat files.
 BB_RANGE="04 05 06 07 08 09 10 11 12 13 14 15 16"
 PM_RANGE="04 05 06 07 08 09 10 11 12 13 14 15 16"
 
@@ -62,10 +64,11 @@ for BB in $BB_RANGE; do
                echo "BB=$BB PM=$PM Logging to $BB_LOG"
 
                # Export the variables under test and run the bitbake command
+               # Strip any leading zeroes before passing to bitbake
                export BB_NUMBER_THREADS=$(echo $BB | sed 's/^0*//')
                export PARALLEL_MAKE="-j $(echo $PM | sed 's/^0*//')"
                /usr/bin/time -f "$BB $PM $TIME_STR" -a -o $RUNTIME_LOG $BB_CMD &> $BB_LOG
-               
+
                echo "  $(tail -n1 $RUNTIME_LOG)"
                echo -n "  Cleaning up..."
                mv tmp/buildstats $RUNDIR/$BB-$PM-buildstats