From 90dc44c8246f2a580fe4a41ce28c201e52307500 Mon Sep 17 00:00:00 2001 From: Darren Hart Date: Fri, 18 Jan 2013 23:13:52 +0000 Subject: bb-matrix: Fix min and max calculations 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 Signed-off-by: Saul Wold Signed-off-by: Richard Purdie --- scripts/contrib/bb-perf/bb-matrix-plot.sh | 12 ++++++------ scripts/contrib/bb-perf/bb-matrix.sh | 5 ++++- 2 files changed, 10 insertions(+), 7 deletions(-) (limited to 'scripts/contrib/bb-perf') diff --git a/scripts/contrib/bb-perf/bb-matrix-plot.sh b/scripts/contrib/bb-perf/bb-matrix-plot.sh index 62aa66d96d..87e8cb1abd 100755 --- a/scripts/contrib/bb-perf/bb-matrix-plot.sh +++ b/scripts/contrib/bb-perf/bb-matrix-plot.sh @@ -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 < $BB_LOG - + echo " $(tail -n1 $RUNTIME_LOG)" echo -n " Cleaning up..." mv tmp/buildstats $RUNDIR/$BB-$PM-buildstats -- cgit 1.2.3-korg