[PATCH yocto-autobuilder-helper 2/4] collect-results: collect all host_stats files


sakib.sajal@...
 

data collection on failure is enabled by default.
Collect all host stats files created.

Signed-off-by: Sakib Sajal <sakib.sajal@...>
---
scripts/collect-results | 16 +++++++++++-----
1 file changed, 11 insertions(+), 5 deletions(-)

diff --git a/scripts/collect-results b/scripts/collect-results
index 7178380..93834d6 100755
--- a/scripts/collect-results
+++ b/scripts/collect-results
@@ -18,21 +18,27 @@ if [ -e $WORKDIR/buildhistory ]; then
fi
fi

-HSFILE=$WORKDIR/tmp/buildstats/*/host_stats
+HSFILE=$WORKDIR/tmp/buildstats/*/host_stats*
d="intermittent_failure_host_data"

mkdir -p $DEST/$target/$d

-step=0
+step_i=1
+step_f=1
for f in $HSFILE; do
if [ -e $f ]; then
cp $f $DEST/$target/$d
+ if [[ "$f" == *"failure"* ]] ; then
+ mv $DEST/$target/$d/`basename $f` $DEST/$target/$d/`basename $f`_${step_f}.txt
+ step_f=$((step_f+1))
+ continue
+ fi
grep -m 1 "^top -" $f
if [ $? -eq 0 ]; then
- mv $DEST/$target/$d/`basename $f` $DEST/$target/$d/`basename $f`_${step}_top.txt
+ mv $DEST/$target/$d/`basename $f` $DEST/$target/$d/`basename $f`_${step_i}_top.txt
else
- mv $DEST/$target/$d/`basename $f` $DEST/$target/$d/`basename $f`_${step}.txt
+ mv $DEST/$target/$d/`basename $f` $DEST/$target/$d/`basename $f`_${step_i}.txt
fi
- step=$((step+1))
+ step_i=$((step_i+1))
fi
done
--
2.25.1