Skip to content
  • Jan Wedvik's avatar
    028c291f
    This is a fix for Bug #17177279 'NDB : IMPROVE JAM() COVERAGE AND · 028c291f
    Jan Wedvik authored
    EFFECTIVENESS'. This commit changes the jam trace mechanism such that each 
    entry in the jam trace buffer now will refer to a unique file id (JAM_FILE_ID) 
    rather than a block number. This bringe the following benefits:
    - It is much easier to map an entry to the right source code location.
      (Trace files will point to the source file rather than the block.)
    - jam should be slightly faster, since the jam value can be calculated at
      compile time.
    - Forgetting to call jamEntry() when going from one block to another is no 
      longer a problem. Each jam() call records the complete context. From
      now on, there is no need to add jamEntry() calls, jam() is sufficient.
    - There is no need to maintain per-file jam offsets to distinguish between
      different files within a block.
    
    See comments for jamFileNames in Emulator.cpp for a decription of how
    to add new JAM_FILE_IDs.
    
    This commit gathers include directives at the top of the source files
    that have JAM_FILE_Ids. That way, it is easier to add a JAM_FILE_ID 
    macro that will not be  redefined by some include file. Also, gathering 
    include directives in one place improves code readability.
    
    Notes:
    * There were two cases of the following pattern: A.hpp defines class A. Then
      B.hpp in included, which defines class B and then defines inline methods for
      B which refers members of A. Finally A.hpp defines inline methods for A 
      which refers members of B. This mutual dependency means that A.hpp cannot 
      include B.hpp until *after* class A has been defined. It turned out that
      both cases of this pattern were due to methods that were not in use. 
      This was LogLevel::operator=(const EventSubscribeReq&) and 
      SignalCounter::operator=(const NodeReceiverGroup&). These methods have been
      removed such that the corresponding #include directives could be moved to
      the top.  
    
    * SimulatedBlock.hpp had an unneeded #include of Mutex.hpp. This would not 
      compile unless Mutex.hpp was included after initial definitions in
      SimulatedBlock.hpp. Therefore, the #include was removed from 
      SimulatedBlock.hpp. Instead, Mutex.hpp is included directly from the files
      that need it.
    028c291f
    This is a fix for Bug #17177279 'NDB : IMPROVE JAM() COVERAGE AND
    Jan Wedvik authored
    EFFECTIVENESS'. This commit changes the jam trace mechanism such that each 
    entry in the jam trace buffer now will refer to a unique file id (JAM_FILE_ID) 
    rather than a block number. This bringe the following benefits:
    - It is much easier to map an entry to the right source code location.
      (Trace files will point to the source file rather than the block.)
    - jam should be slightly faster, since the jam value can be calculated at
      compile time.
    - Forgetting to call jamEntry() when going from one block to another is no 
      longer a problem. Each jam() call records the complete context. From
      now on, there is no need to add jamEntry() calls, jam() is sufficient.
    - There is no need to maintain per-file jam offsets to distinguish between
      different files within a block.
    
    See comments for jamFileNames in Emulator.cpp for a decription of how
    to add new JAM_FILE_IDs.
    
    This commit gathers include directives at the top of the source files
    that have JAM_FILE_Ids. That way, it is easier to add a JAM_FILE_ID 
    macro that will not be  redefined by some include file. Also, gathering 
    include directives in one place improves code readability.
    
    Notes:
    * There were two cases of the following pattern: A.hpp defines class A. Then
      B.hpp in included, which defines class B and then defines inline methods for
      B which refers members of A. Finally A.hpp defines inline methods for A 
      which refers members of B. This mutual dependency means that A.hpp cannot 
      include B.hpp until *after* class A has been defined. It turned out that
      both cases of this pattern were due to methods that were not in use. 
      This was LogLevel::operator=(const EventSubscribeReq&) and 
      SignalCounter::operator=(const NodeReceiverGroup&). These methods have been
      removed such that the corresponding #include directives could be moved to
      the top.  
    
    * SimulatedBlock.hpp had an unneeded #include of Mutex.hpp. This would not 
      compile unless Mutex.hpp was included after initial definitions in
      SimulatedBlock.hpp. Therefore, the #include was removed from 
      SimulatedBlock.hpp. Instead, Mutex.hpp is included directly from the files
      that need it.
Loading