summaryrefslogtreecommitdiff
path: root/rtems-coverage
diff options
context:
space:
mode:
authorJoel Sherrill <joel.sherrill@OARcorp.com>2010-10-14 14:27:49 +0000
committerJoel Sherrill <joel.sherrill@OARcorp.com>2010-10-14 14:27:49 +0000
commit36c53fb7abc2d9d9f773cd7309d4afd926b86676 (patch)
tree6f9f2b7520a5fa51f5e2ba1daea1a98581c26b82 /rtems-coverage
parent285f70a45517c48a278b4bbdb0ae52c80efcf2e1 (diff)
2010-10-14 Joel Sherrill <joel.sherrilL@OARcorp.com>
* generate_coverage_html: Add progress tracking time/series plots.
Diffstat (limited to 'rtems-coverage')
-rw-r--r--rtems-coverage/ChangeLog4
-rwxr-xr-xrtems-coverage/generate_coverage_html224
2 files changed, 217 insertions, 11 deletions
diff --git a/rtems-coverage/ChangeLog b/rtems-coverage/ChangeLog
index e163ad1..e290571 100644
--- a/rtems-coverage/ChangeLog
+++ b/rtems-coverage/ChangeLog
@@ -1,3 +1,7 @@
+2010-10-14 Joel Sherrill <joel.sherrilL@OARcorp.com>
+
+ * generate_coverage_html: Add progress tracking time/series plots.
+
2010-08-26 Joel Sherrill <joel.sherrill@oarcorp.com>
* Explanations.txt: Remove cases which are now RTEMS_DEBUG.
diff --git a/rtems-coverage/generate_coverage_html b/rtems-coverage/generate_coverage_html
index 2098330..9317c19 100755
--- a/rtems-coverage/generate_coverage_html
+++ b/rtems-coverage/generate_coverage_html
@@ -160,7 +160,7 @@ print_heading()
echo "<th>"${*}"</th>"
}
-doit()
+do_perBSPPage()
{
BSP=${1}
cpu=`grep "^Target" ${bsp}-*/configuration.txt | \
@@ -169,16 +169,55 @@ doit()
print_doc_top ${cpu}/${BSP}
cat <<EOF
+<table align="center">
+<thead>
+<tr class="heading-title">
+<td width="40%">Result Tables</td>
+<td width="40%">Time Series Graphs</td>
+</thead>
+</tr>
+<td>
<ul>
-<li><a href="#O2pd">Results for -O2, POSIX Disabled, Core Only</a></li>
-<li><a href="#O2pD">Results for -O2, POSIX Disabled, Developmental</a></li>
-<li><a href="#O2Pd">Results for -O2, POSIX Enabled, Core Only</a></li>
-<li><a href="#O2PD">Results for -O2, POSIX Enabled, Developmental</a></li>
-<li><a href="#Ospd">Results for -Os, POSIX Disabled, Core Only</a></li>
-<li><a href="#OspD">Results for -Os, POSIX Disabled, Developmental</a></li>
-<li><a href="#OsPd">Results for -Os, POSIX Enabled, Core Only</a></li>
-<li><a href="#OsPD">Results for -Os, POSIX Enabled, Developmental</a></li>
+<li><a href="#O2pd">-O2, POSIX Disabled, Core Only</a></li>
+<li><a href="#O2pD">-O2, POSIX Disabled, Developmental</a></li>
+<li><a href="#O2Pd">-O2, POSIX Enabled, Core Only</a></li>
+<li><a href="#O2PD">-O2, POSIX Enabled, Developmental</a></li>
+<li><a href="#Ospd">-Os, POSIX Disabled, Core Only</a></li>
+<li><a href="#OspD">-Os, POSIX Disabled, Developmental</a></li>
+<li><a href="#OsPd">-Os, POSIX Enabled, Core Only</a></li>
+<li><a href="#OsPD">-Os, POSIX Enabled, Developmental</a></li>
</ul>
+</td>
+<td>
+<ul>
+EOF
+
+echo "<li><a href=\"graphs/${BSP}-uncovered_percent-d.png\">"
+echo " Uncovered Percentage (Core)</a></li>"
+echo "<li><a href=\"graphs/${BSP}-uncovered_percent-D.png\">"
+echo " Uncovered Percentage (Developmental)</a></li>"
+echo "<li><a href=\"graphs/${BSP}-uncovered_bytes-d.png\">"
+echo " Uncovered Bytes (Core)</a></li>"
+
+echo "<li><a href=\"graphs/${BSP}-total_bytes-D.png\">"
+echo " Total Bytes Analyzed (Developmental)</a></li>"
+echo "<li><a href=\"graphs/${BSP}-total_bytes-d.png\">"
+echo " Total Bytes Analyzed (Core)</a></li>"
+echo "<li><a href=\"graphs/${BSP}-total_bytes-D.png\">"
+echo " Total Bytes Analyzed (Developmental)</a></li>"
+
+echo "<li><a href=\"graphs/${BSP}-uncovered_bytes-D.png\">"
+echo " Uncovered Bytes (Developmental)</a></li>"
+echo "<li><a href=\"graphs/${BSP}-uncovered_bytes-d.png\">"
+echo " Uncovered Bytes (Core)</a></li>"
+echo "<li><a href=\"graphs/${BSP}-uncovered_bytes-D.png\">"
+echo " Uncovered Bytes (Developmental)</a></li>"
+
+cat <<EOF
+</ul>
+</td>
+</tr>
+</table>
</br>
EOF
@@ -254,7 +293,8 @@ cp ${COVBASE}/style.css rtems/style.css
genBSPList()
{
- find * -maxdepth 1 -type d | cut -d'-' -f1 | uniq | grep -v rtems | \
+ find * -maxdepth 1 -type d | cut -d'-' -f1 | uniq | \
+ sed -e '/rtems/d' -e '/plot_data/d' -e '/graphs/d' | \
while read bsp
do
cpu=`grep ^Target ${bsp}-*/configuration.txt | tail -1 | \
@@ -282,6 +322,132 @@ cleanup()
done
}
+# round up
+round_up()
+{
+ num=$1
+ round=$2
+ echo ${num} ${num} ${round} + ${round} % - ${round} + p | dc
+}
+
+# round down
+round_down()
+{
+ num=$1
+ round=$2
+ echo ${num} ${num} ${round} - ${round} % - ${round} - p| dc
+}
+
+# Generate the GNU Plot script
+gen_plot()
+{
+ # Now merge the data
+ datfiles=`ls -1 ${OUT}/${bsp}-*${DEV}-${FIELD}.dat`
+ first=`cat ${datfiles} | sort -t' ' -k1.3 -n | head -n 1 | cut -d' ' -f1`
+ last=`cat ${datfiles} | sort -t' ' -k1.3 -n | tail -n 1 | cut -d' ' -f1`
+
+ min=`cat ${datfiles} | sort -k2 -n | head -n 1 | cut -d' ' -f2`
+ max=`cat ${datfiles} | sort -k2 -n | tail -n 1 | cut -d' ' -f2`
+ round=
+ case ${FIELD} in
+ covered_percent)
+ max=100.0
+ YLABEL=Covered
+ ;;
+ uncovered_percent)
+ min=0
+ YLABEL=Uncovered
+ ;;
+ uncovered_bytes)
+ round=1000
+ min=`round_down ${min} 1000 0`
+ max=`round_up ${max} 1000 1000000`
+ YLABEL=Uncovered
+ ;;
+ total_bytes)
+ round=5000
+ min=`round_down ${min} 5000 0`
+ max=`round_up ${max} 5000 1000000`
+ YLABEL=Total
+ ;;
+ *)
+ echo "ERROR unknown FIELD ${FIELD}"
+ exit 1
+ ;;
+ esac
+ # No negative numbers. :=D
+ if [ ${min} -lt 0 ] ; then
+ min=0
+ fi
+ if [ "X${round}" != "X" ] ; then # definitely integer
+ if [ ${min} -eq ${max} ] ; then
+ max=`expr ${min} + ${round}`
+ fi
+ fi
+
+ # Is this graph using data for developmental or core configurations?
+ if [ ${DEV} = "D" ] ; then
+ TITLE="${PATTERN} (Developmental)"
+ else
+ TITLE="${PATTERN} (Core)"
+ fi
+
+ Year=`echo ${first} | cut -c1-4`
+ Month=`echo ${first} | cut -c6-7`
+ Day=`echo ${first} | cut -c9-10`
+ Hour=`echo ${first} | cut -c12-13`
+ Minute=`echo ${first} | cut -c15-16`
+ start="${Year}-${Month}-${Day}/${Hour}:${Minute}"
+
+ Year=`echo ${last} | cut -c1-4`
+ Month=`echo ${last} | cut -c6-7`
+ Day=`echo ${last} | cut -c9-10`
+ Hour=`echo ${last} | cut -c12-13`
+ Minute=`echo ${last} | cut -c15-16`
+ end="${Year}-${Month}-${Day}/${Hour}:${Minute}"
+
+ echo "set terminal png size 1200,800"
+ echo "set xdata time"
+ echo "# time range must be in same format as data file"
+ echo "# YYYYMMDD-HHMMSS"
+ echo "set timefmt \"%Y-%m-%d/%H:%M:%S\""
+ echo "set output \"${OUTFIG}/${bsp}-${FIELD}-${DEV}.png\""
+ echo "set xrange [\""${start}"\":\""${end}"\"]"
+ echo "set yrange [${min}:${max}]"
+ echo "set grid"
+ echo "set xlabel \"Date\\nTime\""
+ echo "set ylabel \"${YLABEL}\""
+ echo "set title \"${TITLE}\""
+ echo "set key left box"
+
+ echo "plot \"${OUT}/${bsp}-Osp${DEV}-${FIELD}.dat\" using 1:2 index 0 \\"
+ echo " title \"Osp${DEV}\" with lines, \\"
+ echo " \"${OUT}/${bsp}-OsP${DEV}-${FIELD}.dat\" using 1:2 index 0 \\"
+ echo " title \"OsP${DEV}\" with lines, \\"
+ echo " \"${OUT}/${bsp}-O2p${DEV}-${FIELD}.dat\" using 1:2 index 0 \\"
+ echo " title \"O2p${DEV}\" with lines, \\"
+ echo " \"${OUT}/${bsp}-O2P${DEV}-${FIELD}.dat\" using 1:2 index 0 \\"
+ echo " title \"O2P${DEV}\" with lines"
+}
+
+gen_data()
+{
+ for s in `ls -1 ${bsp}-${CONF}-*/summary.txt | sort `
+ do
+ timestamp=`echo $s | cut -d'-' -f3-4 | cut -d'/' -f1`
+ num=`grep "${PATTERN}" $s | cut -d':' -f2`
+
+ Year=`echo ${timestamp} | cut -c1-4`
+ Month=`echo ${timestamp} | cut -c5-6`
+ Day=`echo ${timestamp} | cut -c7-8`
+ Hour=`echo ${timestamp} | cut -c10-11`
+ Minute=`echo ${timestamp} | cut -c12-13`
+ stamp="${Year}-${Month}-${Day}/${Hour}:${Minute}"
+
+ echo ${stamp} ${num}
+ done
+}
+
#BSPs=`find * -maxdepth 1 -type d | cut -d'-' -f1 | uniq | grep -v rtems`
BSPs=`genBSPList`
@@ -294,7 +460,43 @@ print_index >index.html
# now generate a page per BSP
for bsp in ${BSPs}
do
- doit ${bsp} >${bsp}.html
+ do_perBSPPage ${bsp} >${bsp}.html
done
+# Now generate the plots
+cd $1
+
+OUTFIG=graphs
+OUT=plot_data
+rm -rf ${OUT}
+test -d ${OUT} || mkdir ${OUT}
+test -d ${OUTFIG} || mkdir ${OUTFIG}
+
+for bsp in ${BSPs}
+do
+ for FIELD in total_bytes uncovered_bytes uncovered_percent #covered_percent
+ do
+ # Pattern to find in summary.txt
+ case ${FIELD} in
+ covered_percent) PATTERN="Percentage Executed" ;;
+ uncovered_percent) PATTERN="Percentage Not Executed" ;;
+ total_bytes) PATTERN="Bytes Analyzed" ;;
+ uncovered_bytes) PATTERN="Bytes Not Executed" ;;
+ *) echo "Unknown field (${FIELD})"; exit 1 ;;
+ esac
+
+ for DEV in d D
+ do
+ for CONF in Osp${DEV} OsP${DEV} O2p${DEV} O2P${DEV}
+ do
+ gen_data ${bsp} ${CONF} >${OUT}/${bsp}-${CONF}-${FIELD}.dat
+ done
+
+ pltfile=${OUT}/${bsp}-${FIELD}-${DEV}.plt
+ gen_plot >${pltfile}
+ #echo gnuplot ${pltfile}
+ gnuplot ${pltfile}
+ done
+ done
+done
exit 0