diff options
author | bart <bart@a5019735-40e9-0310-863c-91ae7b9d1cf9> | 2009-06-21 09:26:27 +0000 |
---|---|---|
committer | bart <bart@a5019735-40e9-0310-863c-91ae7b9d1cf9> | 2009-06-21 09:26:27 +0000 |
commit | 54803feb0b92e4708d3cee92e7449f802be70197 (patch) | |
tree | 21bf185df0f639399510d6df40f741352f451bdd | |
parent | 3358b9e72878d14d70bd45ae02ae426e6d3cb23c (diff) | |
download | valgrind-54803feb0b92e4708d3cee92e7449f802be70197.tar.gz |
Updated code for statistics printed by --drd-stats=yes.
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@10354 a5019735-40e9-0310-863c-91ae7b9d1cf9
-rw-r--r-- | drd/drd_main.c | 28 | ||||
-rw-r--r-- | drd/drd_thread.c | 21 | ||||
-rw-r--r-- | drd/drd_thread.h | 3 |
3 files changed, 22 insertions, 30 deletions
diff --git a/drd/drd_main.c b/drd/drd_main.c index e4c513de5..233c13954 100644 --- a/drd/drd_main.c +++ b/drd/drd_main.c @@ -575,35 +575,25 @@ static void DRD_(fini)(Int exitcode) // thread_print_all(); if (VG_(clo_verbosity) > 1 || DRD_(s_print_stats)) { - ULong update_conflict_set_count; - ULong dsnsc; - ULong dscvc; - - update_conflict_set_count - = DRD_(thread_get_update_conflict_set_count)(&dsnsc, &dscvc); - VG_(message)(Vg_UserMsg, - " thread: %lld context switches" - " / %lld updates of the conflict set", - DRD_(thread_get_context_switch_count)(), - update_conflict_set_count); + " thread: %lld context switches", + DRD_(thread_get_context_switch_count)()); VG_(message)(Vg_UserMsg, - " (%lld new sg + %lld combine vc + %lld csw).", - dsnsc, - dscvc, - update_conflict_set_count - dsnsc - dscvc); + "confl set: %lld full updates and %lld partial updates.", + DRD_(thread_get_compute_conflict_set_count)(), + DRD_(thread_get_update_conflict_set_count)()); VG_(message)(Vg_UserMsg, " segments: created %lld segments, max %lld alive," - " %lld discard points.", + " %lld discard points", DRD_(sg_get_segments_created_count)(), DRD_(sg_get_max_segments_alive_count)(), DRD_(thread_get_discard_ordered_segments_count)()); VG_(message)(Vg_UserMsg, - " %lld merges", + " and %lld merges.", DRD_(sg_get_segment_merge_count)()); VG_(message)(Vg_UserMsg, - " (%lld mutex, %lld rwlock, %lld semaphore," - " %lld barrier).", + "segmnt cr: %lld mutex, %lld rwlock, %lld semaphore and" + " %lld barrier.", DRD_(get_mutex_segment_creation_count)(), DRD_(get_rwlock_segment_creation_count)(), DRD_(get_semaphore_segment_creation_count)(), diff --git a/drd/drd_thread.c b/drd/drd_thread.c index 5fc12981d..ef52f5637 100644 --- a/drd/drd_thread.c +++ b/drd/drd_thread.c @@ -59,9 +59,8 @@ static Bool thread_conflict_set_up_to_date(const DrdThreadId tid); static ULong s_context_switch_count; static ULong s_discard_ordered_segments_count; +static ULong s_compute_conflict_set_count; static ULong s_update_conflict_set_count; -static ULong s_conflict_set_new_segment_count; -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 ThreadId s_vg_running_tid = VG_INVALID_THREADID; @@ -1263,7 +1262,7 @@ static void thread_compute_conflict_set(struct bitmap** conflict_set, && tid != DRD_INVALID_THREADID); tl_assert(tid == DRD_(g_drd_running_tid)); - s_update_conflict_set_count++; + s_compute_conflict_set_count++; s_conflict_set_bitmap_creation_count -= DRD_(bm_get_bitmap_creation_count)(); s_conflict_set_bitmap2_creation_count @@ -1452,7 +1451,7 @@ void DRD_(thread_update_conflict_set)(const DrdThreadId tid, DRD_(bm_remove_cleared_marked)(DRD_(g_conflict_set)); - s_conflict_set_combine_vc_count++; + s_update_conflict_set_count++; if (s_trace_conflict_set_bm) { @@ -1476,13 +1475,15 @@ ULong DRD_(thread_get_discard_ordered_segments_count)(void) return s_discard_ordered_segments_count; } -/** Return how many times the conflict set has been updated. */ -ULong DRD_(thread_get_update_conflict_set_count)(ULong* dsnsc, ULong* dscvc) +/** Return how many times the conflict set has been updated entirely. */ +ULong DRD_(thread_get_compute_conflict_set_count)() +{ + return s_compute_conflict_set_count; +} + +/** Return how many times the conflict set has been updated partially. */ +ULong DRD_(thread_get_update_conflict_set_count)(void) { - tl_assert(dsnsc); - tl_assert(dscvc); - *dsnsc = s_conflict_set_new_segment_count; - *dscvc = s_conflict_set_combine_vc_count; return s_update_conflict_set_count; } diff --git a/drd/drd_thread.h b/drd/drd_thread.h index d835564b7..49347ce24 100644 --- a/drd/drd_thread.h +++ b/drd/drd_thread.h @@ -175,7 +175,8 @@ void DRD_(thread_report_conflicting_segments)(const DrdThreadId tid, ULong DRD_(thread_get_context_switch_count)(void); ULong DRD_(thread_get_report_races_count)(void); ULong DRD_(thread_get_discard_ordered_segments_count)(void); -ULong DRD_(thread_get_update_conflict_set_count)(ULong* dsnsc, ULong* dscvc); +ULong DRD_(thread_get_compute_conflict_set_count)(void); +ULong DRD_(thread_get_update_conflict_set_count)(void); ULong DRD_(thread_get_conflict_set_bitmap_creation_count)(void); ULong DRD_(thread_get_conflict_set_bitmap2_creation_count)(void); |