Changeset 478 for trunk/lib


Ignore:
Timestamp:
Jul 13, 2010, 2:07:50 PM (9 years ago)
Author:
ksherdy
Message:

Add code clocker support to perfsec.h.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/lib/perflib/perfsec.h

    r462 r478  
    22#include "BOM_Profiler.h"
    33
    4 #ifdef BUFFER_PROFILING
    5 #define PERF_SEC_INIT(timer) \
    6 timer = init_BOM_timer()
    7 
    8 #define PERF_SEC_START(timer) \
    9 start_BOM_interval(timer)
    10 
    11 #define PERF_SEC_END(timer,elems) \
    12 end_BOM_interval(timer,elems)
    13 
    14 #define PERF_SEC_DUMP(timer) \
    15   dump_BOM_table(timer)
    16 
    17 #else
    18 #define PERF_SEC_INIT(timer)
    19 #define PERF_SEC_START(timer)
    20 #define PERF_SEC_END(timer,elems)
    21 #define PERF_SEC_DUMP(timer)
     4#if defined(CODE_CLOCKER)
     5        #include "cc.h"
     6        #include "cc.cxx"       
    227#endif
    238
     9#if defined(BUFFER_PROFILING)
     10
     11        #define PERF_SEC_INIT(timer) \
     12                timer = init_BOM_timer()
     13       
     14        #define PERF_SEC_START(timer) \
     15                start_BOM_interval(timer)
     16       
     17        #define PERF_SEC_END(timer,elems) \
     18                end_BOM_interval(timer,elems)
     19       
     20        #define PERF_SEC_DUMP(timer) \
     21                dump_BOM_table(timer)
     22       
     23        #define PERF_SEC_DESTROY(timer) \
     24                destroy_BOM_timer(timer)       
     25       
     26#elif defined(CODE_CLOCKER)
     27
     28        #define PERF_SEC_INIT(timer)
     29               
     30        #define PERF_SEC_START(timer) \
     31                timer->start_interval()
     32
     33        #define PERF_SEC_END(timer,elems) \
     34                timer->end_interval(elems)
     35       
     36        #define PERF_SEC_DUMP(timer) \
     37                timer->dump_avg_kelem() \
     38               
     39        #define PERF_SEC_DESTROY(timer) \
     40                if(timer) delete timer
     41               
     42#else
     43
     44        #define PERF_SEC_INIT(timer)
     45        #define PERF_SEC_START(timer)
     46        #define PERF_SEC_END(timer,elems)
     47        #define PERF_SEC_DUMP(timer)
     48        #define PERF_SEC_DESTROY(timer)
     49
     50#endif
     51
Note: See TracChangeset for help on using the changeset viewer.