Changeset 894bbbc4 in rtems


Ignore:
Timestamp:
Aug 1, 2009, 3:58:59 PM (10 years ago)
Author:
Joel Sherrill <joel.sherrill@…>
Branches:
4.10, 4.11, master
Children:
709ac26
Parents:
e89cf10
Message:

2009-08-01 Joel Sherrill <joel.sherrill@…>

  • score/inline/rtems/score/heap.inl, score/src/heapwalk.c: Do not inline code to check if newline should be printed. It leads to branch path explosion which is really hard to get coverage on.
Location:
cpukit
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • cpukit/ChangeLog

    re89cf10 r894bbbc4  
     12009-08-01      Joel Sherrill <joel.sherrill@oarcorp.com>
     2
     3        * score/inline/rtems/score/heap.inl, score/src/heapwalk.c: Do not
     4        inline code to check if newline should be printed. It leads to branch
     5        path explosion which is really hard to get coverage on.
     6
    172009-07-31      Joel Sherrill <joel.sherrill@OARcorp.com>
    28
  • cpukit/score/inline/rtems/score/heap.inl

    re89cf10 r894bbbc4  
    241241  _H_uptr_t v = *value;
    242242  uint32_t a = alignment;
    243   _H_uptr_t r = v % a;
    244   *value = r ? v - r + a : v;
     243
     244  if ( v % alignment )
     245    *value = v - r + a;
     246
     247/*
     248  else
     249    *value = v;
     250*/
     251
     252  /* *value = r ? v - r + a : v; */
    245253}
    246254
  • cpukit/score/src/heapwalk.c

    re89cf10 r894bbbc4  
    2222#include <rtems/score/interr.h>
    2323#include <rtems/bspIo.h>
     24
     25#if defined(__GNUC__)
     26  #define DO_NOT_INLINE __attribute__((__noinline__))
     27#else
     28  #define DO_NOT_INLINE
     29#endif
     30/*
     31 *  Helper to avoid introducing even more branches and paths in this
     32 *  code to do coverage analysis on.
     33 *
     34 *  We do not want this inlined.
     35 */
     36static void hw_nl(
     37  int    error,
     38  bool   do_dump
     39) DO_NOT_INLINE;
    2440
    2541/*PAGE
     
    114130      }
    115131      if (!prev_used) {
    116         if (do_dump || error) printk("\n");
     132       
     133        hw_nl(do_dump, error);
    117134        printk("PASS: %d !two consecutive blocks are free", source);
    118135        error = 1;
     
    142159        }
    143160        if (block != the_block) {
    144           if (do_dump || error) printk("\n");
     161          hw_nl(do_dump, error);
    145162          printk("PASS: %d !the_block not in the free list", source);
    146163          error = 1;
     
    149166
    150167    }
    151     if (do_dump || error) printk("\n");
     168    hw_nl(do_dump, error);
    152169
    153170    if (the_size < the_heap->min_block_size) {
     
    185202
    186203}
     204
     205/*
     206 *  This method exists to simplify branch paths in the generated code above.
     207 */
     208static void hw_nl(
     209  int            error,
     210  bool           do_dump
     211)
     212{
     213  if (do_dump || error) printk("\n");
     214}
Note: See TracChangeset for help on using the changeset viewer.