Changeset 2d88955 in rtems-testing


Ignore:
Timestamp:
May 13, 2010, 5:36:17 PM (9 years ago)
Author:
Jennifer Averett <Jennifer.Averett@…>
Branches:
4.11, 8895273c193787f84c4585a10f6d6aceb3b25dc4
Children:
69984ed
Parents:
a21b35e
Message:

2010-05-13 Jennifer Averett <Jennifer.Averett@…

  • DesiredSymbols?.cc, DesiredSymbols?.h, covoar.cc: Added a statistics class to consilidate statistical information. Note, that all new values are still 0 and are not yet calculated.
Location:
rtems-coverage
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • rtems-coverage/ChangeLog

    ra21b35e r2d88955  
     12010-05-13      Jennifer Averett <Jennifer.Averett@OARcorp.com
     2
     3        * DesiredSymbols.cc, DesiredSymbols.h, covoar.cc: Added a statistics
     4        class to consilidate statistical information. Note, that all new
     5        values are still 0 and are not yet calculated.
     6
    172010-05-13      Joel Sherrill <joel.sherrilL@OARcorp.com>
    28
  • rtems-coverage/DesiredSymbols.cc

    ra21b35e r2d88955  
    2525  DesiredSymbols::DesiredSymbols()
    2626  {
    27     branchesAlwaysTaken = 0;
    28     branchesFound = 0;
    29     branchesNeverTaken = 0;
    30     uncoveredRanges = 0;
    3127  }
    3228
     
    164160
    165161      // Now scan through the coverage map of this symbol.
    166       endAddress = sitr->second.sizeInBytes - 1;
     162      endAddress = sitr->second.stats.sizeInBytes - 1;
    167163      a = 0;
    168164      while (a <= endAddress) {
     
    178174          ha--;
    179175
    180           uncoveredRanges++;
     176          stats.uncoveredRanges++;
    181177          theRanges->add(
    182178            sitr->second.baseAddress + la,
     
    190186        // to the uncoverd branches.
    191187        else if (theCoverageMap->isBranch( a )) {
    192           branchesFound++;
     188          stats.branchesFound++;
    193189          la = a;
    194190          for (ha=a+1;
     
    199195
    200196          if (theCoverageMap->wasAlwaysTaken( la )) {
    201             branchesAlwaysTaken++;
     197            stats.branchesAlwaysTaken++;
    202198            theBranches->add(
    203199              sitr->second.baseAddress + la,
     
    216212
    217213          else if (theCoverageMap->wasNeverTaken( la )) {
    218             branchesNeverTaken++;
     214            stats.branchesNeverTaken++;
    219215            theBranches->add(
    220216              sitr->second.baseAddress + la,
     
    266262
    267263      // ensure that the specified size matches the existing size.
    268       if (itr->second.sizeInBytes != size) {
     264      if (itr->second.stats.sizeInBytes != size) {
    269265
    270266        fprintf(
     
    302298        );
    303299      itr->second.unifiedCoverageMap = aCoverageMap;
    304       itr->second.sizeInBytes = size;
     300      itr->second.stats.sizeInBytes = size;
    305301    }
    306302  }
     
    481477
    482478  uint32_t DesiredSymbols::getNumberBranchesAlwaysTaken( void ) const {
    483     return branchesAlwaysTaken;
     479    return stats.branchesAlwaysTaken;
    484480  };
    485481
    486482  uint32_t DesiredSymbols::getNumberBranchesFound( void ) const {
    487     return branchesFound;
     483    return stats.branchesFound;
    488484  };
    489485
    490486  uint32_t DesiredSymbols::getNumberBranchesNeverTaken( void ) const {
    491     return branchesNeverTaken;
     487    return stats.branchesNeverTaken;
    492488  };
    493489
    494490  uint32_t DesiredSymbols::getNumberUncoveredRanges( void ) const {
    495     return uncoveredRanges;
     491    return stats.uncoveredRanges;
    496492  };
    497493
     
    541537    // Ensure that the source and destination coverage maps
    542538    // are the same size.
    543     dMapSize = itr->second.sizeInBytes;
     539    dMapSize = itr->second.stats.sizeInBytes;
    544540    sBaseAddress = sourceCoverageMap->getLowAddress();
    545541    sMapSize = sourceCoverageMap->getHighAddress() - sBaseAddress + 1;
  • rtems-coverage/DesiredSymbols.h

    ra21b35e r2d88955  
    2222
    2323namespace Coverage {
     24
     25
     26  /*! @class Stats
     27   *
     28   *  This class defines the statistics that are tracked.
     29   */
     30  class Statistics {
     31    public:
     32
     33    /*!
     34     *  This member variable contains the total number of branches always
     35     *  taken.
     36     */
     37    int branchesAlwaysTaken;
     38
     39    /*!
     40     *  This member variable contains the total number of branches found.
     41     */
     42    int branchesFound;
     43
     44    /*!
     45     *  This member variable contains the total number of branches never
     46     *  taken.
     47     */
     48    int branchesNeverTaken;
     49
     50    /*!
     51     *  This member contains the size in Bytes.
     52     */
     53    uint32_t sizeInBytes;
     54   
     55    /*!
     56     *  This member contains the size in Bytes.
     57     */
     58    uint32_t sizeInInstructions;
     59
     60    /*!
     61     *  This member variable contains the total number of uncovered bytes.
     62     */
     63    int uncoveredBytes;
     64
     65    /*!
     66     *  This member variable contains the total number of uncovered assembly
     67     *  instructions.
     68     */
     69    int uncoveredInstructions;
     70
     71    /*!
     72     *  This member variable contains the total number of uncovered ranges.
     73     */
     74    int uncoveredRanges;
     75
     76    /*!
     77     *  This method returns the percentage of uncovered instructions.
     78     *
     79     *  @return Returns the percent uncovered instructions
     80     */
     81    uint32_t getPercentUncoveredInstructions( void ) const;
     82
     83    /*!
     84     *  This method returns the percentage of uncovered bytes.
     85     *
     86     *  @return Returns the percent uncovered bytes
     87     */
     88     uint32_t getPercentUncoveredBytes( void ) const;
     89
     90    /*!
     91     *  This method constructs a Statistics instance.
     92     */   
     93     Statistics():
     94       branchesAlwaysTaken(0),
     95       branchesFound(0),
     96       branchesNeverTaken(0),
     97       sizeInBytes(0),
     98       sizeInInstructions(0),
     99       uncoveredBytes(0),
     100       uncoveredInstructions(0),
     101       uncoveredRanges(0)
     102     {
     103     }
     104
     105
     106     
     107  };
    24108
    25109  /*! @class SymbolInformation
     
    37121    uint32_t baseAddress;
    38122
    39     /*!
    40      *  This member contains the size of the symbol.
    41      */
    42     uint32_t sizeInBytes;
    43123
    44124    /*!
     
    54134
    55135    /*!
     136     *  This member contains the statistics kept on each symbol.
     137     */   
     138    Statistics stats;
     139
     140    /*!
    56141     *  This member contains information about the branch instructions of
    57142     *  a symbol that were not fully covered (i.e. taken/not taken).
     
    76161    SymbolInformation() :
    77162      baseAddress( 0 ),
    78       sizeInBytes( 0 ),
    79163      uncoveredBranches( NULL ),
    80164      uncoveredRanges( NULL ),
     
    216300    void preprocess( void );
    217301
     302    /*!
     303     *  This member contains the statistics kept on each symbol.
     304     */   
     305    Statistics stats;
     306
    218307  private:
    219 
    220     /*!
    221      *  This member variable contains the total number of branches always
    222      *  taken for all analyzed symbols.
    223      */
    224     int branchesAlwaysTaken;
    225 
    226     /*!
    227      *  This member variable contains the total number of branches found
    228      *  for all analyzed symbols.
    229      */
    230     int branchesFound;
    231 
    232     /*!
    233      *  This member variable contains the total number of branches never
    234      *  taken for all analyzed symbols.
    235      */
    236     int branchesNeverTaken;
    237 
    238     /*
    239      *  This member variable contains the total number of uncovered ranges
    240      *  for all analyzed symbols.
    241      */
    242     int uncoveredRanges;
    243308
    244309    /*!
  • rtems-coverage/covoar.cc

    ra21b35e r2d88955  
    396396      if (theCoverageMap) {
    397397
    398         endAddress = itr->second.sizeInBytes - 1;
     398        endAddress = itr->second.stats.sizeInBytes - 1;
    399399
    400400        for (a = 0; a <= endAddress; a++) {
Note: See TracChangeset for help on using the changeset viewer.