]> git.ipfire.org Git - thirdparty/valgrind.git/commitdiff
Modified mutex and condtion variable tracing output slightly.
authorBart Van Assche <bvanassche@acm.org>
Sun, 30 Mar 2008 13:28:33 +0000 (13:28 +0000)
committerBart Van Assche <bvanassche@acm.org>
Sun, 30 Mar 2008 13:28:33 +0000 (13:28 +0000)
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@7821

exp-drd/drd_clientreq.c
exp-drd/drd_cond.c
exp-drd/drd_main.c
exp-drd/drd_mutex.c
exp-drd/drd_mutex.h
exp-drd/drd_semaphore.c
exp-drd/tests/tc20_verifywrap2.stderr.exp
exp-drd/tests/tc20_verifywrap2.stderr.exp-glibc2.3
exp-drd/tests/tc20_verifywrap2.stderr.exp-glibc2.3-b

index 84ce5a020d44a05b62122925de912034b68856d0..839b3f7efac015a2c0634f432a0ec6526dbbbd90 100644 (file)
@@ -66,7 +66,7 @@ static void drd_post_cond_wait(const Addr cond,
                                const Bool took_lock)
 {
   cond_post_wait(cond);
-  mutex_post_lock(mutex, took_lock);
+  mutex_post_lock(mutex, took_lock, True);
 }
 
 static void drd_pre_cond_signal(const Addr cond)
