Changeset 9cd7fc9 in rtems-testing


Ignore:
Timestamp:
Aug 31, 2011, 8:44:25 PM (8 years ago)
Author:
Joel Sherrill <joel.sherrill@…>
Branches:
4.11, 8895273c193787f84c4585a10f6d6aceb3b25dc4
Children:
8d62360
Parents:
f0bba1d
Message:

* empty log message *

Files:
8 edited

Legend:

Unmodified
Added
Removed
  • covoar/ChangeLog

    rf0bba1d r9cd7fc9  
     12011-08-31      Pawel Zagorski <pzagor@agh.edu.pl>
     2
     3        * covoar/CoverageMapBase.cc, covoar/CoverageMapBase.h,
     4        covoar/DesiredSymbols.cc, covoar/DesiredSymbols.h,
     5        covoar/app_common.cc, covoar/app_common.h,
     6        rtems-coverage/do_coverage:
     7        Modified do_coverage script and source code to gather information
     8        about object files from which symbols originate. Changed tracking
     9        of "branch was taken" and "branch was not taken" from booleans to
     10        counters. Change propagated and new helper methods added:
     11        (getWasTaken, getWasNotTaken, sumWasTaken, sumWasNotTaken)
     12
    1132011-08-21      Pawel Zagorski <pzagor@agh.edu.pl>
    214
  • covoar/CoverageMapBase.cc

    rf0bba1d r9cd7fc9  
    4444      i->isBranch             = false;
    4545      i->isNop                = false;
    46       i->wasTaken             = false;
    47       i->wasNotTaken          = false;
     46      i->wasTaken             = 0;
     47      i->wasNotTaken          = 0;
    4848    }
    4949  }
     
    293293      return;
    294294
    295     Info[ offset ].wasTaken = true;
     295    Info[ offset ].wasTaken += 1;
    296296  }
    297297
     
    305305      return;
    306306
    307     Info[ offset ].wasNotTaken = true;
     307    Info[ offset ].wasNotTaken += 1;
    308308  }
    309309
     
    332332  bool CoverageMapBase::wasNotTaken( uint32_t address ) const
    333333  {
    334     uint32_t offset;
    335  
    336     if (determineOffset( address, &offset ) != true)
    337       return false;
     334            uint32_t offset;
     335            bool     result;
     336
     337            result = true;
     338
     339            if (determineOffset( address, &offset ) != true)
     340              result = false;
     341
     342            if (Info[ offset ].wasNotTaken <= 0)
     343              result = false;
     344
     345            return result;
     346  }
     347
     348  void CoverageMapBase::sumWasNotTaken( uint32_t address, uint32_t addition)
     349  {
     350    uint32_t offset;
     351
     352    if (determineOffset( address, &offset ) != true)
     353      return;
     354
     355    Info[ offset ].wasNotTaken += addition;
     356  }
     357
     358  uint32_t CoverageMapBase::getWasNotTaken( uint32_t address ) const
     359  {
     360    uint32_t offset;
     361
     362    if (determineOffset( address, &offset ) != true)
     363      return 0;
    338364
    339365    return Info[ offset ].wasNotTaken;
     
    343369  {
    344370    uint32_t offset;
    345  
    346     if (determineOffset( address, &offset ) != true)
    347       return false;
     371    bool     result;
     372
     373    result = true;
     374 
     375    if (determineOffset( address, &offset ) != true)
     376      result = false;
     377
     378    if (Info[ offset ].wasTaken <= 0)
     379      result = false;
     380
     381    return result;
     382  }
     383
     384  void CoverageMapBase::sumWasTaken( uint32_t address, uint32_t addition)
     385  {
     386    uint32_t offset;
     387
     388    if (determineOffset( address, &offset ) != true)
     389      return;
     390
     391    Info[ offset ].wasTaken += addition;
     392  }
     393
     394  uint32_t CoverageMapBase::getWasTaken( uint32_t address ) const
     395  {
     396    uint32_t offset;
     397
     398    if (determineOffset( address, &offset ) != true)
     399      return 0;
    348400
    349401    return Info[ offset ].wasTaken;
  • covoar/CoverageMapBase.h

    rf0bba1d r9cd7fc9  
    254254
    255255    /*!
    256      *  This method sets the boolean which indicates if the branch
    257      *  at the specified address was taken.
     256     *  This method increments the counter which indicates how many times
     257     *  the branch at the specified address was taken.
    258258     *
    259259     *  @param[in] address specifies the address of the branch instruction
     
    262262
    263263    /*!
    264      *  This method sets the boolean which indicates if the branch
    265      *  at the specified address was NOT taken.
     264     *  This method increases the counter which indicates how many times
     265     *  the branch at the specified address was taken. It is used
     266     *  for merging coverage maps.
     267     *
     268     *  @param[in] address specifies the address which was executed
     269     *  @param[in] address specifies the execution count that should be
     270     *             added
     271     */
     272    virtual void sumWasTaken( uint32_t address, uint32_t addition );
     273
     274    /*!
     275     *  This method returns an unsigned integer which indicates how often
     276     *  the branch at the specified address was taken.
     277     *
     278     *  @param[in] address specifies the address to check
     279     *
     280     *  @return Returns number of executins
     281     */
     282    uint32_t getWasTaken( uint32_t address ) const;
     283
     284    /*!
     285     *  This method increments the counter which indicates how many times
     286     *  the branch at the specified address was not taken.
    266287     *
    267288     *  @param[in] address specifies the address of the branch instruction
    268289     */
    269290    void setWasNotTaken( uint32_t address );
     291
     292    /*!
     293     *  This method increases the counter which indicates how many times
     294     *  the branch at the specified address was not taken. It is used
     295     *  for merging coverage maps.
     296     *
     297     *  @param[in] address specifies the address which was executed
     298     *  @param[in] address specifies the execution count that should be
     299     *             added
     300     */
     301    virtual void sumWasNotTaken( uint32_t address, uint32_t addition );
     302
     303    /*!
     304     *  This method returns an unsigned integer which indicates how often
     305     *  the branch at the specified address was not taken.
     306     *
     307     *  @param[in] address specifies the address to check
     308     *
     309     *  @return Returns number of executins
     310     */
     311    uint32_t getWasNotTaken( uint32_t address ) const;
     312
    270313
    271314    /*!
     
    341384       *  instruction at the address was taken.
    342385       */
    343       bool wasTaken;
     386      uint32_t wasTaken;
    344387      /*!
    345388       *  When isBranch is TRUE, this member indicates that the branch
    346389       *  instruction at the address was NOT taken.
    347390       */
    348       bool wasNotTaken;
     391      uint32_t wasNotTaken;
    349392    } perAddressInfo_t;
    350393
  • covoar/DesiredSymbols.cc

    rf0bba1d r9cd7fc9  
    3535  )
    3636  {
    37     char*                   cStatus;
     37    int                   cStatus;
    3838    bool                    done = false;
    3939    FILE*                   sFile;
     
    7070      do {
    7171        inputBuffer[0] = '\0';
    72         cStatus = fgets( inputBuffer, MAX_LINE_LENGTH, sFile );
    73         if ( cStatus == NULL ) {
     72        inputBuffer2[0] = '\0';
     73        cStatus = fscanf( sFile, "%s %s", inputBuffer, inputBuffer2 );
     74        //TODO: Store inputBuffer2 value containing symbol source file
     75        if ( cStatus == EOF ) {
    7476          done = true;
    7577        }
    7678        else {
    77           inputBuffer[ strlen(inputBuffer) - 1] = '\0';
     79          //inputBuffer[ strlen(inputBuffer) - 1] = '\0';
    7880          line++;
    7981        }
     
    679681
    680682      // Merge the branch data.
    681       if (sourceCoverageMap->wasTaken( sAddress ))
    682         destinationCoverageMap->setWasTaken( dAddress );
    683 
    684       if (sourceCoverageMap->wasNotTaken( sAddress ))
    685         destinationCoverageMap->setWasNotTaken( dAddress );
     683      executionCount = sourceCoverageMap->getWasTaken( sAddress );
     684      destinationCoverageMap->sumWasTaken( dAddress, executionCount );
     685
     686      executionCount = sourceCoverageMap->getWasNotTaken( sAddress );
     687      destinationCoverageMap->sumWasNotTaken( dAddress, executionCount );
    686688    }
    687689  }
  • covoar/DesiredSymbols.h

    rf0bba1d r9cd7fc9  
    191191
    192192    /*!
    193      *  This variable contains a map of ymbol sets for each
     193     *  This variable contains a map of symbol sets for each
    194194     *  symbol in the system keyed on the symbol name.
    195195     */
  • covoar/app_common.cc

    rf0bba1d r9cd7fc9  
    3636const char*                 projectName         = NULL;
    3737char                        inputBuffer[MAX_LINE_LENGTH];
     38char                        inputBuffer2[MAX_LINE_LENGTH];
    3839
    3940
  • covoar/app_common.h

    rf0bba1d r9cd7fc9  
    2424#define MAX_LINE_LENGTH             512
    2525extern char                         inputBuffer[MAX_LINE_LENGTH];
     26extern char                         inputBuffer2[MAX_LINE_LENGTH];
    2627
    2728
  • rtems-coverage/do_coverage

    rf0bba1d r9cd7fc9  
    464464      # echo "========= START $l"
    465465      ${TARGET}-nm --format=sysv $l | grep "FUNC|" | \
    466         cut -d'|' -f1 | sed -e 's/ *$//'
     466        cut -d'|' -f1 | sed -e 's/ *$//' -e "s,$, ${l},"
     467
    467468      # echo "========= END $l"
    468469
Note: See TracChangeset for help on using the changeset viewer.