Added more detailed statistics about thread_new_segment() calls.

git-svn-id: svn://svn.valgrind.org/valgrind/trunk@7891 a5019735-40e9-0310-863c-91ae7b9d1cf9
diff --git a/exp-drd/drd_semaphore.c b/exp-drd/drd_semaphore.c
index dc5c9f5..38d3b9a 100644
--- a/exp-drd/drd_semaphore.c
+++ b/exp-drd/drd_semaphore.c
@@ -43,6 +43,7 @@
 // Local variables.
 
 static Bool s_trace_semaphore;
+static ULong s_semaphore_segment_creation_count;
 
 
 // Function definitions.
@@ -222,6 +223,7 @@
     thread_combine_vc2(tid, &p->last_sem_post_segment->vc);
   }
   thread_new_segment(tid);
+  s_semaphore_segment_creation_count++;
 }
 
 /** Called before sem_post(). */
@@ -244,6 +246,7 @@
     p->last_sem_post_tid = tid;
     thread_new_segment(tid);
     thread_get_latest_segment(&p->last_sem_post_segment, tid);
+    s_semaphore_segment_creation_count++;
   }
 }
 
@@ -264,3 +267,8 @@
 
 void semaphore_thread_delete(const DrdThreadId threadid)
 { }
+
+ULong get_semaphore_segment_creation_count(void)
+{
+  return s_semaphore_segment_creation_count;
+}