Loading lib_debug/wmc_auto.c +16 −16 Original line number Diff line number Diff line Loading @@ -65,8 +65,8 @@ struct wmops_record #endif }; double ops_cnt; double prom_cnt; double ops_cnt_wmc; double prom_cnt_wmc; double inst_cnt[NUM_INST]; static struct wmops_record wmops[MAX_RECORDS]; Loading @@ -83,6 +83,7 @@ static long fnum_cnt_wc; static int *heap_allocation_call_tree = NULL, heap_allocation_call_tree_size = 0, heap_allocation_call_tree_max_size = 0; #if 0 /* -> declared in count.c instead */ void reset_wmops( void ) { Loading Loading @@ -126,10 +127,9 @@ void reset_wmops( void ) max_cnt = 0.0; min_cnt = DOUBLE_MAX; start_cnt = 0.0; ops_cnt = 0.0; ops_cnt_wmc = 0.0; } void push_wmops( const char *label ) { int new_flag; Loading Loading @@ -169,7 +169,7 @@ void push_wmops( const char *label ) stack[sptr++] = current_record; /* accumulate op counts */ wmops[current_record].current_selfcnt += ops_cnt - wmops[current_record].start_selfcnt; wmops[current_record].current_selfcnt += ops_cnt_wmc - wmops[current_record].start_selfcnt; /* update call tree */ for ( j = 0; j < MAX_RECORDS; j++ ) Loading @@ -188,8 +188,8 @@ void push_wmops( const char *label ) /* init current record */ current_record = i; wmops[current_record].start_selfcnt = ops_cnt; wmops[current_record].start_cnt = ops_cnt; wmops[current_record].start_selfcnt = ops_cnt_wmc; wmops[current_record].start_cnt = ops_cnt_wmc; wmops[current_record].call_number++; #ifdef WMOPS_WC_FRAME_ANALYSIS wmops[current_record].current_call_number++; Loading @@ -210,14 +210,14 @@ void pop_wmops( void ) } /* update count of current record */ wmops[current_record].current_selfcnt += ops_cnt - wmops[current_record].start_selfcnt; wmops[current_record].current_cnt += ops_cnt - wmops[current_record].start_cnt; wmops[current_record].current_selfcnt += ops_cnt_wmc - wmops[current_record].start_selfcnt; wmops[current_record].current_cnt += ops_cnt_wmc - wmops[current_record].start_cnt; /* Get back previous context from stack */ if ( sptr > 0 ) { current_record = stack[--sptr]; wmops[current_record].start_selfcnt = ops_cnt; wmops[current_record].start_selfcnt = ops_cnt_wmc; } else { Loading Loading @@ -263,7 +263,7 @@ void update_wmops( void ) #endif #ifdef WMOPS_WC_FRAME_ANALYSIS if ( ops_cnt - start_cnt > max_cnt ) if ( ops_cnt_wmc - start_cnt > max_cnt ) { for ( i = 0; i < num_records; i++ ) { Loading Loading @@ -315,7 +315,7 @@ void update_wmops( void ) #endif } current_cnt = ops_cnt - start_cnt; current_cnt = ops_cnt_wmc - start_cnt; if ( current_cnt > max_cnt ) { max_cnt = current_cnt; Loading @@ -338,7 +338,7 @@ void update_wmops( void ) inst_cnt[i] = 0.0; } start_cnt = ops_cnt; start_cnt = ops_cnt_wmc; /* increment frame counter */ update_cnt++; Loading Loading @@ -380,7 +380,7 @@ void print_wmops( void ) } fprintf( stdout, sfmts, "---------------", "------", "------", "------", "------" ); fprintf( stdout, dfmts, "total", (float) update_cnt, update_cnt == 0 ? 0 : FAC * min_cnt, FAC * max_cnt, update_cnt == 0 ? 0 : FAC * ops_cnt / update_cnt ); fprintf( stdout, dfmts, "total", (float) update_cnt, update_cnt == 0 ? 0 : FAC * min_cnt, FAC * max_cnt, update_cnt == 0 ? 0 : FAC * ops_cnt_wmc / update_cnt ); fprintf( stdout, "\n" ); #ifdef WMOPS_WC_FRAME_ANALYSIS Loading Loading @@ -499,7 +499,7 @@ void print_wmops( void ) return; } #endif /*-------------------------------------------------------------------* * Memory counting tool measuring RAM usage (stack and heap) Loading Loading @@ -1922,5 +1922,5 @@ void print_mem( ROM_Size_Lookup_Table Const_Data_PROM_Table[] ) #ifndef WMOPS_FLT int cntr_push_pop = 0; /* global counter for checking balanced push_wmops()/pop_wmops() pairs when WMOPS is not activated */ double ops_cnt; double ops_cnt_wmc; #endif lib_debug/wmc_auto.h +75 −73 File changed.Preview size limit exceeded, changes collapsed. Show changes Loading
lib_debug/wmc_auto.c +16 −16 Original line number Diff line number Diff line Loading @@ -65,8 +65,8 @@ struct wmops_record #endif }; double ops_cnt; double prom_cnt; double ops_cnt_wmc; double prom_cnt_wmc; double inst_cnt[NUM_INST]; static struct wmops_record wmops[MAX_RECORDS]; Loading @@ -83,6 +83,7 @@ static long fnum_cnt_wc; static int *heap_allocation_call_tree = NULL, heap_allocation_call_tree_size = 0, heap_allocation_call_tree_max_size = 0; #if 0 /* -> declared in count.c instead */ void reset_wmops( void ) { Loading Loading @@ -126,10 +127,9 @@ void reset_wmops( void ) max_cnt = 0.0; min_cnt = DOUBLE_MAX; start_cnt = 0.0; ops_cnt = 0.0; ops_cnt_wmc = 0.0; } void push_wmops( const char *label ) { int new_flag; Loading Loading @@ -169,7 +169,7 @@ void push_wmops( const char *label ) stack[sptr++] = current_record; /* accumulate op counts */ wmops[current_record].current_selfcnt += ops_cnt - wmops[current_record].start_selfcnt; wmops[current_record].current_selfcnt += ops_cnt_wmc - wmops[current_record].start_selfcnt; /* update call tree */ for ( j = 0; j < MAX_RECORDS; j++ ) Loading @@ -188,8 +188,8 @@ void push_wmops( const char *label ) /* init current record */ current_record = i; wmops[current_record].start_selfcnt = ops_cnt; wmops[current_record].start_cnt = ops_cnt; wmops[current_record].start_selfcnt = ops_cnt_wmc; wmops[current_record].start_cnt = ops_cnt_wmc; wmops[current_record].call_number++; #ifdef WMOPS_WC_FRAME_ANALYSIS wmops[current_record].current_call_number++; Loading @@ -210,14 +210,14 @@ void pop_wmops( void ) } /* update count of current record */ wmops[current_record].current_selfcnt += ops_cnt - wmops[current_record].start_selfcnt; wmops[current_record].current_cnt += ops_cnt - wmops[current_record].start_cnt; wmops[current_record].current_selfcnt += ops_cnt_wmc - wmops[current_record].start_selfcnt; wmops[current_record].current_cnt += ops_cnt_wmc - wmops[current_record].start_cnt; /* Get back previous context from stack */ if ( sptr > 0 ) { current_record = stack[--sptr]; wmops[current_record].start_selfcnt = ops_cnt; wmops[current_record].start_selfcnt = ops_cnt_wmc; } else { Loading Loading @@ -263,7 +263,7 @@ void update_wmops( void ) #endif #ifdef WMOPS_WC_FRAME_ANALYSIS if ( ops_cnt - start_cnt > max_cnt ) if ( ops_cnt_wmc - start_cnt > max_cnt ) { for ( i = 0; i < num_records; i++ ) { Loading Loading @@ -315,7 +315,7 @@ void update_wmops( void ) #endif } current_cnt = ops_cnt - start_cnt; current_cnt = ops_cnt_wmc - start_cnt; if ( current_cnt > max_cnt ) { max_cnt = current_cnt; Loading @@ -338,7 +338,7 @@ void update_wmops( void ) inst_cnt[i] = 0.0; } start_cnt = ops_cnt; start_cnt = ops_cnt_wmc; /* increment frame counter */ update_cnt++; Loading Loading @@ -380,7 +380,7 @@ void print_wmops( void ) } fprintf( stdout, sfmts, "---------------", "------", "------", "------", "------" ); fprintf( stdout, dfmts, "total", (float) update_cnt, update_cnt == 0 ? 0 : FAC * min_cnt, FAC * max_cnt, update_cnt == 0 ? 0 : FAC * ops_cnt / update_cnt ); fprintf( stdout, dfmts, "total", (float) update_cnt, update_cnt == 0 ? 0 : FAC * min_cnt, FAC * max_cnt, update_cnt == 0 ? 0 : FAC * ops_cnt_wmc / update_cnt ); fprintf( stdout, "\n" ); #ifdef WMOPS_WC_FRAME_ANALYSIS Loading Loading @@ -499,7 +499,7 @@ void print_wmops( void ) return; } #endif /*-------------------------------------------------------------------* * Memory counting tool measuring RAM usage (stack and heap) Loading Loading @@ -1922,5 +1922,5 @@ void print_mem( ROM_Size_Lookup_Table Const_Data_PROM_Table[] ) #ifndef WMOPS_FLT int cntr_push_pop = 0; /* global counter for checking balanced push_wmops()/pop_wmops() pairs when WMOPS is not activated */ double ops_cnt; double ops_cnt_wmc; #endif
lib_debug/wmc_auto.h +75 −73 File changed.Preview size limit exceeded, changes collapsed. Show changes