Fix indentation in buildstats.sh and buildstats-plot.sh
to convert every line to 4 spaces indentation.

Signed-off-by: Luis Martins <luis.mart...@criticaltechworks.com>
---
 scripts/contrib/bb-perf/buildstats-plot.sh |  56 ++++-----
 scripts/contrib/bb-perf/buildstats.sh      | 131 +++++++++++----------
 2 files changed, 94 insertions(+), 93 deletions(-)

diff --git a/scripts/contrib/bb-perf/buildstats-plot.sh 
b/scripts/contrib/bb-perf/buildstats-plot.sh
index 320c4910a1..80fd30960c 100755
--- a/scripts/contrib/bb-perf/buildstats-plot.sh
+++ b/scripts/contrib/bb-perf/buildstats-plot.sh
@@ -72,40 +72,40 @@ EOM
 
 # Parse and validate arguments
 while getopts "b:n:r:t:s:o:aSh" OPT; do
-       case $OPT in
-       b)
-               BS_DIR="$OPTARG"
-               ;;
-       n)
-               N="$OPTARG"
-               ;;
+    case $OPT in
+    b)
+        BS_DIR="$OPTARG"
+        ;;
+    n)
+        N="$OPTARG"
+        ;;
     r)
         RECIPE="-r $OPTARG"
         ;;
     t)
         TASKS="$OPTARG"
         ;;
-       s)
-               STATS="$OPTARG"
-               ;;
-       a)
+    s)
+        STATS="$OPTARG"
+        ;;
+    a)
         ACCUMULATE="-a"
         ;;
-       S)
-               SUM="y"
-               ;;
-       o)
-               OUTDATA_FILE="$OPTARG"
-               ;;
-       h)
-               usage
-               exit 0
-               ;;
-       *)
-               usage
-               exit 1
-               ;;
-       esac
+    S)
+        SUM="y"
+        ;;
+    o)
+        OUTDATA_FILE="$OPTARG"
+        ;;
+    h)
+        usage
+        exit 0
+        ;;
+    *)
+        usage
+        exit 1
+        ;;
+    esac
 done
 
 # Get number of stats
@@ -141,8 +141,8 @@ else
     declare -a sumargs
     j=0
     for i in `seq $nstats`; do
-       sumargs[j]=sum; j=$(( $j + 1 ))
-       sumargs[j]=`expr 3 + $i - 1`;  j=$(( $j + 1 ))
+        sumargs[j]=sum; j=$(( $j + 1 ))
+        sumargs[j]=`expr 3 + $i - 1`;  j=$(( $j + 1 ))
     done
 
     # Do the processing with datamash
diff --git a/scripts/contrib/bb-perf/buildstats.sh 
b/scripts/contrib/bb-perf/buildstats.sh
index 2f017efeb8..e45cfc146d 100755
--- a/scripts/contrib/bb-perf/buildstats.sh
+++ b/scripts/contrib/bb-perf/buildstats.sh
@@ -66,62 +66,63 @@ EOM
 
 # Parse and validate arguments
 while getopts "b:r:t:s:aHh" OPT; do
-       case $OPT in
-       b)
-               BS_DIR="$OPTARG"
-               ;;
-       r)
-               RECIPE="$OPTARG"
-               ;;
-       t)
-               TASKS="$OPTARG"
-               ;;
-       s)
-               STATS="$OPTARG"
-               ;;
-       a)
+    case $OPT in
+    b)
+        BS_DIR="$OPTARG"
+        ;;
+    r)
+        RECIPE="$OPTARG"
+        ;;
+    t)
+        TASKS="$OPTARG"
+        ;;
+    s)
+        STATS="$OPTARG"
+        ;;
+    a)
         ACCUMULATE="y"
         ;;
-       H)
-               HEADER="y"
-               ;;
-       h)
-               usage
-               exit 0
-               ;;
-       *)
-               usage
-               exit 1
-               ;;
-       esac
+    H)
+        HEADER="y"
+        ;;
+    h)
+        usage
+        exit 0
+        ;;
+    *)
+        usage
+        exit 1
+        ;;
+    esac
 done
 
 # Ensure the buildstats folder exists
 if [ ! -d "$BS_DIR" ]; then
