Changeset 99af6b3 in rtems-testing


Ignore:
Timestamp:
Apr 13, 2010, 7:23:22 PM (9 years ago)
Author:
Jennifer Averett <Jennifer.Averett@…>
Branches:
4.11, 8895273c193787f84c4585a10f6d6aceb3b25dc4
Children:
db7695f
Parents:
cbc56b7
Message:

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

  • CoverageReaderQEMU.cc: Reduced calls to get map from a call/address to call/block. This reduced the runtime of the analysis phase significantly.
  • Makefile: Added cpu dependent switches. Also link using CXXFLAGS in case we are profiling.
  • SymbolTable?.cc, SymbolTable?.h: Changed symbol lookup per address to symbol lookup per addressblock.
Location:
rtems-coverage
Files:
5 edited

Legend:

Unmodified
Added
Removed
  • rtems-coverage/ChangeLog

    rcbc56b7 r99af6b3  
     12010-04-13      Jennifer Averett <Jennifer.Averett@OARcorp.com
     2
     3        * CoverageReaderQEMU.cc: Reduced calls to get map from a
     4        call/address to call/block.  This reduced the runtime of the
     5        analysis phase significantly.
     6        * Makefile: Added cpu dependent switches.  Also link using
     7        CXXFLAGS in case we are profiling.
     8        * SymbolTable.cc, SymbolTable.h: Changed symbol lookup per address
     9        to symbol lookup per addressblock.
     10
    1112010-04-13      Joel Sherrill <joel.sherrill@oarcorp.com>
    212
  • rtems-coverage/CoverageReaderQEMU.cc

    rcbc56b7 r99af6b3  
    1616#include "CoverageReaderQEMU.h"
    1717#include "ExecutableInfo.h"
     18#include "CoverageMap.h"
    1819
    1920/* XXX really not always right */
     
    2526#if (__GNUC__ <= 2)
    2627#define STAT stat
     28#define OPEN fopen
    2729#else
    2830#define STAT stat64
     31#define OPEN fopen64
    2932#endif
    3033
     
    6972    // Open the coverage file and read the header.
    7073    //
    71     traceFile = fopen( file, "r" );
     74    traceFile = OPEN( file, "r" );
    7275    if (!traceFile) {
    7376      fprintf( stderr, "Unable to open %s\n", file );
     
    103106    //
    104107    while (1) {
     108      CoverageMapBase* aCoverageMap = NULL;
     109
    105110      status = fread( &entry, sizeof(struct trace_entry), 1, traceFile );
    106111      if (status != 1)
     
    111116
    112117      // Mark block as fully executed.
     118      // Obtain the coverage map containing the specified address.
     119      aCoverageMap = executableInformation->getCoverageMap( entry.pc );
     120
     121      // Ensure that coverage map exists.
     122      if (!aCoverageMap)
     123        continue;
     124
    113125      if (entry.op & TRACE_OP_BLOCK) {
    114         for (i=0; i<entry.size; i++) {
    115           executableInformation->markWasExecuted( entry.pc + i );
     126       for (i=0; i<entry.size; i++) {
     127          aCoverageMap->setWasExecuted( entry.pc + i );
    116128        }
    117129      }
     
    121133
    122134        if (entry.op & TRACE_OP_TAKEN)
    123           executableInformation->markBranchTaken(
    124             entry.pc + entry.size -1
    125           );
     135          aCoverageMap->setWasTaken( entry.pc + entry.size - 1);
    126136
    127137        else if (entry.op & TRACE_OP_NOT_TAKEN)
    128           executableInformation->markBranchNotTaken(
    129             entry.pc + entry.size -1
    130           );
     138          aCoverageMap->setWasNotTaken( entry.pc + entry.size -1 );
    131139      }
    132140    }
  • rtems-coverage/Makefile

    rcbc56b7 r99af6b3  
    4141
    4242covoar: $(COVOAR_OBJS)
    43         $(CXX) -o $(@) $(COVOAR_OBJS)
     43        $(CXX) $(CXXFLAGS) -o $(@) $(COVOAR_OBJS)
    4444
    4545covoar.o: covoar.cc CoverageFactory.h CoverageMap.h DesiredSymbols.h \
  • rtems-coverage/SymbolTable.cc

    rcbc56b7 r99af6b3  
    5656  )
    5757  {
    58     contents_t::iterator it = contents.find( address );
     58    contents_t::iterator it = contents.end();
    5959
    60     if (it == contents.end())
     60    it--;
     61    if (address > ((*it).first)) {
    6162      return "";
    62     else
    63       return ((*it).second);
     63    }
     64
     65    it = contents.lower_bound( address );
     66    if (((*it).second).min <= address ) {
     67      return ((*it).second).symbol;
     68    } else {
     69      return "";
     70    }
    6471  }
    6572
     
    8087
    8188    // Generate the nm output
    82     sprintf( buffer, "%s -f sysv %s | sed -e \'s/ *$//\' >nm.tmp",
     89    sprintf( buffer, "%s -n -f sysv %s | sed -e \'s/ *$//\' >nm.tmp",
    8390      Tools->getNm(), executableName.c_str() );
    8491
     
    128135          // add the symbol information to the symbol table.
    129136          end = start + length - 1;
    130           for (address = start; address <= end; address++) {
    131             contents[ address ] = symbol;
    132           }
     137          symbol_entry_t entry = { start, end, symbol };
     138          contents[end] = entry;
     139
    133140          symbolData.startingAddress = start;
    134141          symbolData.length = length;
  • rtems-coverage/SymbolTable.h

    rcbc56b7 r99af6b3  
    9797     *  with the symbol that contains the address.
    9898     */
    99     typedef std::map<uint32_t, std::string> contents_t;
     99    typedef struct {
     100       uint32_t min;
     101       uint32_t max;
     102       std::string symbol;
     103    } symbol_entry_t;
     104    typedef std::map< uint32_t, symbol_entry_t > contents_t;
    100105    contents_t contents;
     106
    101107
    102108    /*!
Note: See TracChangeset for help on using the changeset viewer.