|
From: <sv...@va...> - 2008-08-01 06:53:32
|
Author: bart
Date: 2008-08-01 07:53:39 +0100 (Fri, 01 Aug 2008)
New Revision: 8490
Log:
Added more statistics.
Modified:
branches/DRDDEV/drd/drd_bitmap.c
branches/DRDDEV/drd/drd_main.c
branches/DRDDEV/drd/drd_segment.c
branches/DRDDEV/drd/drd_segment.h
branches/DRDDEV/drd/drd_thread.c
branches/DRDDEV/drd/drd_thread.h
branches/DRDDEV/drd/pub_drd_bitmap.h
Modified: branches/DRDDEV/drd/drd_bitmap.c
===================================================================
--- branches/DRDDEV/drd/drd_bitmap.c 2008-07-31 09:39:44 UTC (rev 8489)
+++ branches/DRDDEV/drd/drd_bitmap.c 2008-08-01 06:53:39 UTC (rev 8490)
@@ -44,6 +44,8 @@
/* Local constants. */
static ULong s_bitmap_creation_count;
+static ULong s_bitmap_merge_count;
+static ULong s_bitmap2_merge_count;
/* Function definitions. */
@@ -782,6 +784,8 @@
/* so complain if lhs == rhs. */
tl_assert(lhs != rhs);
+ s_bitmap_merge_count++;
+
VG_(OSetGen_ResetIter)(rhs->oset);
for ( ; (bm2r = VG_(OSetGen_Next)(rhs->oset)) != 0; )
@@ -923,11 +927,13 @@
return s_bitmap_creation_count;
}
-ULong bm_get_bitmap2_creation_count(void)
+ULong bm_get_bitmap_merge_count(void)
{
- return s_bitmap2_creation_count;
+ return s_bitmap_merge_count;
}
+
+
/** Clear the bitmap contents. */
void bm2_clear(struct bitmap2* const bm2)
{
@@ -944,6 +950,8 @@
tl_assert(bm2r);
tl_assert(bm2l->addr == bm2r->addr);
+ s_bitmap2_merge_count++;
+
for (k = 0; k < BITMAP1_UWORD_COUNT; k++)
{
bm2l->bm1.bm0_r[k] |= bm2r->bm1.bm0_r[k];
@@ -972,3 +980,13 @@
bm2l->bm1.bm0_w[k] ^= bm2r->bm1.bm0_w[k];
}
}
+
+ULong bm_get_bitmap2_creation_count(void)
+{
+ return s_bitmap2_creation_count;
+}
+
+ULong bm_get_bitmap2_merge_count(void)
+{
+ return s_bitmap2_merge_count;
+}
Modified: branches/DRDDEV/drd/drd_main.c
===================================================================
--- branches/DRDDEV/drd/drd_main.c 2008-07-31 09:39:44 UTC (rev 8489)
+++ branches/DRDDEV/drd/drd_main.c 2008-08-01 06:53:39 UTC (rev 8490)
@@ -1191,29 +1191,41 @@
thread_get_context_switch_count(),
update_conflict_set_count);
VG_(message)(Vg_UserMsg,
- " (%lld new sg + %lld combine vc + %lld csw).",
+ " (%lld new sg + %lld combine vc + %lld csw);",
dsnsc,
dscvc,
update_conflict_set_count - dsnsc - dscvc);
VG_(message)(Vg_UserMsg,
+ " %lld level 2 conflict sets have been computed.",
+ thread_get_compute_conflict_set_bitmap2_count());
+ VG_(message)(Vg_UserMsg,
" segments: created %lld segments, max %lld alive,"
- " %lld discard points.",
+ " %lld discard points,",
sg_get_created_segments_count(),
sg_get_max_alive_segments_count(),
thread_get_discard_ordered_segments_count());
VG_(message)(Vg_UserMsg,
+ " %lld merges.",
+ sg_get_segment_merge_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",
+ " bitmaps: %lld level 1 bitmaps were allocated;",
bm_get_bitmap_creation_count());
VG_(message)(Vg_UserMsg,
- " and %lld level 2 bitmaps were allocated.",
+ " %lld level 1 bitmap merges were carried out.",
+ bm_get_bitmap_merge_count());
+ VG_(message)(Vg_UserMsg,
+ " %lld level 2 bitmaps were allocated;",
bm_get_bitmap2_creation_count());
VG_(message)(Vg_UserMsg,
+ " %lld level 2 bitmap merges were carried out.",
+ bm_get_bitmap2_merge_count());
+ VG_(message)(Vg_UserMsg,
" mutex: %lld non-recursive lock/unlock events.",
get_mutex_lock_count());
drd_print_malloc_stats();
Modified: branches/DRDDEV/drd/drd_segment.c
===================================================================
--- branches/DRDDEV/drd/drd_segment.c 2008-07-31 09:39:44 UTC (rev 8489)
+++ branches/DRDDEV/drd/drd_segment.c 2008-08-01 06:53:39 UTC (rev 8490)
@@ -41,6 +41,7 @@
static ULong s_created_segments_count;
static ULong s_alive_segments_count;
static ULong s_max_alive_segments_count;
+static ULong s_segment_merge_count;
static Bool drd_trace_segment = False;
@@ -210,6 +211,8 @@
VG_(message)(Vg_UserMsg, "%s", msg);
}
+ s_segment_merge_count++;
+
// Keep sg1->stacktrace.
// Keep sg1->vc.
// Merge sg2->bm into sg1->bm.
@@ -250,3 +253,8 @@
{
return s_max_alive_segments_count;
}
+
+ULong sg_get_segment_merge_count(void)
+{
+ return s_segment_merge_count;
+}
Modified: branches/DRDDEV/drd/drd_segment.h
===================================================================
--- branches/DRDDEV/drd/drd_segment.h 2008-07-31 09:39:44 UTC (rev 8489)
+++ branches/DRDDEV/drd/drd_segment.h 2008-08-01 06:53:39 UTC (rev 8490)
@@ -60,6 +60,7 @@
ULong sg_get_created_segments_count(void);
ULong sg_get_alive_segments_count(void);
ULong sg_get_max_alive_segments_count(void);
+ULong sg_get_segment_merge_count(void);
#endif // __SEGMENT_H
Modified: branches/DRDDEV/drd/drd_thread.c
===================================================================
--- branches/DRDDEV/drd/drd_thread.c 2008-07-31 09:39:44 UTC (rev 8489)
+++ branches/DRDDEV/drd/drd_thread.c 2008-08-01 06:53:39 UTC (rev 8490)
@@ -58,6 +58,7 @@
static ULong s_conflict_set_combine_vc_count;
static ULong s_conflict_set_bitmap_creation_count;
static ULong s_conflict_set_bitmap2_creation_count;
+static ULong s_compute_conflict_set_bitmap2_count;
static ThreadId s_vg_running_tid = VG_INVALID_THREADID;
DrdThreadId s_drd_running_tid = DRD_INVALID_THREADID;
ThreadInfo s_threadinfo[DRD_N_THREADS];
@@ -843,6 +844,8 @@
thread_get_running_tid(), tid, a1);
}
+ s_compute_conflict_set_bitmap2_count++;
+
#if LAZY_CONFLICT_SET_EVALUATION == 1
s_conflict_set_bitmap2_creation_count -= bm_get_bitmap2_creation_count();
@@ -1063,3 +1066,8 @@
{
return s_conflict_set_bitmap2_creation_count;
}
+
+ULong thread_get_compute_conflict_set_bitmap2_count(void)
+{
+ return s_compute_conflict_set_bitmap2_count;
+}
Modified: branches/DRDDEV/drd/drd_thread.h
===================================================================
--- branches/DRDDEV/drd/drd_thread.h 2008-07-31 09:39:44 UTC (rev 8489)
+++ branches/DRDDEV/drd/drd_thread.h 2008-08-01 06:53:39 UTC (rev 8490)
@@ -141,6 +141,7 @@
ULong thread_get_update_conflict_set_count(ULong* dsnsc, ULong* dscvc);
ULong thread_get_conflict_set_bitmap_creation_count(void);
ULong thread_get_conflict_set_bitmap2_creation_count(void);
+ULong thread_get_compute_conflict_set_bitmap2_count(void);
static __inline__
Modified: branches/DRDDEV/drd/pub_drd_bitmap.h
===================================================================
--- branches/DRDDEV/drd/pub_drd_bitmap.h 2008-07-31 09:39:44 UTC (rev 8489)
+++ branches/DRDDEV/drd/pub_drd_bitmap.h 2008-08-01 06:53:39 UTC (rev 8490)
@@ -120,6 +120,7 @@
struct bitmap* const bm2);
void bm_print(struct bitmap* bm);
ULong bm_get_bitmap_creation_count(void);
+ULong bm_get_bitmap_merge_count(void);
/* Second-level bitmaps. */
void bm2_clear(struct bitmap2* const bm2);
@@ -127,6 +128,7 @@
void bm2_xor(struct bitmap2* const bm2l, const struct bitmap2* const bm2r);
void bm2_print(const struct bitmap2* const bm2);
ULong bm_get_bitmap2_creation_count(void);
+ULong bm_get_bitmap2_merge_count(void);
#endif /* __PUB_DRD_BITMAP_H */
|