|
From: <sv...@va...> - 2008-04-19 15:17:01
|
Author: bart
Date: 2008-04-19 16:16:45 +0100 (Sat, 19 Apr 2008)
New Revision: 7891
Log:
Added more detailed statistics about thread_new_segment() calls.
Modified:
trunk/exp-drd/drd_barrier.c
trunk/exp-drd/drd_barrier.h
trunk/exp-drd/drd_main.c
trunk/exp-drd/drd_mutex.c
trunk/exp-drd/drd_mutex.h
trunk/exp-drd/drd_rwlock.c
trunk/exp-drd/drd_rwlock.h
trunk/exp-drd/drd_semaphore.c
trunk/exp-drd/drd_semaphore.h
Modified: trunk/exp-drd/drd_barrier.c
===================================================================
--- trunk/exp-drd/drd_barrier.c 2008-04-19 15:15:12 UTC (rev 7890)
+++ trunk/exp-drd/drd_barrier.c 2008-04-19 15:16:45 UTC (rev 7891)
@@ -60,6 +60,7 @@
// Local variables.
static Bool s_trace_barrier = False;
+static ULong s_barrier_segment_creation_count;
// Function definitions.
@@ -343,6 +344,7 @@
}
thread_new_segment(tid);
+ s_barrier_segment_creation_count++;
if (--p->post_waiters_left <= 0)
{
@@ -386,3 +388,8 @@
}
return "?";
}
+
+ULong get_barrier_segment_creation_count(void)
+{
+ return s_barrier_segment_creation_count;
+}
Modified: trunk/exp-drd/drd_barrier.h
===================================================================
--- trunk/exp-drd/drd_barrier.h 2008-04-19 15:15:12 UTC (rev 7890)
+++ trunk/exp-drd/drd_barrier.h 2008-04-19 15:16:45 UTC (rev 7891)
@@ -50,6 +50,7 @@
const BarrierT barrier_type, const Bool waited);
void barrier_thread_delete(const DrdThreadId threadid);
void barrier_stop_using_mem(const Addr a1, const Addr a2);
+ULong get_barrier_segment_creation_count(void);
#endif /* __DRD_BARRIER_H */
Modified: trunk/exp-drd/drd_main.c
===================================================================
--- trunk/exp-drd/drd_main.c 2008-04-19 15:15:12 UTC (rev 7890)
+++ trunk/exp-drd/drd_main.c 2008-04-19 15:16:45 UTC (rev 7891)
@@ -50,7 +50,6 @@
#include "pub_tool_mallocfree.h" // VG_(malloc)(), VG_(free)()
#include "pub_tool_options.h" // command line options
#include "pub_tool_replacemalloc.h"
-#include "pub_tool_replacemalloc.h"
#include "pub_tool_threadstate.h" // VG_(get_running_tid)()
#include "pub_tool_tooliface.h"
@@ -1079,6 +1078,12 @@
sg_get_max_alive_segments_count(),
thread_get_discard_ordered_segments_count());
VG_(message)(Vg_UserMsg,
+ " (%lld m, %lld rw, %lld s, %lld b)",
+ get_mutex_segment_creation_count(),
+ get_rwlock_segment_creation_count(),
+ get_semaphore_segment_creation_count(),
+ get_barrier_segment_creation_count());
+ VG_(message)(Vg_UserMsg,
" bitmaps: %lld level 1 / %lld level 2 bitmap refs",
bm_get_bitmap_creation_count(),
bm_get_bitmap2_node_creation_count());
Modified: trunk/exp-drd/drd_mutex.c
===================================================================
--- trunk/exp-drd/drd_mutex.c 2008-04-19 15:15:12 UTC (rev 7890)
+++ trunk/exp-drd/drd_mutex.c 2008-04-19 15:16:45 UTC (rev 7891)
@@ -45,6 +45,7 @@
static Bool s_trace_mutex;
static ULong s_mutex_lock_count;
+static ULong s_mutex_segment_creation_count;
// Function definitions.
@@ -284,6 +285,7 @@
thread_combine_vc2(drd_tid, &p->last_locked_segment->vc);
}
thread_new_segment(drd_tid);
+ s_mutex_segment_creation_count++;
p->owner = drd_tid;
s_mutex_lock_count++;
@@ -374,6 +376,7 @@
thread_get_latest_segment(&p->last_locked_segment, drd_tid);
thread_new_segment(drd_tid);
+ s_mutex_segment_creation_count++;
}
}
@@ -457,3 +460,8 @@
{
return s_mutex_lock_count;
}
+
+ULong get_mutex_segment_creation_count(void)
+{
+ return s_mutex_segment_creation_count;
+}
Modified: trunk/exp-drd/drd_mutex.h
===================================================================
--- trunk/exp-drd/drd_mutex.h 2008-04-19 15:15:12 UTC (rev 7890)
+++ trunk/exp-drd/drd_mutex.h 2008-04-19 15:16:45 UTC (rev 7891)
@@ -55,6 +55,7 @@
int mutex_get_recursion_count(const Addr mutex);
void mutex_thread_delete(const DrdThreadId tid);
ULong get_mutex_lock_count(void);
+ULong get_mutex_segment_creation_count(void);
#endif /* __DRD_MUTEX_H */
Modified: trunk/exp-drd/drd_rwlock.c
===================================================================
--- trunk/exp-drd/drd_rwlock.c 2008-04-19 15:15:12 UTC (rev 7890)
+++ trunk/exp-drd/drd_rwlock.c 2008-04-19 15:16:45 UTC (rev 7891)
@@ -50,6 +50,7 @@
// Local functions.
static void rwlock_cleanup(struct rwlock_info* p);
+static ULong s_rwlock_segment_creation_count;
// Local variables.
@@ -350,6 +351,7 @@
{
rwlock_combine_other_vc(p, drd_tid, False);
thread_new_segment(drd_tid);
+ s_rwlock_segment_creation_count++;
}
}
@@ -423,6 +425,7 @@
tl_assert(q->writer_nesting_count == 1);
rwlock_combine_other_vc(p, drd_tid, True);
thread_new_segment(drd_tid);
+ s_rwlock_segment_creation_count++;
}
/**
@@ -479,6 +482,7 @@
thread_get_latest_segment(&q->last_unlock_segment, drd_tid);
q->last_lock_was_writer_lock = False;
thread_new_segment(drd_tid);
+ s_rwlock_segment_creation_count++;
}
}
@@ -508,3 +512,8 @@
}
}
}
+
+ULong get_rwlock_segment_creation_count(void)
+{
+ return s_rwlock_segment_creation_count;
+}
Modified: trunk/exp-drd/drd_rwlock.h
===================================================================
--- trunk/exp-drd/drd_rwlock.h 2008-04-19 15:15:12 UTC (rev 7890)
+++ trunk/exp-drd/drd_rwlock.h 2008-04-19 15:16:45 UTC (rev 7891)
@@ -48,6 +48,7 @@
void rwlock_post_wrlock(const Addr rwlock, const Bool took_lock);
void rwlock_pre_unlock(const Addr rwlock);
void rwlock_thread_delete(const DrdThreadId tid);
+ULong get_rwlock_segment_creation_count(void);
#endif /* __DRD_RWLOCK_H */
Modified: trunk/exp-drd/drd_semaphore.c
===================================================================
--- trunk/exp-drd/drd_semaphore.c 2008-04-19 15:15:12 UTC (rev 7890)
+++ trunk/exp-drd/drd_semaphore.c 2008-04-19 15:16:45 UTC (rev 7891)
@@ -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;
+}
Modified: trunk/exp-drd/drd_semaphore.h
===================================================================
--- trunk/exp-drd/drd_semaphore.h 2008-04-19 15:15:12 UTC (rev 7890)
+++ trunk/exp-drd/drd_semaphore.h 2008-04-19 15:16:45 UTC (rev 7891)
@@ -49,6 +49,7 @@
void semaphore_post_post(const DrdThreadId tid, const Addr semaphore,
const Bool waited);
void semaphore_thread_delete(const DrdThreadId tid);
+ULong get_semaphore_segment_creation_count(void);
#endif /* __DRD_SEMAPHORE_H */
|