Branch: Tag:

2011-04-02

2011-04-02 12:55:21 by Martin Stjernholm <mast@lysator.liu.se>

Disabled some of the less useful PROFILE_CHECK_THREADS stats.

1298: Inside #if defined(PROFILE_CHECK_THREADS)
  #ifdef PROFILE_CHECK_THREADS    static unsigned long calls = 0, yields = 0;    static unsigned long clock_checks = 0, no_clock_advs = 0; + #if 0    static unsigned long slice_int_n = 0; /* Slice interval length. */    static double slice_int_mean = 0.0, slice_int_m2 = 0.0;    static unsigned long tsc_int_n = 0; /* Actual tsc interval length. */    static double tsc_int_mean = 0.0, tsc_int_m2 = 0.0;    static unsigned long tsc_tgt_n = 0; /* Target tsc interval length. */    static double tsc_tgt_mean = 0.0, tsc_tgt_m2 = 0.0; -  + #endif    static unsigned long tps = 0, tps_int_n = 0; /* TSC intervals per slice. */    static double tps_int_mean = 0.0, tps_int_m2 = 0.0;    calls++;
1356: Inside #if defined(RDTSC) && defined(USE_CLOCK_FOR_SLICES)
   }      #ifdef PROFILE_CHECK_THREADS + #if 0    if (prev_tsc) {    double delta = tsc_elapsed - tsc_int_mean;    tsc_int_n++;    tsc_int_mean += delta / tsc_int_n;    tsc_int_m2 += delta * (tsc_elapsed - tsc_int_mean);    } -  + #endif    clock_checks++;    tps++;   #endif
1417: Inside #if defined(RDTSC) && defined(USE_CLOCK_FOR_SLICES)
   }    prev_tsc = tsc_now;    prev_clock = clock_now; + #if 0   #ifdef PROFILE_CHECK_THREADS    {    double delta = target_int - tsc_tgt_mean;
1425: Inside #if defined(RDTSC) && defined(USE_CLOCK_FOR_SLICES) and #if defined(PROFILE_CHECK_THREADS)
   tsc_tgt_m2 += delta * (target_int - tsc_tgt_mean);    }   #endif + #endif    }    else {    /* clock(3) can have pretty low resolution and might not
1572: Inside #if defined(PROFILE_CHECK_THREADS)
      yields++;    + #if 0   #ifdef USE_CLOCK_FOR_SLICES    if (thread_start_clock) {    double slice_time =
1582: Inside #if defined(PROFILE_CHECK_THREADS) and #if defined(USE_CLOCK_FOR_SLICES)
   slice_int_m2 += delta * (slice_time - slice_int_mean);    }   #endif + #endif       GETTIMEOFDAY (&now);    if (now.tv_sec > last_time) {    fprintf (stderr, "[%d:%f] check_threads: %lu calls, "    "%lu clocks, %lu no advs, %lu yields" -  + #if 0    ", slice %.3f:%.1e, tsc int %.2e:%.1e, tsc tgt %.2e:%.1e" -  + #endif    ", tps %g:%.1e\n",    getpid(), get_real_time() * (1.0 / CPU_TIME_TICKS),    calls, clock_checks, no_clock_advs, yields, -  + #if 0    slice_int_mean,    slice_int_n > 1 ? sqrt (slice_int_m2 / (slice_int_n - 1)) : 0.0,    tsc_int_mean,    tsc_int_n > 1 ? sqrt (tsc_int_m2 / (tsc_int_n - 1)) : 0.0,    tsc_tgt_mean,    tsc_tgt_n > 1 ? sqrt (tsc_tgt_m2 / (tsc_tgt_n - 1)) : 0.0, -  + #endif    tps_int_mean,    tps_int_n > 1 ? sqrt (tps_int_m2 / (tps_int_n - 1)) : 0.0);    last_time = (unsigned long) now.tv_sec;