Uploaded image for project: 'JDK'
  1. JDK
  2. JDK-6207938

Need some way to track the compiler warning messages from the RE builds (all platforms)

XMLWordPrintable

    • generic
    • generic

      Need some way to browse the compiler warning messages from the RE builds (all platforms)

      ###@###.### 2004-12-13 23:54:45 GMT

      Look into possibly using:

      http://www.alphalink.com.au/~gnb/maketool/download.html
      ###@###.### 2004-12-15 17:28:02 GMT
      I'm beginning to think that generating warning error stats during the RE builds and posting those stats might be the best answer to this. Perhaps some kind of comparison from build to build on the various kinds of warnings.

      I created a script to run over a build log that does some of this:

      cruella<3> more warning_stats
      #!/bin/ksh

      logfile="$1"
      if [ ! -r "${logfile}" ] ; then
        echo "USAGE: $0 logfile"
        exit 1
      fi

      left=/tmp/left_warnings.$$
      all=/tmp/all_warnings.$$
      rm -f ${left}
      rm -f ${all}

      printstat()
      {
          printf "%5d %s\n" $2 "$1"
      }

      ( fgrep -i warning: ${logfile} ; \
        egrep -i '^cl : command line warning' ${logfile} ; \
        fgrep -i ':warning ' ${logfile} ; \
        fgrep -i ': not found' ${logfile} ; \
        fgrep -i ': warning - ' ${logfile} ) > ${all}

      total_warnings=`cat ${all} \
                              | wc -l`
      uniq_warnings=`cat ${all} | sort | uniq \
                              | wc -l`
      dup_warnings=`expr ${total_warnings} '-' ${uniq_warnings}`
      ld_warnings=`fgrep ld: ${all} \
                              | wc -l`
      c_warnings=`egrep '[.]c[\":]' ${all} \
                              | wc -l`
      h_warnings=`egrep '[.]h[\":]' ${all} \
                              | wc -l`
      cpp_warnings=`egrep '[.]cpp[\":]' ${all} \
                              | wc -l`
      hpp_warnings=`egrep '[.]hpp[\":]' ${all} \
                              | wc -l`
      java_warnings=`( ( fgrep -v ': warning -' ${all} | fgrep '.java:' ) ; \
                       egrep '^Note:' ${all} ) \
                              | wc -l`
      javadoc_warnings=`fgrep ': warning -' ${all} \
                              | wc -l`
      driver_warnings=`( fgrep cc: ${all} \
                      ; fgrep CC: ${all} \
                      ; egrep '^cl :' ${all} ) \
                              | wc -l`
      make_warnings=`( fgrep '.gmk:' ${all} \
                      ; fgrep akefile: ${all} \
                      ; fgrep '(ignored)' ${all} ) \
                              | wc -l`
      shell_warnings=`( fgrep -i ': not found' ${all} ) \
                              | wc -l`
      build_warnings=`fgrep WARNING: ${all} \
                              | wc -l`
      font_warnings=`fgrep 'entry is missing' ${all} \
                              | wc -l`

      all_warnings=`expr 0 \
              '+' ${ld_warnings} \
              '+' ${c_warnings} \
              '+' ${h_warnings} \
              '+' ${cpp_warnings} \
              '+' ${hpp_warnings} \
              '+' ${java_warnings} \
              '+' ${javadoc_warnings} \
              '+' ${driver_warnings} \
              '+' ${make_warnings} \
              '+' ${shell_warnings} \
              '+' ${build_warnings} \
              '+' ${font_warnings} \
              '+' 0`

      printstat "ld warnings (contains 'ld:')" ${ld_warnings}
      printstat "C warnings (contains '[.]c[\":]')" ${c_warnings}
      printstat "C Include file warnings (contains '[.]h[\":]')" ${h_warnings}
      printstat "C++ warnings (contains '[.]cpp[\":]')" ${cpp_warnings}
      printstat "C++ Include file warnings (contains '[.]hpp[\":]')" ${hpp_warnings}
      printstat "Java warnings (contains '.java:' or 'Note:' )" ${java_warnings}
      printstat "Javadoc warnings (contains ': warning -')" ${javadoc_warnings}
      printstat "Compiler driver warnings (contains cc: or CC: or 'cl :')" ${driver_wa
      rnings}
      printstat "GNU make warnings (contains '.gmk:' or 'akefile:' or '(ignored)')" ${
      make_warnings}
      printstat "Shell warnings (contains ': not found')" ${shell_warnings}
      printstat "Build warnings (contains WARNING:)" ${build_warnings}
      printstat "Font warnings (contains 'entry is missing')" ${font_warnings}
      echo " "
      printstat "Sum of above warnings" ${all_warnings}
      echo " "
      printstat "Messages that appear to be duplicates" ${dup_warnings}

      if [ ${all_warnings} -ne ${total_warnings} ] ; then
        echo "------------- "
        echo "Missed something"
        echo " "
        printstat "Total warnings in file" ${total_warnings}
        echo " "
      fi


      cat ${all} \
                 | fgrep -v ld: \
                 | egrep -v '[.]c[\":]' \
                 | egrep -v '[.]h[\":]' \
                 | egrep -v '[.]cpp[\":]' \
                 | egrep -v '[.]hpp[\":]' \
                 | fgrep -v '.java:' \
                 | egrep -v '^Note:' \
                 | fgrep -v ': warning -' \
                 | fgrep -v cc: \
                 | fgrep -v CC: \
                 | egrep -v '^cl :' \
                 | fgrep -v '.gmk:' \
                 | fgrep -v akefile: \
                 | fgrep -v '(ignored)' \
                 | fgrep -v ': not found' \
                 | fgrep -v WARNING: \
                 | fgrep -v 'entry is missing' \
                 > ${left}
      left_count=`cat ${left} | wc -l`
      if [ ${left_count} -ne 0 ] ; then
        printstat "Remaining errors not counted" ${left_count}
        cat ${left}
      fi

      rm -f ${all}
      rm -f ${left}

      =====

      It creates results like:

      warning_stats log.txt
         40 ld warnings (contains 'ld:') <---- j2se workspace? hotspot wasn't built
        782 C warnings (contains '.c"')
         12 C Include file warnings (contains '.h"')
          5 C++ warnings (contains '.cpp"')
          0 C++ Include file warnings (contains '.hpp"')
         60 Java warnings (contains '.java:')
        500 Javadoc warnings (contains ': warning -')
          2 Compiler driver warnings (contains cc: or CC:)
          2 GNU make warnings (contains '.gmk:' or 'akefile:')
         14 Build warnings (contains WARNING:) <---- Probably because this was a Solaris 10 machine

       1417 Sum of above warnings

        305 Messages that appear to be duplicates

      So my conclusion is that we need to track the progress of driving these numbers down and perhaps treat big jumps up in these numbers as red flags to the product team.

            ohair Kelly Ohair (Inactive)
            ohair Kelly Ohair (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

              Created:
              Updated:
              Resolved:
              Imported:
              Indexed: