]> git.ipfire.org Git - thirdparty/valgrind.git/commitdiff
Merge drd/ changes from branches/MESSAGING_TIDYUP r10464.
authorJulian Seward <jseward@acm.org>
Wed, 15 Jul 2009 14:49:17 +0000 (14:49 +0000)
committerJulian Seward <jseward@acm.org>
Wed, 15 Jul 2009 14:49:17 +0000 (14:49 +0000)
See trunk r10465 commit message for details.

git-svn-id: svn://svn.valgrind.org/valgrind/trunk@10466

12 files changed:
drd/drd_barrier.c
drd/drd_clientobj.c
drd/drd_cond.c
drd/drd_error.c
drd/drd_load_store.c
drd/drd_main.c
drd/drd_malloc_wrappers.c
drd/drd_mutex.c
drd/drd_rwlock.c
drd/drd_semaphore.c
drd/drd_suppression.c
drd/drd_thread.c

index 268dfadbeca5ba4c352e8badd98eaa79bbd64c88..fee28b5d9d61fe4d8f156c8df78decab757607fd 100644 (file)
@@ -257,7 +257,7 @@ void DRD_(barrier_init)(const Addr barrier,
       if (reinitialization)
       {
          VG_(message)(Vg_UserMsg,
-                      "[%d/%d] barrier_reinit    %s 0x%lx count %ld -> %ld",
+                      "[%d/%d] barrier_reinit    %s 0x%lx count %ld -> %ld\n",
                       VG_(get_running_tid)(),
                       DRD_(thread_get_running_tid)(),
                       barrier_get_typename(p),
@@ -268,7 +268,7 @@ void DRD_(barrier_init)(const Addr barrier,
       else
       {
          VG_(message)(Vg_UserMsg,
-                      "[%d/%d] barrier_init      %s 0x%lx",
+                      "[%d/%d] barrier_init      %s 0x%lx\n",
                       VG_(get_running_tid)(),
                       DRD_(thread_get_running_tid)(),
                       barrier_get_typename(p),
@@ -302,7 +302,7 @@ void DRD_(barrier_destroy)(const Addr barrier, const BarrierT barrier_type)
    if (s_trace_barrier)
    {
       VG_(message)(Vg_UserMsg,
-                   "[%d/%d] barrier_destroy   %s 0x%lx",
+                   "[%d/%d] barrier_destroy   %s 0x%lx\n",
                    VG_(get_running_tid)(),
                    DRD_(thread_get_running_tid)(),
                    barrier_get_typename(p),
@@ -349,20 +349,20 @@ void DRD_(barrier_pre_wait)(const DrdThreadId tid, const Addr barrier,
        * not. The only cause I know of that can trigger this is that libgomp.so
        * has been compiled with --enable-linux-futex.
        */
-      VG_(message)(Vg_UserMsg, "");
+      VG_(message)(Vg_UserMsg, "\n");
       VG_(message)(Vg_UserMsg,
                    "Please verify whether gcc has been configured"
-                   " with option --disable-linux-futex.");
+                   " with option --disable-linux-futex.\n");
       VG_(message)(Vg_UserMsg,
-                   "See also the section about OpenMP in the DRD manual.");
-      VG_(message)(Vg_UserMsg, "");
+                   "See also the section about OpenMP in the DRD manual.\n");
+      VG_(message)(Vg_UserMsg, "\n");
    }
    tl_assert(p);
 
    if (s_trace_barrier)
    {
       VG_(message)(Vg_UserMsg,
-                   "[%d/%d] barrier_pre_wait  %s 0x%lx iteration %ld",
+                   "[%d/%d] barrier_pre_wait  %s 0x%lx iteration %ld\n",
                    VG_(get_running_tid)(),
                    DRD_(thread_get_running_tid)(),
                    barrier_get_typename(p),
@@ -416,7 +416,7 @@ void DRD_(barrier_post_wait)(const DrdThreadId tid, const Addr barrier,
    if (s_trace_barrier)
    {
       VG_(message)(Vg_UserMsg,
-                   "[%d/%d] barrier_post_wait %s 0x%lx iteration %ld%s",
+                   "[%d/%d] barrier_post_wait %s 0x%lx iteration %ld%s\n",
                    VG_(get_running_tid)(),
                    tid,
                    p ? barrier_get_typename(p) : "(?)",
index 87565e4f7717cb1f3130c9aa85a20f35c896a6c5..d187547d9a39f918523dc2d21bf340bddaf7745a 100644 (file)
@@ -134,7 +134,7 @@ DrdClientobj* DRD_(clientobj_add)(const Addr a1, const ObjType t)
 
    if (s_trace_clientobj)
    {
-      VG_(message)(Vg_UserMsg, "Adding client object 0x%lx of type %d", a1, t);
+      VG_(message)(Vg_UserMsg, "Adding client object 0x%lx of type %d\n", a1, t);
    }
 
    p = VG_(OSetGen_AllocNode)(s_clientobj_set, sizeof(*p));
@@ -179,7 +179,7 @@ static Bool clientobj_remove_obj(DrdClientobj* const p)
 
    if (s_trace_clientobj)
    {
-      VG_(message)(Vg_UserMsg, "Removing client object 0x%lx of type %d",
+      VG_(message)(Vg_UserMsg, "Removing client object 0x%lx of type %d\n",
                    p->any.a1, p->any.type);
    }
 
index 9e4a16ea257579a1dc5648635d2f29b7d22f24b3..7d9eec5bee65645e5832d8c1685b91864c9204aa 100644 (file)
@@ -125,7 +125,7 @@ void DRD_(cond_pre_init)(const Addr cond)
    if (DRD_(s_trace_cond))
    {
       VG_(message)(Vg_UserMsg,
-                   "[%d/%d] cond_init       cond 0x%lx",
+                   "[%d/%d] cond_init       cond 0x%lx\n",
                    VG_(get_running_tid)(),
                    DRD_(thread_get_running_tid)(),
                    cond);
@@ -154,7 +154,7 @@ void DRD_(cond_post_destroy)(const Addr cond)
    if (DRD_(s_trace_cond))
    {
       VG_(message)(Vg_UserMsg,
-                   "[%d/%d] cond_destroy    cond 0x%lx",
+                   "[%d/%d] cond_destroy    cond 0x%lx\n",
                    VG_(get_running_tid)(),
                    DRD_(thread_get_running_tid)(),
                    cond);
@@ -197,7 +197,7 @@ int DRD_(cond_pre_wait)(const Addr cond, const Addr mutex)
    if (DRD_(s_trace_cond))
    {
       VG_(message)(Vg_UserMsg,
-                   "[%d/%d] cond_pre_wait   cond 0x%lx",
+                   "[%d/%d] cond_pre_wait   cond 0x%lx\n",
                    VG_(get_running_tid)(),
                    DRD_(thread_get_running_tid)(),
                    cond);
@@ -252,7 +252,7 @@ int DRD_(cond_post_wait)(const Addr cond)
    if (DRD_(s_trace_cond))
    {
       VG_(message)(Vg_UserMsg,
-                   "[%d/%d] cond_post_wait  cond 0x%lx",
+                   "[%d/%d] cond_post_wait  cond 0x%lx\n",
                    VG_(get_running_tid)(),
                    DRD_(thread_get_running_tid)(),
                    cond);
@@ -311,7 +311,7 @@ void DRD_(cond_pre_signal)(Addr const cond)
    if (DRD_(s_trace_cond))
    {
       VG_(message)(Vg_UserMsg,
-                   "[%d/%d] cond_signal     cond 0x%lx",
+                   "[%d/%d] cond_signal     cond 0x%lx\n",
                    VG_(get_running_tid)(),
                    DRD_(thread_get_running_tid)(),
                    cond);
@@ -326,7 +326,7 @@ void DRD_(cond_pre_broadcast)(Addr const cond)
    if (DRD_(s_trace_cond))
    {
       VG_(message)(Vg_UserMsg,
-                   "[%d/%d] cond_broadcast  cond 0x%lx",
+                   "[%d/%d] cond_broadcast  cond 0x%lx\n",
                    VG_(get_running_tid)(),
                    DRD_(thread_get_running_tid)(),
                    cond);
index 1928b6d71525884c684bd1bfa4aeea2db4ab3eca..ed93cbf3bf09673ea379e5d27b2641320a140e37 100644 (file)
@@ -85,7 +85,7 @@ static void first_observed(const Addr obj)
    {
       tl_assert(cl->any.first_observed_at);
       VG_(message)(Vg_UserMsg,
-                   "%s 0x%lx was first observed at:",
+                   "%s 0x%lx was first observed at:\n",
                    DRD_(clientobj_type_name)(cl->any.type),
                    obj);
       VG_(pp_ExeContext)(cl->any.first_observed_at);
@@ -96,9 +96,13 @@ static
 void drd_report_data_race(Error* const err, const DataRaceErrInfo* const dri)
 {
    AddrInfo ai;
-   const unsigned descr_size = 256;
-   Char* descr1 = VG_(malloc)("drd.error.drdr2.1", descr_size);
-   Char* descr2 = VG_(malloc)("drd.error.drdr2.2", descr_size);
+
+   XArray* /* of HChar */ descr1
+      = VG_(newXA)( VG_(malloc), "drd.error.drdr2.1",
+                    VG_(free), sizeof(HChar) );
+   XArray* /* of HChar */ descr2
+      = VG_(newXA)( VG_(malloc), "drd.error.drdr2.2",
+                    VG_(free), sizeof(HChar) );
 
    tl_assert(dri);
    tl_assert(dri->addr);
@@ -106,31 +110,50 @@ void drd_report_data_race(Error* const err, const DataRaceErrInfo* const dri)
    tl_assert(descr1);
    tl_assert(descr2);
 
-   descr1[0] = 0;
-   descr2[0] = 0;
-   VG_(get_data_description)(descr1, descr2, descr_size, dri->addr);
-   if (descr1[0] == 0)
+   (void) VG_(get_data_description)(descr1, descr2, dri->addr);
+   /* If there's nothing in descr1/2, free them.  Why is it safe to to
+      VG_(indexXA) at zero here?  Because VG_(get_data_description)
+      guarantees to zero terminate descr1/2 regardless of the outcome
+      of the call.  So there's always at least one element in each XA
+      after the call.
+   */
+   if (0 == VG_(strlen)( VG_(indexXA)( descr1, 0 ))) {
+      VG_(deleteXA)( descr1 );
+      descr1 = NULL;
+   }
+   if (0 == VG_(strlen)( VG_(indexXA)( descr2, 0 ))) {
+      VG_(deleteXA)( descr2 );
+      descr2 = NULL;
+   }
+   /* Assume (assert) that VG_(get_data_description) fills in descr1
+      before it fills in descr2 */
+   if (descr1 == NULL)
+      tl_assert(descr2 == NULL);
+   /* So anyway.  Do we have something useful? */
+   if (descr1 == NULL)
    {
+      /* No.  Do Plan B. */
       describe_malloced_addr(dri->addr, dri->size, &ai);
    }
    VG_(message)(Vg_UserMsg,
-                "Conflicting %s by thread %d/%d at 0x%08lx size %ld",
+                "Conflicting %s by thread %d/%d at 0x%08lx size %ld\n",
                 dri->access_type == eStore ? "store" : "load",
                 DRD_(DrdThreadIdToVgThreadId)(dri->tid),
                 dri->tid,
                 dri->addr,
                 dri->size);
    VG_(pp_ExeContext)(VG_(get_error_where)(err));
-   if (descr1[0])
+   if (descr1 != NULL)
    {
-      VG_(message)(Vg_UserMsg, "%s", descr1);
-      VG_(message)(Vg_UserMsg, "%s", descr2);
+      VG_(message)(Vg_UserMsg, "%s\n", (HChar*)VG_(indexXA)(descr1, 0));
+      if (descr2 != NULL)
+         VG_(message)(Vg_UserMsg, "%s\n", (HChar*)VG_(indexXA)(descr2, 0));
    }
    else if (ai.akind == eMallocd && ai.lastchange)
    {
       VG_(message)(Vg_UserMsg,
                    "Address 0x%lx is at offset %ld from 0x%lx."
-                   " Allocation context:",
+                   " Allocation context:\n",
                    dri->addr, ai.rwoffset, dri->addr - ai.rwoffset);
       VG_(pp_ExeContext)(ai.lastchange);
    }
@@ -144,13 +167,13 @@ void drd_report_data_race(Error* const err, const DataRaceErrInfo* const dri)
       if (sect_kind != Vg_SectUnknown)
       {
          VG_(message)(Vg_UserMsg,
-                      "Allocation context: %s section of %s",
+                      "Allocation context: %s section of %s\n",
                       VG_(pp_SectKind)(sect_kind),
                       sect_name);
       }
       else
       {
-         VG_(message)(Vg_UserMsg, "Allocation context: unknown.");
+         VG_(message)(Vg_UserMsg, "Allocation context: unknown.\n");
       }
    }
    if (s_show_conflicting_segments)
@@ -160,8 +183,10 @@ void drd_report_data_race(Error* const err, const DataRaceErrInfo* const dri)
                                                dri->access_type);
    }
 
-   VG_(free)(descr2);
-   VG_(free)(descr1);
+   if (descr2)
+      VG_(deleteXA)(descr2);
+   if (descr1)
+      VG_(deleteXA)(descr1);
 }
 
 static Bool drd_tool_error_eq(VgRes res, Error* e1, Error* e2)
@@ -169,6 +194,12 @@ static Bool drd_tool_error_eq(VgRes res, Error* e1, Error* e2)
    return False;
 }
 
+static void drd_tool_error_before_pp(Error* const e)
+{
+   /* No need to do anything; drd_tool_error_pp does all
+      the work. */
+}
+
 static void drd_tool_error_pp(Error* const e)
 {
    static DrdThreadId s_last_tid_printed = 1;
@@ -178,7 +209,7 @@ static void drd_tool_error_pp(Error* const e)
 
    if (err_extra && *err_extra != s_last_tid_printed)
    {
-      VG_UMSG("%s:", DRD_(thread_get_name)(*err_extra));
+      VG_(umsg)("%s:\n", DRD_(thread_get_name)(*err_extra));
       s_last_tid_printed = *err_extra;
    }
 
@@ -194,7 +225,7 @@ static void drd_tool_error_pp(Error* const e)
       if (p->recursion_count >= 0)
       {
          VG_(message)(Vg_UserMsg,
-                      "%s: mutex 0x%lx, recursion count %d, owner %d.",
+                      "%s: mutex 0x%lx, recursion count %d, owner %d.\n",
                       VG_(get_error_string)(e),
                       p->mutex,
                       p->recursion_count,
@@ -203,7 +234,7 @@ static void drd_tool_error_pp(Error* const e)
       else
       {
          VG_(message)(Vg_UserMsg,
-                      "The object at address 0x%lx is not a mutex.",
+                      "The object at address 0x%lx is not a mutex.\n",
                       p->mutex);
       }
       VG_(pp_ExeContext)(VG_(get_error_where)(e));
@@ -213,7 +244,7 @@ static void drd_tool_error_pp(Error* const e)
    case CondErr: {
       CondErrInfo* cdei =(CondErrInfo*)(VG_(get_error_extra)(e));
       VG_(message)(Vg_UserMsg,
-                   "%s: cond 0x%lx",
+                   "%s: cond 0x%lx\n",
                    VG_(get_error_string)(e),
                    cdei->cond);
       VG_(pp_ExeContext)(VG_(get_error_where)(e));
@@ -223,7 +254,7 @@ static void drd_tool_error_pp(Error* const e)
    case CondDestrErr: {
       CondDestrErrInfo* cdi = (CondDestrErrInfo*)(VG_(get_error_extra)(e));
       VG_(message)(Vg_UserMsg,
-                   "%s: cond 0x%lx, mutex 0x%lx locked by thread %d/%d",
+                   "%s: cond 0x%lx, mutex 0x%lx locked by thread %d/%d\n",
                    VG_(get_error_string)(e),
                    cdi->cond, cdi->mutex,
                    DRD_(DrdThreadIdToVgThreadId)(cdi->owner), cdi->owner);
@@ -236,7 +267,7 @@ static void drd_tool_error_pp(Error* const e)
       VG_(message)(Vg_UserMsg,
                    "Probably a race condition: condition variable 0x%lx has"
                    " been signaled but the associated mutex 0x%lx is not"
-                   " locked by the signalling thread.",
+                   " locked by the signalling thread.\n",
                    cei->cond, cei->mutex);
       VG_(pp_ExeContext)(VG_(get_error_where)(e));
       first_observed(cei->cond);
@@ -246,7 +277,7 @@ static void drd_tool_error_pp(Error* const e)
    case CondWaitErr: {
       CondWaitErrInfo* cwei = (CondWaitErrInfo*)(VG_(get_error_extra)(e));
       VG_(message)(Vg_UserMsg,
-                   "%s: condition variable 0x%lx, mutexes 0x%lx and 0x%lx",
+                   "%s: condition variable 0x%lx, mutexes 0x%lx and 0x%lx\n",
                    VG_(get_error_string)(e),
                    cwei->cond,
                    cwei->mutex1,
@@ -261,7 +292,7 @@ static void drd_tool_error_pp(Error* const e)
       SemaphoreErrInfo* sei = (SemaphoreErrInfo*)(VG_(get_error_extra)(e));
       tl_assert(sei);
       VG_(message)(Vg_UserMsg,
-                   "%s: semaphore 0x%lx",
+                   "%s: semaphore 0x%lx\n",
                    VG_(get_error_string)(e),
                    sei->semaphore);
       VG_(pp_ExeContext)(VG_(get_error_where)(e));
@@ -272,14 +303,14 @@ static void drd_tool_error_pp(Error* const e)
       BarrierErrInfo* bei = (BarrierErrInfo*)(VG_(get_error_extra)(e));
       tl_assert(bei);
       VG_(message)(Vg_UserMsg,
-                   "%s: barrier 0x%lx",
+                   "%s: barrier 0x%lx\n",
                    VG_(get_error_string)(e),
                    bei->barrier);
       VG_(pp_ExeContext)(VG_(get_error_where)(e));
       if (bei->other_context)
       {
          VG_(message)(Vg_UserMsg,
-                      "Conflicting wait call by thread %d/%d:",
+                      "Conflicting wait call by thread %d/%d:\n",
                       DRD_(DrdThreadIdToVgThreadId)(bei->other_tid),
                       bei->other_tid);
          VG_(pp_ExeContext)(bei->other_context);
@@ -291,7 +322,7 @@ static void drd_tool_error_pp(Error* const e)
       RwlockErrInfo* p = (RwlockErrInfo*)(VG_(get_error_extra)(e));
       tl_assert(p);
       VG_(message)(Vg_UserMsg,
-                   "%s: rwlock 0x%lx.",
+                   "%s: rwlock 0x%lx.\n",
                    VG_(get_error_string)(e),
                    p->rwlock);
       VG_(pp_ExeContext)(VG_(get_error_where)(e));
@@ -302,10 +333,10 @@ static void drd_tool_error_pp(Error* const e)
       HoldtimeErrInfo* p =(HoldtimeErrInfo*)(VG_(get_error_extra)(e));
       tl_assert(p);
       tl_assert(p->acquired_at);
-      VG_(message)(Vg_UserMsg, "Acquired at:");
+      VG_(message)(Vg_UserMsg, "Acquired at:\n");
       VG_(pp_ExeContext)(p->acquired_at);
       VG_(message)(Vg_UserMsg,
-                   "Lock on %s 0x%lx was held during %d ms (threshold: %d ms).",
+                   "Lock on %s 0x%lx was held during %d ms (threshold: %d ms).\n",
                    VG_(get_error_string)(e),
                    p->synchronization_object,
                    p->hold_time_ms,
@@ -316,13 +347,13 @@ static void drd_tool_error_pp(Error* const e)
    }
    case GenericErr: {
       //GenericErrInfo* gei =(GenericErrInfo*)(VG_(get_error_extra)(e));
-      VG_(message)(Vg_UserMsg, "%s", VG_(get_error_string)(e));
+      VG_(message)(Vg_UserMsg, "%s\n", VG_(get_error_string)(e));
       VG_(pp_ExeContext)(VG_(get_error_where)(e));
       break;
    }
    default:
       VG_(message)(Vg_UserMsg,
-                   "%s",
+                   "%s\n",
                    VG_(get_error_string)(e));
       VG_(pp_ExeContext)(VG_(get_error_where)(e));
       break;
@@ -436,6 +467,7 @@ void DRD_(register_error_handlers)(void)
 {
    // Tool error reporting.
    VG_(needs_tool_errors)(drd_tool_error_eq,
+                          drd_tool_error_before_pp,
                           drd_tool_error_pp,
                           False,
                           drd_tool_error_update_extra,
index e123b5c31fc4e4815696838c00b110aa8969e917..f13503fd1fabe1353347a90ead8ac98928fd918b 100644 (file)
@@ -90,7 +90,7 @@ void DRD_(trace_mem_access)(const Addr addr, const SizeT size,
 
       vc = DRD_(vc_aprint)(DRD_(thread_get_vc)(DRD_(thread_get_running_tid)()));
       VG_(message)(Vg_UserMsg,
-                   "%s 0x%lx size %ld (vg %d / drd %d / vc %s)",
+                   "%s 0x%lx size %ld (vg %d / drd %d / vc %s)\n",
                    access_type == eLoad
                    ? "load "
                    : access_type == eStore
index e5bc7384c2ee8434f875f9a878eaa2ac25123e5e..c1cadd9d2bece00606047c3ba4e95c43afc32d6f 100644 (file)
@@ -468,7 +468,7 @@ void drd_pre_thread_create(const ThreadId creator, const ThreadId created)
    if (DRD_(thread_get_trace_fork_join)())
    {
       VG_(message)(Vg_DebugMsg,
-                   "drd_pre_thread_create creator = %d/%d, created = %d",
+                   "drd_pre_thread_create creator = %d/%d, created = %d\n",
                    creator, drd_creator, created);
    }
 }
@@ -487,7 +487,7 @@ void drd_post_thread_create(const ThreadId vg_created)
    if (DRD_(thread_get_trace_fork_join)())
    {
       VG_(message)(Vg_DebugMsg,
-                   "drd_post_thread_create created = %d/%d",
+                   "drd_post_thread_create created = %d/%d\n",
                    vg_created, drd_created);
    }
    if (! DRD_(get_check_stack_accesses)())
@@ -510,7 +510,7 @@ static void drd_thread_finished(ThreadId vg_tid)
    if (DRD_(thread_get_trace_fork_join)())
    {
       VG_(message)(Vg_DebugMsg,
-                   "drd_thread_finished tid = %d/%d%s",
+                   "drd_thread_finished tid = %d/%d%s\n",
                    vg_tid,
                    drd_tid,
                    DRD_(thread_get_joinable)(drd_tid)
@@ -525,7 +525,7 @@ static void drd_thread_finished(ThreadId vg_tid)
             - DRD_(thread_get_stack_min_min)(drd_tid));
       VG_(message)(Vg_UserMsg,
                    "thread %d/%d%s finished and used %ld bytes out of %ld"
-                   " on its stack. Margin: %ld bytes.",
+                   " on its stack. Margin: %ld bytes.\n",
                    vg_tid,
                    drd_tid,
                    DRD_(thread_get_joinable)(drd_tid)
@@ -581,47 +581,47 @@ static void DRD_(fini)(Int exitcode)
       ULong pu_join   = DRD_(thread_get_update_conflict_set_join_count)();
 
       VG_(message)(Vg_UserMsg,
-                   "   thread: %lld context switches.",
+                   "   thread: %lld context switches.\n",
                    DRD_(thread_get_context_switch_count)());
       VG_(message)(Vg_UserMsg,
-                   "confl set: %lld full updates and %lld partial updates;",
+                   "confl set: %lld full updates and %lld partial updates;\n",
                   DRD_(thread_get_compute_conflict_set_count)(),
                   pu);
       VG_(message)(Vg_UserMsg,
-                   "           %lld partial updates during segment creation,",
+                   "           %lld partial updates during segment creation,\n",
                   pu_seg_cr);
       VG_(message)(Vg_UserMsg,
-                   "           %lld because of mutex/sema/cond.var. operations,",
+                   "           %lld because of mutex/sema/cond.var. operations,\n",
                   pu_mtx_cv);
       VG_(message)(Vg_UserMsg,
-                   "           %lld because of barrier/rwlock operations and",
+                   "           %lld because of barrier/rwlock operations and\n",
                   pu - pu_seg_cr - pu_mtx_cv - pu_join);
       VG_(message)(Vg_UserMsg,
                    "           %lld partial updates because of thread join"
-                  " operations.",
+                  " operations.\n",
                   pu_join);
       VG_(message)(Vg_UserMsg,
-                   " segments: created %lld segments, max %lld alive,",
+                   " segments: created %lld segments, max %lld alive,\n",
                    DRD_(sg_get_segments_created_count)(),
                    DRD_(sg_get_max_segments_alive_count)());
       VG_(message)(Vg_UserMsg,
-                   "           %lld discard points and %lld merges.",
+                   "           %lld discard points and %lld merges.\n",
                    DRD_(thread_get_discard_ordered_segments_count)(),
                    DRD_(sg_get_segment_merge_count)());
       VG_(message)(Vg_UserMsg,
                    "segmnt cr: %lld mutex, %lld rwlock, %lld semaphore and"
-                   " %lld barrier.",
+                   " %lld barrier.\n",
                    DRD_(get_mutex_segment_creation_count)(),
                    DRD_(get_rwlock_segment_creation_count)(),
                    DRD_(get_semaphore_segment_creation_count)(),
                    DRD_(get_barrier_segment_creation_count)());
       VG_(message)(Vg_UserMsg,
                    "  bitmaps: %lld level one"
-                   " and %lld level two bitmaps were allocated.",
+                   " and %lld level two bitmaps were allocated.\n",
                    DRD_(bm_get_bitmap_creation_count)(),
                    DRD_(bm_get_bitmap2_creation_count)());
       VG_(message)(Vg_UserMsg,
-                   "    mutex: %lld non-recursive lock/unlock events.",
+                   "    mutex: %lld non-recursive lock/unlock events.\n",
                    DRD_(get_mutex_lock_count)());
       DRD_(print_malloc_stats)();
    }
index 32fa1e69ded095f905baa9eca26c70f2a6f67420..3dcbb44db2a8ca82632fa10662f43d6c22ecff4c 100644 (file)
@@ -360,14 +360,14 @@ void DRD_(print_malloc_stats)(void)
    }
 
    VG_(message)(Vg_DebugMsg, 
-                "malloc/free: in use at exit: %lu bytes in %lu blocks.",
+                "malloc/free: in use at exit: %lu bytes in %lu blocks.\n",
                 nbytes, nblocks);
    VG_(message)(Vg_DebugMsg, 
-                "malloc/free: %lu allocs, %lu frees, %lu bytes allocated.",
+                "malloc/free: %lu allocs, %lu frees, %lu bytes allocated.\n",
                 s_cmalloc_n_mallocs,
                 s_cmalloc_n_frees, s_cmalloc_bs_mallocd);
    if (VG_(clo_verbosity) > 1)
-      VG_(message)(Vg_DebugMsg, " ");
+      VG_(message)(Vg_DebugMsg, " \n");
 }
 
 /*--------------------------------------------------------------------*/
index 536bf4675a8743c4de61844db14fa1e6ebafafb3..d12dd6551d7b16a9d4094692aca5c2dfb42cf487 100644 (file)
@@ -92,7 +92,7 @@ static void mutex_cleanup(struct mutex_info* p)
    if (s_trace_mutex)
    {
       VG_(message)(Vg_UserMsg,
-                   "[%d/%d] mutex_destroy   %s 0x%lx rc %d owner %d",
+                   "[%d/%d] mutex_destroy   %s 0x%lx rc %d owner %d\n",
                    VG_(get_running_tid)(),
                    DRD_(thread_get_running_tid)(),
                    DRD_(mutex_get_typename)(p),
@@ -171,7 +171,7 @@ DRD_(mutex_init)(const Addr mutex, const MutexT mutex_type)
    if (s_trace_mutex)
    {
       VG_(message)(Vg_UserMsg,
-                   "[%d/%d] mutex_init      %s 0x%lx",
+                   "[%d/%d] mutex_init      %s 0x%lx\n",
                    VG_(get_running_tid)(),
                    DRD_(thread_get_running_tid)(),
                    DRD_(mutex_type_name)(mutex_type),
@@ -235,7 +235,7 @@ void DRD_(mutex_pre_lock)(const Addr mutex, MutexT mutex_type,
    if (s_trace_mutex)
    {
       VG_(message)(Vg_UserMsg,
-                   "[%d/%d] %s %s 0x%lx rc %d owner %d",
+                   "[%d/%d] %s %s 0x%lx rc %d owner %d\n",
                    VG_(get_running_tid)(),
                    DRD_(thread_get_running_tid)(),
                    trylock ? "pre_mutex_lock " : "mutex_trylock  ",
@@ -290,7 +290,7 @@ void DRD_(mutex_post_lock)(const Addr mutex, const Bool took_lock,
    if (s_trace_mutex)
    {
       VG_(message)(Vg_UserMsg,
-                   "[%d/%d] %s %s 0x%lx rc %d owner %d%s",
+                   "[%d/%d] %s %s 0x%lx rc %d owner %d%s\n",
                    VG_(get_running_tid)(),
                    drd_tid,
                    post_cond_wait ? "cond_post_wait " : "post_mutex_lock",
@@ -328,7 +328,7 @@ void DRD_(mutex_post_lock)(const Addr mutex, const Bool took_lock,
       VG_(message)(Vg_UserMsg,
                    "The impossible happened: mutex 0x%lx is locked"
                    " simultaneously by two threads (recursion count %d,"
-                   " owners %d and %d) !",
+                   " owners %d and %d) !\n",
                    p->a1, p->recursion_count, p->owner, drd_tid);
       p->owner = drd_tid;
    }
@@ -359,7 +359,7 @@ void DRD_(mutex_unlock)(const Addr mutex, MutexT mutex_type)
    if (s_trace_mutex)
    {
       VG_(message)(Vg_UserMsg,
-                   "[%d/%d] mutex_unlock    %s 0x%lx rc %d",
+                   "[%d/%d] mutex_unlock    %s 0x%lx rc %d\n",
                    vg_tid,
                    drd_tid,
                    p ? DRD_(mutex_get_typename)(p) : "(?)",
@@ -388,7 +388,7 @@ void DRD_(mutex_unlock)(const Addr mutex, MutexT mutex_type)
    tl_assert(p);
    if (p->mutex_type != mutex_type)
    {
-      VG_(message)(Vg_UserMsg, "??? mutex 0x%lx: type changed from %d into %d",
+      VG_(message)(Vg_UserMsg, "??? mutex 0x%lx: type changed from %d into %d\n",
                    p->a1, p->mutex_type, mutex_type);
    }
    tl_assert(p->mutex_type == mutex_type);
index 4f29c84668e27d3e22a44a64d24632cf986e831b..ad4e1250bb93b682f25b68736dcdc1e84598c7e7 100644 (file)
@@ -211,7 +211,7 @@ static void rwlock_cleanup(struct rwlock_info* p)
    if (DRD_(s_trace_rwlock))
    {
       VG_(message)(Vg_UserMsg,
-                   "[%d/%d] rwlock_destroy     0x%lx",
+                   "[%d/%d] rwlock_destroy     0x%lx\n",
                    VG_(get_running_tid)(),
                    DRD_(thread_get_running_tid)(),
                    p->a1);
@@ -279,7 +279,7 @@ struct rwlock_info* DRD_(rwlock_pre_init)(const Addr rwlock,
    if (DRD_(s_trace_rwlock))
    {
       VG_(message)(Vg_UserMsg,
-                   "[%d/%d] rwlock_init        0x%lx",
+                   "[%d/%d] rwlock_init        0x%lx\n",
                    VG_(get_running_tid)(),
                    DRD_(thread_get_running_tid)(),
                    rwlock);
@@ -337,7 +337,7 @@ void DRD_(rwlock_pre_rdlock)(const Addr rwlock, const RwLockT rwlock_type)
    if (DRD_(s_trace_rwlock))
    {
       VG_(message)(Vg_UserMsg,
-                   "[%d/%d] pre_rwlock_rdlock  0x%lx",
+                   "[%d/%d] pre_rwlock_rdlock  0x%lx\n",
                    VG_(get_running_tid)(),
                    DRD_(thread_get_running_tid)(),
                    rwlock);
@@ -350,7 +350,7 @@ void DRD_(rwlock_pre_rdlock)(const Addr rwlock, const RwLockT rwlock_type)
    {
       VG_(message)(Vg_UserMsg,
                    "reader-writer lock 0x%lx is already locked for"
-                   " writing by calling thread",
+                   " writing by calling thread\n",
                    p->a1);
    }
 }
@@ -370,7 +370,7 @@ void DRD_(rwlock_post_rdlock)(const Addr rwlock, const RwLockT rwlock_type,
    if (DRD_(s_trace_rwlock))
    {
       VG_(message)(Vg_UserMsg,
-                   "[%d/%d] post_rwlock_rdlock 0x%lx",
+                   "[%d/%d] post_rwlock_rdlock 0x%lx\n",
                    VG_(get_running_tid)(),
                    drd_tid,
                    rwlock);
@@ -411,7 +411,7 @@ void DRD_(rwlock_pre_wrlock)(const Addr rwlock, const RwLockT rwlock_type)
    if (DRD_(s_trace_rwlock))
    {
       VG_(message)(Vg_UserMsg,
-                   "[%d/%d] pre_rwlock_wrlock  0x%lx",
+                   "[%d/%d] pre_rwlock_wrlock  0x%lx\n",
                    VG_(get_running_tid)(),
                    DRD_(thread_get_running_tid)(),
                    rwlock);
@@ -452,7 +452,7 @@ void DRD_(rwlock_post_wrlock)(const Addr rwlock, const RwLockT rwlock_type,
    if (DRD_(s_trace_rwlock))
    {
       VG_(message)(Vg_UserMsg,
-                   "[%d/%d] post_rwlock_wrlock 0x%lx",
+                   "[%d/%d] post_rwlock_wrlock 0x%lx\n",
                    VG_(get_running_tid)(),
                    drd_tid,
                    rwlock);
@@ -494,7 +494,7 @@ void DRD_(rwlock_pre_unlock)(const Addr rwlock, const RwLockT rwlock_type)
    if (DRD_(s_trace_rwlock))
    {
       VG_(message)(Vg_UserMsg,
-                   "[%d/%d] rwlock_unlock      0x%lx",
+                   "[%d/%d] rwlock_unlock      0x%lx\n",
                    vg_tid,
                    drd_tid,
                    rwlock);
index 4cbf56eecbcd258ed33b5a3e6e92c2076a95236e..b1dc9581042339f021a4a2c34f26eedf253c4f47 100644 (file)
@@ -177,7 +177,7 @@ struct semaphore_info* DRD_(semaphore_init)(const Addr semaphore,
    if (s_trace_semaphore)
    {
       VG_(message)(Vg_UserMsg,
-                   "[%d/%d] semaphore_init      0x%lx value %u",
+                   "[%d/%d] semaphore_init      0x%lx value %u\n",
                    VG_(get_running_tid)(),
                    DRD_(thread_get_running_tid)(),
                    semaphore,
@@ -219,7 +219,7 @@ void DRD_(semaphore_destroy)(const Addr semaphore)
    if (s_trace_semaphore)
    {
       VG_(message)(Vg_UserMsg,
-                   "[%d/%d] semaphore_destroy   0x%lx value %u",
+                   "[%d/%d] semaphore_destroy   0x%lx value %u\n",
                    VG_(get_running_tid)(),
                    DRD_(thread_get_running_tid)(),
                    semaphore,
@@ -275,7 +275,7 @@ void DRD_(semaphore_post_wait)(const DrdThreadId tid, const Addr semaphore,
    if (s_trace_semaphore)
    {
       VG_(message)(Vg_UserMsg,
-                   "[%d/%d] semaphore_wait      0x%lx value %u -> %u",
+                   "[%d/%d] semaphore_wait      0x%lx value %u -> %u\n",
                    VG_(get_running_tid)(),
                    DRD_(thread_get_running_tid)(),
                    semaphore,
@@ -340,7 +340,7 @@ void DRD_(semaphore_pre_post)(const DrdThreadId tid, const Addr semaphore)
    if (s_trace_semaphore)
    {
       VG_(message)(Vg_UserMsg,
-                   "[%d/%d] semaphore_post      0x%lx value %u -> %u",
+                   "[%d/%d] semaphore_post      0x%lx value %u -> %u\n",
                    VG_(get_running_tid)(),
                    DRD_(thread_get_running_tid)(),
                    semaphore,
index 8b7a55e8445b056e35011f65e02a3b5296b30870..da01f15996a56e4aa4e47dade043809d7dd2890a 100644 (file)
@@ -61,7 +61,7 @@ void DRD_(start_suppression)(const Addr a1, const Addr a2,
 {
    if (DRD_(s_trace_suppression))
    {
-      VG_(message)(Vg_DebugMsg, "start suppression of 0x%lx sz %ld (%s)",
+      VG_(message)(Vg_DebugMsg, "start suppression of 0x%lx sz %ld (%s)\n",
                    a1, a2 - a1, reason);
    }
 
@@ -74,7 +74,7 @@ void DRD_(finish_suppression)(const Addr a1, const Addr a2)
 {
    if (DRD_(s_trace_suppression))
    {
-      VG_(message)(Vg_DebugMsg, "finish suppression of 0x%lx sz %ld",
+      VG_(message)(Vg_DebugMsg, "finish suppression of 0x%lx sz %ld\n",
                    a1, a2 - a1);
       VG_(get_and_pp_StackTrace)(VG_(get_running_tid)(), 12);   
    }
@@ -82,7 +82,7 @@ void DRD_(finish_suppression)(const Addr a1, const Addr a2)
    tl_assert(a1 < a2);
    if (! DRD_(is_suppressed)(a1, a2))
    {
-      VG_(message)(Vg_DebugMsg, "?? [0x%lx,0x%lx[ not suppressed ??", a1, a2);
+      VG_(message)(Vg_DebugMsg, "?? [0x%lx,0x%lx[ not suppressed ??\n", a1, a2);
       VG_(get_and_pp_StackTrace)(VG_(get_running_tid)(), 12);
       tl_assert(False);
    }
@@ -148,7 +148,7 @@ void DRD_(suppression_stop_using_mem)(const Addr a1, const Addr a2)
          {
             VG_(message)(Vg_DebugMsg,
                          "stop_using_mem(0x%lx, %ld) finish suppression of"
-                         " 0x%lx", a1, a2 - a1, b);
+                         " 0x%lx\n", a1, a2 - a1, b);
          }
       }
    }
index 029d590ba573fb7f973aa9d2a69984a9053c1f23..6e765ce2e42e6840df49d60149086d083a4df5a5 100644 (file)
@@ -351,7 +351,7 @@ void DRD_(thread_post_join)(DrdThreadId drd_joiner, DrdThreadId drd_joinee)
                        ", new vc: %s", vc);
          VG_(free)(vc);
       }
-      VG_(message)(Vg_DebugMsg, "%s", msg);
+      VG_(message)(Vg_DebugMsg, "%s\n", msg);
       VG_(free)(msg);
    }
 
@@ -584,7 +584,7 @@ void DRD_(thread_set_running_tid)(const ThreadId vg_tid,
       {
          VG_(message)(Vg_DebugMsg,
                       "Context switch from thread %d/%d to thread %d/%d;"
-                      " segments: %llu",
+                      " segments: %llu\n",
                       s_vg_running_tid, DRD_(g_drd_running_tid),
                       DRD_(DrdThreadIdToVgThreadId)(drd_tid), drd_tid,
                       DRD_(sg_get_segments_alive_count)());
@@ -783,7 +783,7 @@ static void thread_discard_ordered_segments(void)
       vc_min = DRD_(vc_aprint)(&thread_vc_min);
       vc_max = DRD_(vc_aprint)(&thread_vc_max);
       VG_(message)(Vg_DebugMsg,
-                   "Discarding ordered segments -- min vc is %s, max vc is %s",
+                   "Discarding ordered segments -- min vc is %s, max vc is %s\n",
                    vc_min, vc_max);
       VG_(free)(vc_min);
       VG_(free)(vc_max);
@@ -973,7 +973,7 @@ void DRD_(thread_combine_vc_join)(DrdThreadId joiner, DrdThreadId joinee)
       char *str1, *str2;
       str1 = DRD_(vc_aprint)(&DRD_(g_threadinfo)[joiner].last->vc);
       str2 = DRD_(vc_aprint)(&DRD_(g_threadinfo)[joinee].last->vc);
-      VG_(message)(Vg_DebugMsg, "Before join: joiner %s, joinee %s",
+      VG_(message)(Vg_DebugMsg, "Before join: joiner %s, joinee %s\n",
                    str1, str2);
       VG_(free)(str1);
       VG_(free)(str2);
@@ -1001,7 +1001,7 @@ void DRD_(thread_combine_vc_join)(DrdThreadId joiner, DrdThreadId joinee)
    {
       char* str;
       str = DRD_(vc_aprint)(&DRD_(g_threadinfo)[joiner].last->vc);
-      VG_(message)(Vg_DebugMsg, "After join: %s", str);
+      VG_(message)(Vg_DebugMsg, "After join: %s\n", str);
       VG_(free)(str);
    }
 }
@@ -1031,7 +1031,7 @@ static void thread_combine_vc_sync(DrdThreadId tid, const Segment* sg)
          char *str1, *str2;
          str1 = DRD_(vc_aprint)(&old_vc);
          str2 = DRD_(vc_aprint)(&DRD_(g_threadinfo)[tid].last->vc);
-         VG_(message)(Vg_DebugMsg, "thread %d: vc %s -> %s", tid, str1, str2);
+         VG_(message)(Vg_DebugMsg, "thread %d: vc %s -> %s\n", tid, str1, str2);
          VG_(free)(str1);
          VG_(free)(str2);
       }
@@ -1174,7 +1174,7 @@ static void show_call_stack(const DrdThreadId tid,
 {
    const ThreadId vg_tid = DRD_(DrdThreadIdToVgThreadId)(tid);
 
-   VG_(message)(Vg_UserMsg, "%s (thread %d/%d)", msg, vg_tid, tid);
+   VG_(message)(Vg_UserMsg, "%s (thread %d/%d)\n", msg, vg_tid, tid);
 
    if (vg_tid != VG_INVALID_THREADID)
    {
@@ -1190,7 +1190,7 @@ static void show_call_stack(const DrdThreadId tid,
    else
    {
       VG_(message)(Vg_UserMsg,
-                   "   (thread finished, call stack no longer available)");
+                   "   (thread finished, call stack no longer available)\n");
    }
 }
 
@@ -1328,7 +1328,7 @@ static void thread_compute_conflict_set(struct bitmap** conflict_set,
 
       str = DRD_(vc_aprint)(&DRD_(g_threadinfo)[tid].last->vc);
       VG_(message)(Vg_DebugMsg,
-                   "computing conflict set for thread %d/%d with vc %s",
+                   "computing conflict set for thread %d/%d with vc %s\n",
                    DRD_(DrdThreadIdToVgThreadId)(tid), tid, str);
       VG_(free)(str);
    }
@@ -1342,7 +1342,7 @@ static void thread_compute_conflict_set(struct bitmap** conflict_set,
          char* vc;
 
          vc = DRD_(vc_aprint)(&p->vc);
-         VG_(message)(Vg_DebugMsg, "conflict set: thread [%d] at vc %s",
+         VG_(message)(Vg_DebugMsg, "conflict set: thread [%d] at vc %s\n",
                       tid, vc);
          VG_(free)(vc);
       }
@@ -1363,7 +1363,7 @@ static void thread_compute_conflict_set(struct bitmap** conflict_set,
 
                      str = DRD_(vc_aprint)(&q->vc);
                      VG_(message)(Vg_DebugMsg,
-                                  "conflict set: [%d] merging segment %s",
+                                  "conflict set: [%d] merging segment %s\n",
                                   j, str);
                      VG_(free)(str);
                   }
@@ -1377,7 +1377,7 @@ static void thread_compute_conflict_set(struct bitmap** conflict_set,
 
                      str = DRD_(vc_aprint)(&q->vc);
                      VG_(message)(Vg_DebugMsg,
-                                  "conflict set: [%d] ignoring segment %s",
+                                  "conflict set: [%d] ignoring segment %s\n",
                                   j, str);
                      VG_(free)(str);
                   }
@@ -1394,9 +1394,9 @@ static void thread_compute_conflict_set(struct bitmap** conflict_set,
 
    if (s_trace_conflict_set_bm)
    {
-      VG_(message)(Vg_DebugMsg, "[%d] new conflict set:", tid);
+      VG_(message)(Vg_DebugMsg, "[%d] new conflict set:\n", tid);
       DRD_(bm_print)(*conflict_set);
-      VG_(message)(Vg_DebugMsg, "[%d] end of new conflict set.", tid);
+      VG_(message)(Vg_DebugMsg, "[%d] end of new conflict set.\n", tid);
    }
 }
 
@@ -1424,7 +1424,7 @@ void DRD_(thread_update_conflict_set)(const DrdThreadId tid,
 
       str = DRD_(vc_aprint)(&DRD_(g_threadinfo)[tid].last->vc);
       VG_(message)(Vg_DebugMsg,
-                   "updating conflict set for thread %d/%d with vc %s",
+                   "updating conflict set for thread %d/%d with vc %s\n",
                    DRD_(DrdThreadIdToVgThreadId)(tid), tid, str);
       VG_(free)(str);
    }
@@ -1456,7 +1456,7 @@ void DRD_(thread_update_conflict_set)(const DrdThreadId tid,
 
                str = DRD_(vc_aprint)(&q->vc);
                VG_(message)(Vg_DebugMsg,
-                            "conflict set: [%d] merging segment %s", j, str);
+                            "conflict set: [%d] merging segment %s\n", j, str);
                VG_(free)(str);
             }
             DRD_(bm_mark)(DRD_(g_conflict_set), DRD_(sg_bm)(q));
@@ -1469,7 +1469,7 @@ void DRD_(thread_update_conflict_set)(const DrdThreadId tid,
 
                str = DRD_(vc_aprint)(&q->vc);
                VG_(message)(Vg_DebugMsg,
-                            "conflict set: [%d] ignoring segment %s", j, str);
+                            "conflict set: [%d] ignoring segment %s\n", j, str);
                VG_(free)(str);
             }
          }
@@ -1503,9 +1503,9 @@ void DRD_(thread_update_conflict_set)(const DrdThreadId tid,
 
    if (s_trace_conflict_set_bm)
    {
-      VG_(message)(Vg_DebugMsg, "[%d] updated conflict set:", tid);
+      VG_(message)(Vg_DebugMsg, "[%d] updated conflict set:\n", tid);
       DRD_(bm_print)(DRD_(g_conflict_set));
-      VG_(message)(Vg_DebugMsg, "[%d] end of updated conflict set.", tid);
+      VG_(message)(Vg_DebugMsg, "[%d] end of updated conflict set.\n", tid);
    }
 
    tl_assert(thread_conflict_set_up_to_date(DRD_(g_drd_running_tid)));