-       echo "ERROR: $BS_DIR does not exist"
-       usage
-       exit 1
+    echo "ERROR: $BS_DIR does not exist"
+    usage
+    exit 1
 fi
 
 stats=""
 IFS=":"
 for stat in ${STATS}; do
-       case $stat in
-           TIME)
-               stats="${stats}:${TIME}"
-               ;;
-           IO)
-               stats="${stats}:${IO}"
-               ;;
-           RUSAGE)
-               stats="${stats}:${RUSAGE}"
-               ;;
-           CHILD_RUSAGE)
-               stats="${stats}:${CHILD_RUSAGE}"
-               ;;
-           *)
-               stats="${STATS}"
-       esac
+    case $stat in
+        TIME)
+            stats="${stats}:${TIME}"
+            ;;
+        IO)
+            stats="${stats}:${IO}"
+            ;;
+        RUSAGE)
+            stats="${stats}:${RUSAGE}"
+            ;;
+        CHILD_RUSAGE)
+            stats="${stats}:${CHILD_RUSAGE}"
+            ;;
+        *)
+            stats="${STATS}"
+            ;;
+    esac
 done
 
 # remove possible colon at the beginning
@@ -140,27 +141,27 @@ for task in ${TASKS}; do
     task="do_${task}"
     for file in $(find ${BS_DIR} -type f -path *${RECIPE}*/${task} | awk 
'BEGIN{ ORS=""; OFS=":" } { print $0,"" }'); do
         recipe="$(basename $(dirname $file))"
-       times=""
-       for stat in ${stats}; do
-           [ -z "$stat" ] && { echo "empty stats"; }
-           time=$(sed -n -e "s/^\($stat\): \\(.*\\)/\\2/p" $file)
-           # in case the stat is not present, set the value as NA
-           [ -z "$time" ] && { time="NA"; }
-           # Append it to times
-           if [ -z "$times" ]; then
-               times="${time}"
-           else
-               times="${times} ${time}"
-           fi
-       done
-    if [ -n "$ACCUMULATE" ]; then
-        IFS=' '; valuesarray=(${times}); IFS=':'
-        times=0
-        for value in "${valuesarray[@]}"; do
-            [ "$value" == "NA" ] && { echo "ERROR: stat is not present."; 
usage; exit 1; }
-            times=$(( $times + $value ))
+        times=""
+        for stat in ${stats}; do
+            [ -z "$stat" ] && { echo "empty stats"; }
+            time=$(sed -n -e "s/^\($stat\): \\(.*\\)/\\2/p" $file)
+            # in case the stat is not present, set the value as NA
+            [ -z "$time" ] && { time="NA"; }
+            # Append it to times
+            if [ -z "$times" ]; then
+                times="${time}"
+            else
+                times="${times} ${time}"
+            fi
         done
-    fi
+        if [ -n "$ACCUMULATE" ]; then
+            IFS=' '; valuesarray=(${times}); IFS=':'
+            times=0
+            for value in "${valuesarray[@]}"; do
+                [ "$value" == "NA" ] && { echo "ERROR: stat is not present."; 
usage; exit 1; }
+                times=$(( $times + $value ))
+            done
+        fi
         echo "${task} ${recipe} ${times}"
     done
 done
-- 
2.25.2

-=-=-=-=-=-=-=-=-=-=-=-
Links: You receive all messages sent to this group.

View/Reply Online (#136654): 
https://lists.openembedded.org/g/openembedded-core/message/136654
Mute This Topic: https://lists.openembedded.org/mt/72518494/21656
Group Owner: openembedded-core+ow...@lists.openembedded.org
Unsubscribe: https://lists.openembedded.org/g/openembedded-core/unsub  
[arch...@mail-archive.com]
-=-=-=-=-=-=-=-=-=-=-=-

Reply via email to