|
From: <sv...@va...> - 2009-05-03 17:07:42
|
Author: bart
Date: 2009-05-03 18:07:34 +0100 (Sun, 03 May 2009)
New Revision: 9727
Log:
Added more statistics.
Modified:
trunk/drd/drd_main.c
trunk/drd/drd_segment.c
trunk/drd/drd_segment.h
Modified: trunk/drd/drd_main.c
===================================================================
--- trunk/drd/drd_main.c 2009-05-03 17:04:43 UTC (rev 9726)
+++ trunk/drd/drd_main.c 2009-05-03 17:07:34 UTC (rev 9727)
@@ -55,6 +55,7 @@
/* Local variables. */
+static Bool DRD_(s_first_race_only) = False;
static Bool DRD_(s_print_stats) = False;
static Bool DRD_(s_var_info) = False;
static Bool DRD_(s_show_stack_usage) = False;
@@ -86,6 +87,7 @@
if VG_BOOL_CLO(arg, "--check-stack-var", check_stack_accesses) {}
else if VG_BOOL_CLO(arg, "--drd-stats", DRD_(s_print_stats)) {}
+ else if VG_BOOL_CLO(arg, "--first-race-only", DRD_(s_first_race_only)) {}
else if VG_BOOL_CLO(arg,"--report-signal-unlocked",report_signal_unlocked) {}
else if VG_BOOL_CLO(arg, "--segment-merging", segment_merging) {}
else if VG_BOOL_CLO(arg, "--show-confl-seg", show_confl_seg) {}
@@ -166,6 +168,8 @@
" stack variables [no].\n"
" --exclusive-threshold=<n> Print an error message if any mutex or\n"
" writer lock is held longer than the specified time (in milliseconds).\n"
+" --first-race-only=yes|no Only report the first data race that occurs on\n"
+" a memory location instead of all races [no].\n"
" --report-signal-unlocked=yes|no Whether to report calls to\n"
" pthread_cond_signal() where the mutex associated\n"
" with the signal via pthread_cond_wait() is not\n"
@@ -574,6 +578,9 @@
DRD_(sg_get_max_segments_alive_count)(),
DRD_(thread_get_discard_ordered_segments_count)());
VG_(message)(Vg_UserMsg,
+ " %lld merges.",
+ DRD_(sg_get_segment_merge_count)());
+ VG_(message)(Vg_UserMsg,
" (%lld m, %lld rw, %lld s, %lld b)",
DRD_(get_mutex_segment_creation_count)(),
DRD_(get_rwlock_segment_creation_count)(),
Modified: trunk/drd/drd_segment.c
===================================================================
--- trunk/drd/drd_segment.c 2009-05-03 17:04:43 UTC (rev 9726)
+++ trunk/drd/drd_segment.c 2009-05-03 17:07:34 UTC (rev 9727)
@@ -38,6 +38,7 @@
/* Local variables. */
+static ULong s_segment_merge_count;
static ULong s_segments_created_count;
static ULong s_segments_alive_count;
static ULong s_max_segments_alive_count;
@@ -215,6 +216,8 @@
VG_(message)(Vg_UserMsg, "%s", msg);
}
+ s_segment_merge_count++;
+
// Keep sg1->stacktrace.
// Keep sg1->vc.
// Merge sg2->bm into sg1->bm.
@@ -258,3 +261,8 @@
{
return s_max_segments_alive_count;
}
+
+ULong DRD_(sg_get_segment_merge_count)(void)
+{
+ return s_segment_merge_count;
+}
Modified: trunk/drd/drd_segment.h
===================================================================
--- trunk/drd/drd_segment.h 2009-05-03 17:04:43 UTC (rev 9726)
+++ trunk/drd/drd_segment.h 2009-05-03 17:07:34 UTC (rev 9727)
@@ -70,6 +70,7 @@
ULong DRD_(sg_get_segments_created_count)(void);
ULong DRD_(sg_get_segments_alive_count)(void);
ULong DRD_(sg_get_max_segments_alive_count)(void);
+ULong DRD_(sg_get_segment_merge_count)(void);
#endif // __SEGMENT_H
|