|
From: <sv...@va...> - 2008-03-30 13:28:29
|
Author: bart
Date: 2008-03-30 14:28:33 +0100 (Sun, 30 Mar 2008)
New Revision: 7821
Log:
Modified mutex and condtion variable tracing output slightly.
Modified:
trunk/exp-drd/drd_clientreq.c
trunk/exp-drd/drd_cond.c
trunk/exp-drd/drd_main.c
trunk/exp-drd/drd_mutex.c
trunk/exp-drd/drd_mutex.h
trunk/exp-drd/drd_semaphore.c
trunk/exp-drd/tests/tc20_verifywrap2.stderr.exp
trunk/exp-drd/tests/tc20_verifywrap2.stderr.exp-glibc2.3
trunk/exp-drd/tests/tc20_verifywrap2.stderr.exp-glibc2.3-b
Modified: trunk/exp-drd/drd_clientreq.c
===================================================================
--- trunk/exp-drd/drd_clientreq.c 2008-03-30 10:03:04 UTC (rev 7820)
+++ trunk/exp-drd/drd_clientreq.c 2008-03-30 13:28:33 UTC (rev 7821)
@@ -66,7 +66,7 @@
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)
Modified: trunk/exp-drd/drd_cond.c
===================================================================
--- trunk/exp-drd/drd_cond.c 2008-03-30 10:03:04 UTC (rev 7820)
+++ trunk/exp-drd/drd_cond.c 2008-03-30 13:28:33 UTC (rev 7821)
@@ -116,7 +116,7 @@
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 @@
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 @@
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 @@
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 @@
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 @@
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);
Modified: trunk/exp-drd/drd_main.c
===================================================================
--- trunk/exp-drd/drd_main.c 2008-03-30 10:03:04 UTC (rev 7820)
+++ trunk/exp-drd/drd_main.c 2008-03-30 13:28:33 UTC (rev 7821)
@@ -651,7 +651,7 @@
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)
Modified: trunk/exp-drd/drd_mutex.c
===================================================================
--- trunk/exp-drd/drd_mutex.c 2008-03-30 10:03:04 UTC (rev 7820)
+++ trunk/exp-drd/drd_mutex.c 2008-03-30 13:28:33 UTC (rev 7821)
@@ -249,7 +249,8 @@
* 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 @@
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,
Modified: trunk/exp-drd/drd_mutex.h
===================================================================
--- trunk/exp-drd/drd_mutex.h 2008-03-30 10:03:04 UTC (rev 7820)
+++ trunk/exp-drd/drd_mutex.h 2008-03-30 13:28:33 UTC (rev 7821)
@@ -46,7 +46,8 @@
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);
Modified: trunk/exp-drd/drd_semaphore.c
===================================================================
--- trunk/exp-drd/drd_semaphore.c 2008-03-30 10:03:04 UTC (rev 7820)
+++ trunk/exp-drd/drd_semaphore.c 2008-03-30 13:28:33 UTC (rev 7821)
@@ -117,7 +117,7 @@
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 @@
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 @@
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 @@
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);
Modified: trunk/exp-drd/tests/tc20_verifywrap2.stderr.exp
===================================================================
--- trunk/exp-drd/tests/tc20_verifywrap2.stderr.exp 2008-03-30 10:03:04 UTC (rev 7820)
+++ trunk/exp-drd/tests/tc20_verifywrap2.stderr.exp 2008-03-30 13:28:33 UTC (rev 7821)
@@ -56,27 +56,27 @@
---------------- 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 @@
---------------- 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 ------------
Modified: trunk/exp-drd/tests/tc20_verifywrap2.stderr.exp-glibc2.3
===================================================================
--- trunk/exp-drd/tests/tc20_verifywrap2.stderr.exp-glibc2.3 2008-03-30 10:03:04 UTC (rev 7820)
+++ trunk/exp-drd/tests/tc20_verifywrap2.stderr.exp-glibc2.3 2008-03-30 13:28:33 UTC (rev 7821)
@@ -53,27 +53,27 @@
---------------- 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 @@
---------------- 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 ------------
Modified: trunk/exp-drd/tests/tc20_verifywrap2.stderr.exp-glibc2.3-b
===================================================================
--- trunk/exp-drd/tests/tc20_verifywrap2.stderr.exp-glibc2.3-b 2008-03-30 10:03:04 UTC (rev 7820)
+++ trunk/exp-drd/tests/tc20_verifywrap2.stderr.exp-glibc2.3-b 2008-03-30 13:28:33 UTC (rev 7821)
@@ -53,27 +53,27 @@
---------------- 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 @@
---------------- 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 ------------
|