Changeset 552 for trunk/lib/perflib


Ignore:
Timestamp:
Jul 29, 2010, 4:49:46 PM (9 years ago)
Author:
lindanl
Message:

changes for performance script

File:
1 edited

Legend:

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

    r517 r552  
    101101  int i, BOM, b;
    102102  int this_count;
     103  int total_count = 0;
    103104  int cum_count = 0;
    104105  unsigned int entry = 0;
     
    150151        }
    151152  }
    152  
    153   printf("Binary Order of Magnitude Profile\n");
     153#ifdef PERF_SCRIPT 
     154  for (b = 0; b < BIT_COUNT; b++) {
     155    total_count += BOM_count[b];
     156  }
     157#endif 
     158//   printf("Binary Order of Magnitude Profile\n");
    154159  for (b = 0; b < BIT_COUNT; b++) {
    155160    this_count = BOM_count[b];
     
    163168    if (cum_count == 0) cum_avg = 0ULL;
    164169    else cum_avg = (TIMER_SCALE_FACTOR*cum_time)/(cum_elems);
     170
     171#ifndef PERF_SCRIPT
    165172    if (this_count > 0) {  // Only report intervals with nonzero counts.
    166173      printf("BOM %i: %i ", b, this_count);
     
    169176      printf("(avg: %i %s/kElem)\n", (int) cum_avg, cycle_counter_units);
    170177    }
     178#endif
     179#ifdef PERF_SCRIPT
     180    if (cum_count>total_count*0.9){
     181      fprintf(stderr,"%i ",cum_avg);
     182      break;
     183    }
     184#endif
    171185  }           
    172186}
Note: See TracChangeset for help on using the changeset viewer.