]> git.ipfire.org Git - thirdparty/valgrind.git/commitdiff
Updated code for statistics printed by --drd-stats=yes.
authorBart Van Assche <bvanassche@acm.org>
Sun, 21 Jun 2009 09:26:27 +0000 (09:26 +0000)
committerBart Van Assche <bvanassche@acm.org>
Sun, 21 Jun 2009 09:26:27 +0000 (09:26 +0000)
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@10354

drd/drd_main.c
drd/drd_thread.c
drd/drd_thread.h

index e4c513de51843d56a3e7a13d20c2af052d917eae..233c139541e4bc8c508680f8965ea1fd4721b409 100644 (file)
@@ -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)(),
index 5fc12981d5cff307cad7582df6cd16e858b5eb0a..ef52f56378829f109db207de609ab8e3f93056ef 100644 (file)
@@ -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;
 }
 
index d835564b7e81e606b86ccca20e2b175bbb6273e5..49347ce249c6c88ee0c59f06d45eec3a9c873e8f 100644 (file)
@@ -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);