summaryrefslogtreecommitdiffstats
path: root/src/build
diff options
context:
space:
mode:
authorDan Larson <dlarson@us.ibm.com>2019-06-11 08:49:29 -0500
committerDaniel M. Crowell <dcrowell@us.ibm.com>2019-06-27 12:50:22 -0500
commita4c72a5f2da81540b4d8309bac3413548aadd6e0 (patch)
tree841c69aa3ab8f9f541a510ec1c1134e869af76da /src/build
parentd978f97d33f0e16c7fd8938da7eba6e69fa4f99a (diff)
downloadtalos-hostboot-a4c72a5f2da81540b4d8309bac3413548aadd6e0.tar.gz
talos-hostboot-a4c72a5f2da81540b4d8309bac3413548aadd6e0.zip
HBCI-177: Enable Code Coverage in CI
To enable code coverage set in the environment export HOSTBOOT_PROFILE=1 Report is generated under obj/gcov_report Change-Id: I9548c742f5d3bb83aab6d6e4ffd857cccb48b5f1 Reviewed-on: http://rchgit01.rchland.ibm.com/gerrit1/78736 Reviewed-by: Camvan T. Nguyen <ctnguyen@us.ibm.com> Tested-by: Jenkins Server <pfd-jenkins+hostboot@us.ibm.com> Tested-by: FSP CI Jenkins <fsp-CI-jenkins+hostboot@us.ibm.com> Tested-by: Jenkins OP Build CI <op-jenkins+hostboot@us.ibm.com> Tested-by: Jenkins OP HW <op-hw-jenkins+hostboot@us.ibm.com> Reviewed-by: Zachary Clark <zach@ibm.com> Reviewed-by: Daniel M. Crowell <dcrowell@us.ibm.com>
Diffstat (limited to 'src/build')
-rwxr-xr-xsrc/build/citest/autocitest51
-rwxr-xr-xsrc/build/citest/build-script37
2 files changed, 67 insertions, 21 deletions
diff --git a/src/build/citest/autocitest b/src/build/citest/autocitest
index 0cb8d078f..e2b8126d6 100755
--- a/src/build/citest/autocitest
+++ b/src/build/citest/autocitest
@@ -333,10 +333,11 @@ while [ $(($modsstarted)) -lt 1 -o $(($modsstarted)) -ne $(($modscompleted)) ];
sleep 20
((loopcount++)) # increment loopcount
echo "loopcount = $loopcount"
-
+ date +'%H:%M:%S'
echo "modscompleted log command"
- echo "autosim $NOWIN --simcmd \"print ((system_cmp0.phys_mem).read 0x$mods_completed_addr 0x08)\" 1> $SBXHOME/modscompleted.log 2> /dev/null"
- autosim $NOWIN --simcmd "print ((system_cmp0.phys_mem).read 0x$mods_completed_addr 0x08)" 1> $SBXHOME/modscompleted.log 2> /dev/null
+ echo "autosim $NOWIN --simcmd \"print ((system_cmp0.phys_mem).read 0x$mods_completed_addr 0x08)\" 1> $SBXHOME/modscompleted.log 2> /dev/null"
+ autosim $NOWIN --simcmd "print ((system_cmp0.phys_mem).read 0x$mods_completed_addr 0x08)" 1> $SBXHOME/modscompleted.log 2> /dev/null
+ date +'%H:%M:%S'
echo
echo "modscompleted command"
@@ -344,9 +345,11 @@ while [ $(($modsstarted)) -lt 1 -o $(($modsstarted)) -ne $(($modscompleted)) ];
modscompleted=`cat $SBXHOME/modscompleted.log | awk '/0x/ {print strtonum($1)}'`
echo
+ date +'%H:%M:%S'
echo "modsstarted log command"
- echo "autosim $NOWIN --simcmd \"print ((system_cmp0.phys_mem).read 0x$mods_started_addr 0x08)\" 1> $SBXHOME/modsstarted.log 2> /dev/null"
- autosim $NOWIN --simcmd "print ((system_cmp0.phys_mem).read 0x$mods_started_addr 0x08)" 1> $SBXHOME/modsstarted.log 2> /dev/null
+ echo "autosim $NOWIN --simcmd \"print ((system_cmp0.phys_mem).read 0x$mods_started_addr 0x08)\" 1> $SBXHOME/modsstarted.log 2> /dev/null"
+ autosim $NOWIN --simcmd "print ((system_cmp0.phys_mem).read 0x$mods_started_addr 0x08)" 1> $SBXHOME/modsstarted.log 2> /dev/null
+ date +'%H:%M:%S'
echo
echo "modsstarted command"
@@ -356,18 +359,29 @@ while [ $(($modsstarted)) -lt 1 -o $(($modsstarted)) -ne $(($modscompleted)) ];
echo "ModulesStarted:ModulesCompleted => $modsstarted:$modscompleted"
- # @TODO RTC:149210 temporary fix for autosim hangs on real code errors. For some reason
- # when we hit an actual bug and simics halts, the autosim commands hang
- # causing this loop to take >8 hours.
- if [ -z $modsstarted ] && [ -z $modscompleted ]; then
- echo "ERROR: autosim hanging on real code errors, temporarily catching early"
- echo "See archived hbTracMerg for more info"
- exit 1
+ # For code coverage, sometimes simics takes a while to respond as it dumps data.
+ # Allow it to continue if this condition is seen.
+ if [[ -z "${HOSTBOOT_PROFILE}" ]]; then
+ # @TODO RTC:149210 temporary fix for autosim hangs on real code errors. For some reason
+ # when we hit an actual bug and simics halts, the autosim commands hang
+ # causing this loop to take >8 hours.
+ if [ -z $modsstarted ] && [ -z $modscompleted ]; then
+ echo "ERROR: autosim hanging on real code errors, temporarily catching early"
+ echo "See archived hbTracMerg for more info"
+ exit 1
+ fi
fi
- if [ "$loopcount" -ge 150 ]; then
+ if [[ -z "${HOSTBOOT_PROFILE}" ]]; then
+ loop_timeout=150
+ else
+ # Increase timeout for code coverage
+ loop_timeout=500
+ fi
+
+ if [ "$loopcount" -ge "$loop_timeout" ]; then
timestamp=`date +'%H:%M:%S'`
- echo "$timestamp ERROR: timed out after 50 minutes waiting for until test completion"
+ echo "$timestamp ERROR: timed out waiting for until test completion"
autosim $NOWIN --simcmd "hb-Ps with-backtrace"
timeout=$(($modsstarted - $modscompleted))
break
@@ -467,6 +481,15 @@ if [ $? -ne 0 ] ; then
echo "ERROR: Unable to run $?"
fi
+if [[ ! -z "${HOSTBOOT_PROFILE}" ]]; then
+ # After simics test are complete, dump data.
+ echo "====> hb-Gcov..."
+ autosim $NOWIN --simcmd "hb-Gcov" --timeout 300
+ if [ $? -ne 0 ] ; then
+ echo "ERROR: Unable to run $?"
+ fi
+fi
+
########################################################
## done. Stop the simulation
########################################################
diff --git a/src/build/citest/build-script b/src/build/citest/build-script
index 7510d76c9..0327293c8 100755
--- a/src/build/citest/build-script
+++ b/src/build/citest/build-script
@@ -59,13 +59,24 @@ CREATESANDBOX_PID=$!
my_date=$(date)
# Build Hostboot.
-echo "#--------------------------------"
-printf "\n\n$(date): STARTED running \"make -j32\"\n\n"
-echo "#--------------------------------"
-make -j32 || exit -1
-echo "#--------------------------------"
-printf "\n\nrc=$?: $(date): FINISHED running (\"make -j32\" was started at $my_date)\n\n"
-echo "#--------------------------------"
+if [[ -z "${HOSTBOOT_PROFILE}" ]]; then
+ echo "#--------------------------------"
+ printf "\n\n$(date): STARTED running \"make -j32\"\n\n"
+ echo "#--------------------------------"
+ make -j32 || exit -1
+ echo "#--------------------------------"
+ printf "\n\nrc=$?: $(date): FINISHED running (\"make -j32\" was started at $my_date)\n\n"
+ echo "#--------------------------------"
+else
+ # Build with code coverage when HOSTBOOT_PROFILE=1
+ echo "#--------------------------------"
+ printf "\n\n$(date): STARTED running \"make -j32 gcov\"\n\n"
+ echo "#--------------------------------"
+ make -j32 gcov || exit -1
+ echo "#--------------------------------"
+ printf "\n\nrc=$?: $(date): FINISHED running (\"make -j32 gcov\" was started at $my_date)\n\n"
+ echo "#--------------------------------"
+fi
# Check sandbox create completion.
wait $CREATESANDBOX_PID
@@ -124,3 +135,15 @@ else
fi
+if [[ ! -z "${HOSTBOOT_PROFILE}" ]]; then
+ # Generate the code coverage report. Located obj/gcov_report
+ # Jenkins will artifact and can display html report
+ my_date=$(date)
+ echo "#--------------------------------"
+ printf "\n\n$(date): STARTED running \"make lcov\"\n\n"
+ echo "#--------------------------------"
+ make lcov || exit -1
+ echo "#--------------------------------"
+ printf "\n\nrc=$?: $(date): FINISHED running (\"make lcov\" was started at $my_date)\n\n"
+ echo "#--------------------------------"
+fi \ No newline at end of file
OpenPOWER on IntegriCloud