about summary refs log tree commit diff
path: root/malloc/malloc.c
diff options
context:
space:
mode:
authorOndřej Bílka <neleai@seznam.cz>2014-02-10 12:25:04 +0100
committerOndřej Bílka <neleai@seznam.cz>2014-02-10 12:25:04 +0100
commitbdfe308a166b433a841d5c9ae256560c18bce640 (patch)
treeaf44bb0ab52aee61a9f067f193817f1807d369c7 /malloc/malloc.c
parentd674667cbaa84ff4cf82cfedacad0665ae6cb440 (diff)
downloadglibc-bdfe308a166b433a841d5c9ae256560c18bce640.tar.gz
glibc-bdfe308a166b433a841d5c9ae256560c18bce640.tar.xz
glibc-bdfe308a166b433a841d5c9ae256560c18bce640.zip
Remove THREAD_STATS.
A THREAD_STATS macro duplicates gathering information that could be
obtained by systemtap probes instead.
Diffstat (limited to 'malloc/malloc.c')
-rw-r--r--malloc/malloc.c40
1 files changed, 0 insertions, 40 deletions
diff --git a/malloc/malloc.c b/malloc/malloc.c
index 813e94eea3..4f209995ad 100644
--- a/malloc/malloc.c
+++ b/malloc/malloc.c
@@ -1672,11 +1672,6 @@ struct malloc_state
   /* Flags (formerly in max_fast).  */
   int flags;
 
-#if THREAD_STATS
-  /* Statistics for locking.  Only used if THREAD_STATS is defined.  */
-  long stat_lock_direct, stat_lock_loop, stat_lock_wait;
-#endif
-
   /* Fastbins */
   mfastbinptr fastbinsY[NFASTBINS];
 
@@ -3010,17 +3005,7 @@ __libc_realloc (void *oldmem, size_t bytes)
     }
 
   ar_ptr = arena_for_chunk (oldp);
-#if THREAD_STATS
-  if (!mutex_trylock (&ar_ptr->mutex))
-    ++(ar_ptr->stat_lock_direct);
-  else
-    {
-      (void) mutex_lock (&ar_ptr->mutex);
-      ++(ar_ptr->stat_lock_wait);
-    }
-#else
   (void) mutex_lock (&ar_ptr->mutex);
-#endif
 
 
   newp = _int_realloc (ar_ptr, oldp, oldsize, nb);
@@ -3929,16 +3914,7 @@ _int_free (mstate av, mchunkptr p, int have_lock)
 
   else if (!chunk_is_mmapped(p)) {
     if (! have_lock) {
-#if THREAD_STATS
-      if(!mutex_trylock(&av->mutex))
-	++(av->stat_lock_direct);
-      else {
-	(void)mutex_lock(&av->mutex);
-	++(av->stat_lock_wait);
-      }
-#else
       (void)mutex_lock(&av->mutex);
-#endif
       locked = 1;
     }
 
@@ -4681,9 +4657,6 @@ __malloc_stats (void)
   int i;
   mstate ar_ptr;
   unsigned int in_use_b = mp_.mmapped_mem, system_b = in_use_b;
-#if THREAD_STATS
-  long stat_lock_direct = 0, stat_lock_loop = 0, stat_lock_wait = 0;
-#endif
 
   if (__malloc_initialized < 0)
     ptmalloc_init ();
@@ -4706,11 +4679,6 @@ __malloc_stats (void)
 #endif
       system_b += mi.arena;
       in_use_b += mi.uordblks;
-#if THREAD_STATS
-      stat_lock_direct += ar_ptr->stat_lock_direct;
-      stat_lock_loop += ar_ptr->stat_lock_loop;
-      stat_lock_wait += ar_ptr->stat_lock_wait;
-#endif
       (void) mutex_unlock (&ar_ptr->mutex);
       ar_ptr = ar_ptr->next;
       if (ar_ptr == &main_arena)
@@ -4722,14 +4690,6 @@ __malloc_stats (void)
   fprintf (stderr, "max mmap regions = %10u\n", (unsigned int) mp_.max_n_mmaps);
   fprintf (stderr, "max mmap bytes   = %10lu\n",
            (unsigned long) mp_.max_mmapped_mem);
-#if THREAD_STATS
-  fprintf (stderr, "heaps created    = %10d\n", stat_n_heaps);
-  fprintf (stderr, "locked directly  = %10ld\n", stat_lock_direct);
-  fprintf (stderr, "locked in loop   = %10ld\n", stat_lock_loop);
-  fprintf (stderr, "locked waiting   = %10ld\n", stat_lock_wait);
-  fprintf (stderr, "locked total     = %10ld\n",
-           stat_lock_direct + stat_lock_loop + stat_lock_wait);
-#endif
   ((_IO_FILE *) stderr)->_flags2 |= old_flags2;
   _IO_funlockfile (stderr);
 }