Ignore:
Timestamp:
Oct 22, 2008, 11:59:51 PM (17 years ago)
Author:
bird
Message:

kmk: CONFIG_WITH_MINIMAL_STATS vs. CONFIG_WITH_MAKE_STATS - require special builds for expensive statistics.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/kmk/variable.c

    r1914 r1915  
    3333#ifdef KMK
    3434# include "kbuild.h"
     35#endif
     36#ifdef CONFIG_WITH_STRCACHE2
     37# include <stddef.h>
    3538#endif
    3639
     
    229232    }
    230233  else
    231     assert (!v || (v->name == name && !HASH_VACANT (v)));
     234    {
     235      assert (!v || (v->name == name && !HASH_VACANT (v)));
     236      var_slot = 0;
     237    }
    232238#endif /* CONFIG_WITH_STRCACHE2 */
    233239  if (! HASH_VACANT (v))
     
    466472  hash_1 = strcache2_calc_ptr_hash (&variable_strcache, name);
    467473  ht = &setlist->set->table;
     474  MAKE_STATS (ht->ht_lookups++);
    468475  idx = hash_1 & (ht->ht_size - 1);
    469476  v = ht->ht_vec[idx];
     
    481488          idx &= (ht->ht_size - 1);
    482489          v = (struct variable *) ht->ht_vec[idx];
    483           ht->ht_collisions++; /* there are hardly any deletions, so don't bother with not counting deleted clashes. */
     490          MAKE_STATS (ht->ht_collisions++); /* there are hardly any deletions, so don't bother with not counting deleted clashes. */
    484491
    485492          if (v == 0)
     
    510517      /* first iteration unrolled */
    511518      ht = &setlist->set->table;
     519      MAKE_STATS (ht->ht_lookups++);
    512520      idx = hash_1 & (ht->ht_size - 1);
    513521      v = ht->ht_vec[idx];
     
    524532              idx &= (ht->ht_size - 1);
    525533              v = (struct variable *) ht->ht_vec[idx];
    526               ht->ht_collisions++; /* see reason above */
     534              MAKE_STATS (ht->ht_collisions++); /* see reason above */
    527535
    528536              if (v == 0)
     
    11581166  && defined (CONFIG_WITH_WHICH) \
    11591167  && defined (CONFIG_WITH_EVALPLUS) \
    1160   && defined (CONFIG_WITH_MAKE_STATS) \
     1168  && (defined (CONFIG_WITH_MAKE_STATS) || defined (CONFIG_WITH_MINIMAL_STATS)) \
    11611169  && defined (CONFIG_WITH_COMMANDS_FUNC) \
    11621170  && defined (KMK_HELPERS)
     
    12341242  strcat (buf, " evalctx evalval evalvalctx evalcall evalcall2");
    12351243#  endif
    1236 #  if defined (CONFIG_WITH_MAKE_STATS)
     1244#  if defined (CONFIG_WITH_MAKE_STATS) || defined (CONFIG_WITH_MINIMAL_STATS)
    12371245  strcat (buf, " make-stats");
    12381246#  endif
Note: See TracChangeset for help on using the changeset viewer.