Changeset 6332f68 in rtems-testing


Ignore:
Timestamp:
Aug 21, 2011, 4:00:07 PM (8 years ago)
Author:
Joel Sherrill <joel.sherrill@…>
Branches:
4.11, 8895273c193787f84c4585a10f6d6aceb3b25dc4
Children:
ab5e450
Parents:
e8cc0db
Message:

2011-08-21 Pawel Zagorski <pzagor@…>

PR 1900/testing

  • CoverageMapBase?.cc, CoverageMapBase?.h, DesiredSymbols?.cc: Changed tracking of "instruction was executed" from a boolean to a counter. This change was propagated as needed and a helper method to access new information (getWasExecuted) was added.
  • covoar.cc: Removed unnecessary blank line.
Location:
covoar
Files:
5 edited

Legend:

Unmodified
Added
Removed
  • covoar/ChangeLog

    re8cc0db r6332f68  
     12011-08-21      Pawel Zagorski <pzagor@agh.edu.pl>
     2
     3        PR 1900/testing
     4        * CoverageMapBase.cc, CoverageMapBase.h, DesiredSymbols.cc:
     5        Changed tracking of "instruction was executed" from a boolean
     6        to a counter.  This change was propagated as needed and a helper
     7        method to access new information (getWasExecuted) was added.
     8        * covoar.cc: Removed unnecessary blank line.
     9
    1102011-03-08      Joel Sherrill <joel.sherrilL@OARcorp.com>
    211
  • covoar/CoverageMapBase.cc

    re8cc0db r6332f68  
    4141
    4242      i->isStartOfInstruction = false;
    43       i->wasExecuted          = false;
     43      i->wasExecuted          = 0;
    4444      i->isBranch             = false;
    4545      i->isNop                = false;
     
    201201      return;
    202202
    203     Info[ offset ].wasExecuted = true;
     203    Info[ offset ].wasExecuted += 1;
     204  }
     205
     206  void CoverageMapBase::sumWasExecuted( uint32_t address, uint32_t addition)
     207  {
     208    uint32_t offset;
     209 
     210    if (determineOffset( address, &offset ) != true)
     211      return;
     212
     213    Info[ offset ].wasExecuted += addition;
    204214  }
    205215
     
    207217  {
    208218    uint32_t offset;
    209  
    210     if (determineOffset( address, &offset ) != true)
    211       return false;
    212 
    213    return Info[ offset ].wasExecuted;
     219    bool     result;
     220 
     221    result = true;
     222
     223    if (determineOffset( address, &offset ) != true)
     224      result = false;
     225
     226    if (Info[ offset ].wasExecuted <= 0)
     227      result = false;
     228
     229    return result;
     230  }
     231
     232  uint32_t CoverageMapBase::getWasExecuted( uint32_t address ) const
     233  {
     234    uint32_t offset;
     235
     236    if (determineOffset( address, &offset ) != true)
     237      return 0;
     238
     239    return Info[ offset ].wasExecuted; 
    214240  }
    215241
  • covoar/CoverageMapBase.h

    re8cc0db r6332f68  
    176176
    177177    /*!
    178      *  This method sets the boolean which indicates that the instruction
    179      *  at the specified address was executed.
     178     *  This method increments the counter which indicates how many times
     179     *  the instruction at the specified address was executed.
    180180     *
    181181     *  @param[in] address specifies the address which was executed
     
    195195
    196196    /*!
     197     *  This method increases the counter which indicates how many times
     198     *  the instruction at the specified address was executed. It is used
     199     *  for merging coverage maps.
     200     *
     201     *  @param[in] address specifies the address which was executed
     202     *  @param[in] address specifies the execution count that should be
     203     *             added
     204     */
     205    virtual void sumWasExecuted( uint32_t address, uint32_t addition );
     206
     207    /*!
     208     *  This method returns an unsigned integer which indicates how often
     209     *  the instruction at the specified address was executed.
     210     *
     211     *  @param[in] address specifies the address to check
     212     * 
     213     *  @return Returns number of executins
     214     */
     215    uint32_t getWasExecuted( uint32_t address ) const;
     216
     217    /*!
    197218     *  This method sets the boolean which indicates if the specified
    198219     *  address is the starting address of a branch instruction.
     
    305326      bool isStartOfInstruction;
    306327      /*!
    307        *  This member indicates that the address was executed.
    308        */
    309       bool wasExecuted;
     328       *  This member indicates how many times the address was executed.
     329       */
     330      uint32_t wasExecuted;
    310331      /*!
    311332       *  This member indicates that the address is a branch instruction.
  • covoar/DesiredSymbols.cc

    re8cc0db r6332f68  
    630630    uint32_t              sBaseAddress;
    631631    uint32_t              sMapSize;
     632    uint32_t              executionCount;
    632633   
    633634    // Ensure that the symbol is a desired symbol.
     
    674675
    675676      // Merge the execution data.
    676       if (sourceCoverageMap->wasExecuted( sAddress ))
    677         destinationCoverageMap->setWasExecuted( dAddress );
     677      executionCount = sourceCoverageMap->getWasExecuted( sAddress );
     678      destinationCoverageMap->sumWasExecuted( dAddress, executionCount );
    678679
    679680      // Merge the branch data.
  • covoar/covoar.cc

    re8cc0db r6332f68  
    8282#include "ConfigFile.h"
    8383Configuration::FileReader *CoverageConfiguration;
    84 
    8584Configuration::Options_t Options[] = {
    8685  { "explanations",         NULL },
Note: See TracChangeset for help on using the changeset viewer.