Changeset 36c53fb in rtems-testing


Ignore:
Timestamp:
Oct 14, 2010, 2:27:49 PM (9 years ago)
Author:
Joel Sherrill <joel.sherrill@…>
Branches:
4.11, 8895273c193787f84c4585a10f6d6aceb3b25dc4
Children:
e084b8a
Parents:
285f70a
Message:

2010-10-14 Joel Sherrill <joel.sherrilL@…>

  • generate_coverage_html: Add progress tracking time/series plots.
Location:
rtems-coverage
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • rtems-coverage/ChangeLog

    r285f70a r36c53fb  
     12010-10-14      Joel Sherrill <joel.sherrilL@OARcorp.com>
     2
     3        * generate_coverage_html: Add progress tracking time/series plots.
     4
    152010-08-26      Joel Sherrill <joel.sherrill@oarcorp.com>
    26
  • rtems-coverage/generate_coverage_html

    r285f70a r36c53fb  
    161161}
    162162
    163 doit()
     163do_perBSPPage()
    164164{
    165165  BSP=${1}
     
    170170
    171171  cat <<EOF
     172<table align="center">
     173<thead>
     174<tr class="heading-title">
     175<td width="40%">Result Tables</td>
     176<td width="40%">Time Series Graphs</td>
     177</thead>
     178</tr>
     179<td>
    172180<ul>
    173 <li><a href="#O2pd">Results for -O2, POSIX Disabled, Core Only</a></li>
    174 <li><a href="#O2pD">Results for -O2, POSIX Disabled, Developmental</a></li>
    175 <li><a href="#O2Pd">Results for -O2, POSIX Enabled, Core Only</a></li>
    176 <li><a href="#O2PD">Results for -O2, POSIX Enabled, Developmental</a></li>
    177 <li><a href="#Ospd">Results for -Os, POSIX Disabled, Core Only</a></li>
    178 <li><a href="#OspD">Results for -Os, POSIX Disabled, Developmental</a></li>
    179 <li><a href="#OsPd">Results for -Os, POSIX Enabled, Core Only</a></li>
    180 <li><a href="#OsPD">Results for -Os, POSIX Enabled, Developmental</a></li>
     181<li><a href="#O2pd">-O2, POSIX Disabled, Core Only</a></li>
     182<li><a href="#O2pD">-O2, POSIX Disabled, Developmental</a></li>
     183<li><a href="#O2Pd">-O2, POSIX Enabled, Core Only</a></li>
     184<li><a href="#O2PD">-O2, POSIX Enabled, Developmental</a></li>
     185<li><a href="#Ospd">-Os, POSIX Disabled, Core Only</a></li>
     186<li><a href="#OspD">-Os, POSIX Disabled, Developmental</a></li>
     187<li><a href="#OsPd">-Os, POSIX Enabled, Core Only</a></li>
     188<li><a href="#OsPD">-Os, POSIX Enabled, Developmental</a></li>
    181189</ul>
     190</td>
     191<td>
     192<ul>
     193EOF
     194
     195echo "<li><a href=\"graphs/${BSP}-uncovered_percent-d.png\">"
     196echo "  Uncovered Percentage (Core)</a></li>"
     197echo "<li><a href=\"graphs/${BSP}-uncovered_percent-D.png\">"
     198echo "  Uncovered Percentage (Developmental)</a></li>"
     199echo "<li><a href=\"graphs/${BSP}-uncovered_bytes-d.png\">"
     200echo "  Uncovered Bytes (Core)</a></li>"
     201
     202echo "<li><a href=\"graphs/${BSP}-total_bytes-D.png\">"
     203echo "  Total Bytes Analyzed (Developmental)</a></li>"
     204echo "<li><a href=\"graphs/${BSP}-total_bytes-d.png\">"
     205echo "  Total Bytes Analyzed (Core)</a></li>"
     206echo "<li><a href=\"graphs/${BSP}-total_bytes-D.png\">"
     207echo "  Total Bytes Analyzed (Developmental)</a></li>"
     208
     209echo "<li><a href=\"graphs/${BSP}-uncovered_bytes-D.png\">"
     210echo "  Uncovered Bytes (Developmental)</a></li>"
     211echo "<li><a href=\"graphs/${BSP}-uncovered_bytes-d.png\">"
     212echo "  Uncovered Bytes (Core)</a></li>"
     213echo "<li><a href=\"graphs/${BSP}-uncovered_bytes-D.png\">"
     214echo "  Uncovered Bytes (Developmental)</a></li>"
     215
     216cat <<EOF
     217</ul>
     218</td>
     219</tr>
     220</table>
    182221</br>
    183222EOF
     
    255294genBSPList()
    256295{
    257   find * -maxdepth 1 -type d | cut -d'-' -f1 | uniq | grep -v rtems | \
     296  find * -maxdepth 1 -type d | cut -d'-' -f1 | uniq | \
     297    sed -e '/rtems/d' -e '/plot_data/d' -e '/graphs/d' | \
    258298    while read bsp
    259299    do
     
    283323}
    284324
     325# round up
     326round_up()
     327{
     328  num=$1
     329  round=$2
     330  echo ${num} ${num} ${round} + ${round} % - ${round} + p | dc
     331}
     332
     333# round down
     334round_down()
     335{
     336  num=$1
     337  round=$2
     338  echo ${num} ${num} ${round} - ${round} % - ${round} - p| dc
     339}
     340
     341# Generate the GNU Plot script
     342gen_plot()
     343{
     344  # Now merge the data
     345  datfiles=`ls -1 ${OUT}/${bsp}-*${DEV}-${FIELD}.dat`
     346  first=`cat ${datfiles} | sort -t' ' -k1.3 -n | head -n 1 | cut -d' ' -f1`
     347  last=`cat ${datfiles} | sort -t' ' -k1.3 -n | tail -n 1 | cut -d' ' -f1`
     348
     349  min=`cat ${datfiles} | sort -k2 -n | head -n 1 | cut -d' ' -f2`
     350  max=`cat ${datfiles} | sort -k2 -n | tail -n 1 | cut -d' ' -f2`
     351  round=
     352  case ${FIELD} in
     353    covered_percent)
     354      max=100.0
     355      YLABEL=Covered
     356      ;;
     357    uncovered_percent)
     358      min=0
     359      YLABEL=Uncovered
     360      ;;
     361    uncovered_bytes)
     362      round=1000
     363      min=`round_down ${min} 1000 0`
     364      max=`round_up   ${max} 1000 1000000`
     365      YLABEL=Uncovered
     366      ;;
     367    total_bytes)
     368      round=5000
     369      min=`round_down ${min} 5000 0`
     370      max=`round_up   ${max} 5000 1000000`
     371      YLABEL=Total
     372      ;;
     373    *)
     374      echo "ERROR unknown FIELD ${FIELD}"
     375      exit 1
     376      ;;
     377  esac
     378  # No negative numbers. :=D
     379  if [ ${min} -lt 0 ]  ; then
     380    min=0
     381  fi
     382  if [ "X${round}" != "X" ] ; then   # definitely integer
     383    if [ ${min} -eq ${max} ] ; then
     384      max=`expr ${min} + ${round}`
     385    fi
     386  fi
     387
     388  # Is this graph using data for developmental or core configurations?
     389  if [ ${DEV} = "D" ] ; then
     390    TITLE="${PATTERN} (Developmental)"
     391  else
     392    TITLE="${PATTERN} (Core)"
     393  fi
     394
     395  Year=`echo ${first} | cut -c1-4`
     396  Month=`echo ${first} | cut -c6-7`
     397  Day=`echo ${first} | cut -c9-10`
     398  Hour=`echo ${first} | cut -c12-13`
     399  Minute=`echo ${first} | cut -c15-16`
     400  start="${Year}-${Month}-${Day}/${Hour}:${Minute}"
     401
     402  Year=`echo ${last} | cut -c1-4`
     403  Month=`echo ${last} | cut -c6-7`
     404  Day=`echo ${last} | cut -c9-10`
     405  Hour=`echo ${last} | cut -c12-13`
     406  Minute=`echo ${last} | cut -c15-16`
     407  end="${Year}-${Month}-${Day}/${Hour}:${Minute}"
     408
     409  echo "set terminal png size 1200,800"
     410  echo "set xdata time"
     411  echo "# time range must be in same format as data file"
     412  echo "# YYYYMMDD-HHMMSS"
     413  echo "set timefmt \"%Y-%m-%d/%H:%M:%S\""
     414  echo "set output \"${OUTFIG}/${bsp}-${FIELD}-${DEV}.png\""
     415  echo "set xrange [\""${start}"\":\""${end}"\"]"
     416  echo "set yrange [${min}:${max}]"
     417  echo "set grid"
     418  echo "set xlabel \"Date\\nTime\""
     419  echo "set ylabel \"${YLABEL}\""
     420  echo "set title \"${TITLE}\""
     421  echo "set key left box"
     422 
     423  echo "plot \"${OUT}/${bsp}-Osp${DEV}-${FIELD}.dat\" using 1:2 index 0 \\"
     424  echo "  title \"Osp${DEV}\" with lines, \\"
     425  echo "     \"${OUT}/${bsp}-OsP${DEV}-${FIELD}.dat\" using 1:2 index 0 \\"
     426  echo "  title \"OsP${DEV}\" with lines, \\"
     427  echo "     \"${OUT}/${bsp}-O2p${DEV}-${FIELD}.dat\" using 1:2 index 0 \\"
     428  echo "  title \"O2p${DEV}\" with lines, \\"
     429  echo "     \"${OUT}/${bsp}-O2P${DEV}-${FIELD}.dat\" using 1:2 index 0 \\"
     430  echo "  title \"O2P${DEV}\" with lines"
     431}
     432
     433gen_data()
     434{
     435  for s in `ls -1 ${bsp}-${CONF}-*/summary.txt | sort `
     436  do
     437    timestamp=`echo $s | cut -d'-' -f3-4 | cut -d'/' -f1`
     438    num=`grep "${PATTERN}" $s | cut -d':' -f2`
     439
     440    Year=`echo ${timestamp} | cut -c1-4`
     441    Month=`echo ${timestamp} | cut -c5-6`
     442    Day=`echo ${timestamp} | cut -c7-8`
     443    Hour=`echo ${timestamp} | cut -c10-11`
     444    Minute=`echo ${timestamp} | cut -c12-13`
     445    stamp="${Year}-${Month}-${Day}/${Hour}:${Minute}"
     446
     447    echo ${stamp} ${num}
     448  done
     449}
     450
    285451#BSPs=`find * -maxdepth 1 -type d | cut -d'-' -f1 | uniq | grep -v rtems`
    286452BSPs=`genBSPList`
     
    295461for bsp in ${BSPs}
    296462do
    297   doit ${bsp} >${bsp}.html
     463  do_perBSPPage ${bsp} >${bsp}.html
    298464done
    299465
     466# Now generate the plots
     467cd $1
     468
     469OUTFIG=graphs
     470OUT=plot_data
     471rm -rf ${OUT}
     472test -d ${OUT} || mkdir ${OUT}
     473test -d ${OUTFIG} || mkdir ${OUTFIG}
     474
     475for bsp in ${BSPs}
     476do
     477  for FIELD in total_bytes uncovered_bytes uncovered_percent #covered_percent
     478  do
     479    # Pattern to find in summary.txt
     480    case ${FIELD} in
     481      covered_percent)   PATTERN="Percentage Executed" ;;
     482      uncovered_percent) PATTERN="Percentage Not Executed" ;;
     483      total_bytes)       PATTERN="Bytes Analyzed" ;;
     484      uncovered_bytes)   PATTERN="Bytes Not Executed" ;;
     485      *)                 echo "Unknown field (${FIELD})"; exit 1 ;;
     486    esac
     487
     488    for DEV in d D
     489    do
     490      for CONF in Osp${DEV} OsP${DEV} O2p${DEV} O2P${DEV}
     491      do
     492        gen_data ${bsp} ${CONF} >${OUT}/${bsp}-${CONF}-${FIELD}.dat
     493      done
     494
     495      pltfile=${OUT}/${bsp}-${FIELD}-${DEV}.plt
     496      gen_plot >${pltfile}
     497      #echo gnuplot ${pltfile}
     498      gnuplot ${pltfile}
     499    done
     500  done
     501done
    300502exit 0
Note: See TracChangeset for help on using the changeset viewer.