index 9d85676a7d8083672aa386a28b30849622a374d9..11e962fab5e877a1042ba180d7be51906f850080 100644 (file)
@@ -116,7 +116,7 @@ void cond_pre_init(const Addr cond)
   if (s_trace_cond)
   {
     VG_(message)(Vg_UserMsg,
-                 "[%d/%d] cond_init 0x%lx",
+                 "[%d/%d] cond_init       cond 0x%lx",
                  VG_(get_running_tid)(),
                  thread_get_running_tid(),
                  cond);
@@ -145,7 +145,7 @@ void cond_post_destroy(const Addr cond)
   if (s_trace_cond)
   {
     VG_(message)(Vg_UserMsg,
-                 "[%d/%d] cond_destroy 0x%lx",
+                 "[%d/%d] cond_destroy    cond 0x%lx",
                  VG_(get_running_tid)(),
                  thread_get_running_tid(),
                  cond);
@@ -185,7 +185,7 @@ int cond_pre_wait(const Addr cond, const Addr mutex)
   if (s_trace_cond)
   {
     VG_(message)(Vg_UserMsg,
-                 "[%d/%d] cond_pre_wait 0x%lx",
+                 "[%d/%d] cond_pre_wait   cond 0x%lx",
                  VG_(get_running_tid)(),
                  thread_get_running_tid(),
                  cond);
@@ -216,7 +216,7 @@ int cond_post_wait(const Addr cond)
   if (s_trace_cond)
   {
     VG_(message)(Vg_UserMsg,
-                 "[%d/%d] cond_post_wait 0x%lx",
+                 "[%d/%d] cond_post_wait  cond 0x%lx",
                  VG_(get_running_tid)(),
                  thread_get_running_tid(),
                  cond);
@@ -272,7 +272,7 @@ void cond_pre_signal(Addr const cond)
   if (s_trace_cond)
   {
     VG_(message)(Vg_UserMsg,
-                 "[%d/%d] cond_signal 0x%lx",
+                 "[%d/%d] cond_signal     cond 0x%lx",
                  VG_(get_running_tid)(),
                  thread_get_running_tid(),
                  cond);
@@ -287,7 +287,7 @@ void cond_pre_broadcast(Addr const cond)
   if (s_trace_cond)
   {
     VG_(message)(Vg_UserMsg,
-                 "[%d/%d] cond_broadcast 0x%lx",
+                 "[%d/%d] cond_broadcast  cond 0x%lx",
                  VG_(get_running_tid)(),
                  thread_get_running_tid(),
                  cond);
index efcf6e60bb26494a35f8754791b9750ffadedc68..6bd675b43e6f0b2467158804f1a84aa865ad863c 100644 (file)
@@ -651,7 +651,7 @@ void drd_pre_mutex_lock(const Addr mutex, const MutexT mutex_type,
 
 void drd_post_mutex_lock(const Addr mutex, const Bool took_lock)
 {
-  mutex_post_lock(mutex, took_lock);
+  mutex_post_lock(mutex, took_lock, False);
 }
 
 void drd_pre_mutex_unlock(const Addr mutex, const MutexT mutex_type)
index 5f275a0b31e428e5f5139ad0abbab9d89d0886a8..c28487d4abb4303deb11c6c3400c13778e8ee618 100644 (file)
@@ -249,7 +249,8 @@ void mutex_pre_lock(const Addr mutex, const MutexT mutex_type,
  * Note: this function must be called after pthread_mutex_lock() has been
  * called, or a race condition is triggered !
  */
-void mutex_post_lock(const Addr mutex, const Bool took_lock)
+void mutex_post_lock(const Addr mutex, const Bool took_lock,
+                     const Bool post_cond_wait)
 {
   const DrdThreadId drd_tid = thread_get_running_tid();
   struct mutex_info* p;
@@ -259,9 +260,10 @@ void mutex_post_lock(const Addr mutex, const Bool took_lock)
   if (s_trace_mutex)
   {
     VG_(message)(Vg_UserMsg,
-                 "[%d/%d] post_mutex_lock %s 0x%lx rc %d owner %d%s",
+                 "[%d/%d] %s %s 0x%lx rc %d owner %d%s",
                  VG_(get_running_tid)(),
                  drd_tid,
+                 post_cond_wait ? "cond_post_wait " : "post_mutex_lock",
                  p ? mutex_get_typename(p) : "(?)",
                  mutex,
                  p ? p->recursion_count : 0,
index caabfb35ee667732f6c37e448a899c077a8e4f1b..52880ffb649b0bc9e6b369d272b554afc3c8047c 100644 (file)
@@ -46,7 +46,8 @@ void mutex_post_destroy(const Addr mutex);
 struct mutex_info* mutex_get(const Addr mutex);
 void mutex_pre_lock(const Addr mutex, const MutexT mutex_type,
                     const Bool trylock);
-void mutex_post_lock(const Addr mutex, const Bool took_lock);
+void mutex_post_lock(const Addr mutex, const Bool took_lock,
+                     const Bool post_cond_wait);
 void mutex_unlock(const Addr mutex, const MutexT mutex_type);
 const char* mutex_get_typename(struct mutex_info* const p);
 const char* mutex_type_name(const MutexT mt);
index d9c818f68b739806524e8a819359a4fa004affd9..dc5c9f5f812cb968d0181838ea86893d583e2597 100644 (file)
@@ -117,7 +117,7 @@ struct semaphore_info* semaphore_init(const Addr semaphore,
   if (s_trace_semaphore)
   {
     VG_(message)(Vg_UserMsg,
-                 "[%d/%d] semaphore_init 0x%lx",
+                 "[%d/%d] semaphore_init      0x%lx",
                  VG_(get_running_tid)(),
                  thread_get_running_tid(),
                  semaphore);
@@ -139,7 +139,7 @@ void semaphore_destroy(const Addr semaphore)
   if (s_trace_semaphore)
   {
     VG_(message)(Vg_UserMsg,
-                 "[%d/%d] semaphore_destroy 0x%lx",
+                 "[%d/%d] semaphore_destroy   0x%lx",
                  VG_(get_running_tid)(),
                  thread_get_running_tid(),
                  semaphore);
@@ -170,7 +170,7 @@ void semaphore_pre_wait(const Addr semaphore)
   if (s_trace_semaphore)
   {
     VG_(message)(Vg_UserMsg,
-                 "[%d/%d] semaphore_pre_wait 0x%lx",
+                 "[%d/%d] semaphore_pre_wait  0x%lx",
                  VG_(get_running_tid)(),
                  thread_get_running_tid(),
                  semaphore);
@@ -232,7 +232,7 @@ void semaphore_pre_post(const DrdThreadId tid, const Addr semaphore)
   if (s_trace_semaphore)
   {
     VG_(message)(Vg_UserMsg,
-                 "[%d/%d] semaphore_post 0x%lx",
+                 "[%d/%d] semaphore_post      0x%lx",
                  VG_(get_running_tid)(),
                  thread_get_running_tid(),
                  semaphore);
index 19944f296ea97c9e2a809b59f42be9e38416b4b5..a43c281f7ef00b079df55d62a272cdb764770916 100644 (file)
@@ -56,27 +56,27 @@ The object at address 0x........ is not a mutex.
 ---------------- pthread_cond_wait et al ----------------
 
 [1/1] mutex_init      error checking mutex 0x........
-[1/1] cond_init 0x........
+[1/1] cond_init       cond 0x........
 [1/1] mutex_unlock    error checking mutex 0x........ rc 0
 
 Mutex not locked: mutex 0x........, recursion count 0, owner 0.
    at 0x........: pthread_cond_wait* (drd_pthread_intercepts.c:?)
    by 0x........: main (tc20_verifywrap.c:147)
-[1/1] cond_pre_wait 0x........
-[1/1] cond_post_wait 0x........
-[1/1] post_mutex_lock error checking mutex 0x........ rc 0 owner 0
-[1/1] cond_signal 0x........
+[1/1] cond_pre_wait   cond 0x........
+[1/1] cond_post_wait  cond 0x........
+[1/1] cond_post_wait  error checking mutex 0x........ rc 0 owner 0
+[1/1] cond_signal     cond 0x........
 
 FIXME: can't figure out how to verify wrap of pthread_cond_signal
 
-[1/1] cond_broadcast 0x........
+[1/1] cond_broadcast  cond 0x........
 
 FIXME: can't figure out how to verify wrap of pthread_broadcast_signal
 
 [1/1] mutex_unlock    error checking mutex 0x........ rc 1
-[1/1] cond_pre_wait 0x........
-[1/1] cond_post_wait 0x........
-[1/1] post_mutex_lock error checking mutex 0x........ rc 0 owner 1
+[1/1] cond_pre_wait   cond 0x........
+[1/1] cond_post_wait  cond 0x........
+[1/1] cond_post_wait  error checking mutex 0x........ rc 0 owner 1
 
 ---------------- pthread_rwlock_* ----------------
 
@@ -107,22 +107,22 @@ Reader-writer lock not locked by calling thread: rwlock 0x.........
 
 ---------------- sem_* ----------------
 
-[1/1] semaphore_init 0x........
-[1/1] semaphore_init 0x........
+[1/1] semaphore_init      0x........
+[1/1] semaphore_init      0x........
 
 FIXME: can't figure out how to verify wrap of sem_destroy
 
-[1/1] semaphore_pre_wait 0x........
+[1/1] semaphore_pre_wait  0x........
 [1/1] semaphore_post_wait 0x........
 
 Invalid semaphore: semaphore 0x........
    at 0x........: sem_wait* (drd_pthread_intercepts.c:?)
    by 0x........: main (tc20_verifywrap.c:242)
-[1/1] semaphore_post 0x........
+[1/1] semaphore_post      0x........
 
 FIXME: can't figure out how to verify wrap of sem_post
 
-[1/1] semaphore_destroy 0x........
+[1/1] semaphore_destroy   0x........
 
 ------------ dealloc of mem holding locks ------------
 
index 8017f924ce1a19c67fc4fe104413434d99023bb5..902270b2d0fe868631c766167181c119b91dd444 100644 (file)
@@ -53,27 +53,27 @@ The object at address 0x........ is not a mutex.
 ---------------- pthread_cond_wait et al ----------------
 
 [1/1] mutex_init      error checking mutex 0x........
-[1/1] cond_init 0x........
+[1/1] cond_init       cond 0x........
 [1/1] mutex_unlock    error checking mutex 0x........ rc 0
 
 Mutex not locked: mutex 0x........, recursion count 0, owner 0.
    at 0x........: pthread_cond_wait* (drd_pthread_intercepts.c:?)
    by 0x........: main (tc20_verifywrap.c:147)
-[1/1] cond_pre_wait 0x........
-[1/1] cond_post_wait 0x........
-[1/1] post_mutex_lock error checking mutex 0x........ rc 0 owner 0
-[1/1] cond_signal 0x........
+[1/1] cond_pre_wait   cond 0x........
+[1/1] cond_post_wait  cond 0x........
+[1/1] cond_post_wait  error checking mutex 0x........ rc 0 owner 0
+[1/1] cond_signal     cond 0x........
 
 FIXME: can't figure out how to verify wrap of pthread_cond_signal
 
-[1/1] cond_broadcast 0x........
+[1/1] cond_broadcast  cond 0x........
 
 FIXME: can't figure out how to verify wrap of pthread_broadcast_signal
 
 [1/1] mutex_unlock    error checking mutex 0x........ rc 1
-[1/1] cond_pre_wait 0x........
-[1/1] cond_post_wait 0x........
-[1/1] post_mutex_lock error checking mutex 0x........ rc 0 owner 1
+[1/1] cond_pre_wait   cond 0x........
+[1/1] cond_post_wait  cond 0x........
+[1/1] cond_post_wait  error checking mutex 0x........ rc 0 owner 1
 
 ---------------- pthread_rwlock_* ----------------
 
@@ -104,22 +104,22 @@ Reader-writer lock not locked by calling thread: rwlock 0x.........
 
 ---------------- sem_* ----------------
 
-[1/1] semaphore_init 0x........
-[1/1] semaphore_init 0x........
+[1/1] semaphore_init      0x........
+[1/1] semaphore_init      0x........
 
 FIXME: can't figure out how to verify wrap of sem_destroy
 
-[1/1] semaphore_pre_wait 0x........
+[1/1] semaphore_pre_wait  0x........
 [1/1] semaphore_post_wait 0x........
 
 Invalid semaphore: semaphore 0x........
    at 0x........: sem_wait* (drd_pthread_intercepts.c:?)
    by 0x........: main (tc20_verifywrap.c:242)
-[1/1] semaphore_post 0x........
+[1/1] semaphore_post      0x........
 
 FIXME: can't figure out how to verify wrap of sem_post
 
-[1/1] semaphore_destroy 0x........
+[1/1] semaphore_destroy   0x........
 
 ------------ dealloc of mem holding locks ------------
 
index e7226db2a6272434d192581104701d2386bbd529..8dca5324b38d7a7fe41a234de82e25e6a1780c0a 100644 (file)
@@ -53,27 +53,27 @@ The object at address 0x........ is not a mutex.
 ---------------- pthread_cond_wait et al ----------------
 
 [1/1] mutex_init      error checking mutex 0x........
-[1/1] cond_init 0x........
+[1/1] cond_init       cond 0x........
 [1/1] mutex_unlock    error checking mutex 0x........ rc 0
 
 Mutex not locked: mutex 0x........, recursion count 0, owner 0.
    at 0x........: pthread_cond_wait* (drd_pthread_intercepts.c:?)
    by 0x........: main (tc20_verifywrap.c:147)
-[1/1] cond_pre_wait 0x........
-[1/1] cond_post_wait 0x........
-[1/1] post_mutex_lock error checking mutex 0x........ rc 0 owner 0
-[1/1] cond_signal 0x........
+[1/1] cond_pre_wait   cond 0x........
+[1/1] cond_post_wait  cond 0x........
+[1/1] cond_post_wait  error checking mutex 0x........ rc 0 owner 0
+[1/1] cond_signal     cond 0x........
 
 FIXME: can't figure out how to verify wrap of pthread_cond_signal
 
-[1/1] cond_broadcast 0x........
+[1/1] cond_broadcast  cond 0x........
 
 FIXME: can't figure out how to verify wrap of pthread_broadcast_signal
 
 [1/1] mutex_unlock    error checking mutex 0x........ rc 1
-[1/1] cond_pre_wait 0x........
-[1/1] cond_post_wait 0x........
-[1/1] post_mutex_lock error checking mutex 0x........ rc 0 owner 1
+[1/1] cond_pre_wait   cond 0x........
+[1/1] cond_post_wait  cond 0x........
+[1/1] cond_post_wait  error checking mutex 0x........ rc 0 owner 1
 
 ---------------- pthread_rwlock_* ----------------
 
@@ -104,22 +104,22 @@ Reader-writer lock not locked by calling thread: rwlock 0x.........
 
 ---------------- sem_* ----------------
 
-[1/1] semaphore_init 0x........
-[1/1] semaphore_init 0x........
+[1/1] semaphore_init      0x........
+[1/1] semaphore_init      0x........
 
 FIXME: can't figure out how to verify wrap of sem_destroy
 
-[1/1] semaphore_pre_wait 0x........
+[1/1] semaphore_pre_wait  0x........
 [1/1] semaphore_post_wait 0x........
 
 Invalid semaphore: semaphore 0x........
    at 0x........: sem_wait* (drd_pthread_intercepts.c:?)
    by 0x........: main (tc20_verifywrap.c:242)
-[1/1] semaphore_post 0x........
+[1/1] semaphore_post      0x........
 
 FIXME: can't figure out how to verify wrap of sem_post
 
-[1/1] semaphore_destroy 0x........
+[1/1] semaphore_destroy   0x........
 
 ------------ dealloc of mem holding locks ------------